diff options
| author | Andres Freund | 2020-02-07 06:13:52 +0000 |
|---|---|---|
| committer | Andres Freund | 2020-02-07 06:29:14 +0000 |
| commit | b059d2f45685a946da061ee15692fa306bd67f12 (patch) | |
| tree | e25766aa5b1d63796236c8c3a8e17e7be94531fe /src/include | |
| parent | c4f3b63caba02b087519d58cb9bf4990b9c8ec45 (diff) | |
jit: Reference expression step functions via llvmjit_types.
The main benefit of doing so is that this allows llvm to ensure that
types match - previously that'd only be detected by a crash within the
called function. There were a number of cases where we passed a
superfluous parameter...
To avoid needing to add all the functions to llvmjit.{c,h}, instead
get them from the llvm module for llvmjit_types.c. Also use that for
the functions from llvmjit_types already in llvmjit.h.
Author: Soumyadeep Chakraborty and Andres Freund
Discussion: https://postgr.es/m/CADwEdooww3wZv-sXSfatzFRwMuwa186LyTwkBfwEW6NjtooBPA@mail.gmail.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/jit/llvmjit.h | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/include/jit/llvmjit.h b/src/include/jit/llvmjit.h index a4eaa827354..706906c1cc8 100644 --- a/src/include/jit/llvmjit.h +++ b/src/include/jit/llvmjit.h @@ -55,6 +55,8 @@ typedef struct LLVMJitContext List *handles; } LLVMJitContext; +/* llvm module containing information about types */ +extern LLVMModuleRef llvm_types_module; /* type and struct definitions */ extern LLVMTypeRef TypeParamBool; @@ -78,15 +80,6 @@ extern LLVMTypeRef StructAggStatePerTransData; extern LLVMTypeRef StructAggStatePerGroupData; extern LLVMValueRef AttributeTemplate; -extern LLVMValueRef FuncStrlen; -extern LLVMValueRef FuncVarsizeAny; -extern LLVMValueRef FuncSlotGetmissingattrs; -extern LLVMValueRef FuncSlotGetsomeattrsInt; -extern LLVMValueRef FuncMakeExpandedObjectReadOnlyInternal; -extern LLVMValueRef FuncExecEvalSubscriptingRef; -extern LLVMValueRef FuncExecEvalSysVar; -extern LLVMValueRef FuncExecAggTransReparent; -extern LLVMValueRef FuncExecAggInitGroup; extern void llvm_enter_fatal_on_oom(void); @@ -99,7 +92,7 @@ extern LLVMModuleRef llvm_mutable_module(LLVMJitContext *context); extern char *llvm_expand_funcname(LLVMJitContext *context, const char *basename); extern void *llvm_get_function(LLVMJitContext *context, const char *funcname); extern void llvm_split_symbol_name(const char *name, char **modname, char **funcname); -extern LLVMValueRef llvm_get_decl(LLVMModuleRef mod, LLVMValueRef f); +extern LLVMValueRef llvm_pg_func(LLVMModuleRef mod, const char *funcname); extern void llvm_copy_attributes(LLVMValueRef from, LLVMValueRef to); extern LLVMValueRef llvm_function_reference(LLVMJitContext *context, LLVMBuilderRef builder, |
