summaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit_deform.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2020-02-06 22:13:52 -0800
committerAndres Freund <andres@anarazel.de>2020-02-06 22:29:14 -0800
commitb059d2f45685a946da061ee15692fa306bd67f12 (patch)
treee25766aa5b1d63796236c8c3a8e17e7be94531fe /src/backend/jit/llvm/llvmjit_deform.c
parentc4f3b63caba02b087519d58cb9bf4990b9c8ec45 (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/backend/jit/llvm/llvmjit_deform.c')
-rw-r--r--src/backend/jit/llvm/llvmjit_deform.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/jit/llvm/llvmjit_deform.c b/src/backend/jit/llvm/llvmjit_deform.c
index ad2d3e5a5c8..d7a7b328e8b 100644
--- a/src/backend/jit/llvm/llvmjit_deform.c
+++ b/src/backend/jit/llvm/llvmjit_deform.c
@@ -331,7 +331,7 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc,
v_params[0] = v_slot;
v_params[1] = LLVMBuildZExt(b, v_maxatt, LLVMInt32Type(), "");
v_params[2] = l_int32_const(natts);
- LLVMBuildCall(b, llvm_get_decl(mod, FuncSlotGetmissingattrs),
+ LLVMBuildCall(b, llvm_pg_func(mod, "slot_getmissingattrs"),
v_params, lengthof(v_params), "");
LLVMBuildBr(b, b_find_start);
}
@@ -682,7 +682,7 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc,
else if (att->attlen == -1)
{
v_incby = LLVMBuildCall(b,
- llvm_get_decl(mod, FuncVarsizeAny),
+ llvm_pg_func(mod, "varsize_any"),
&v_attdatap, 1,
"varsize_any");
l_callsite_ro(v_incby);
@@ -691,7 +691,7 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc,
else if (att->attlen == -2)
{
v_incby = LLVMBuildCall(b,
- llvm_get_decl(mod, FuncStrlen),
+ llvm_pg_func(mod, "strlen"),
&v_attdatap, 1, "strlen");
l_callsite_ro(v_incby);