aboutsummaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit_wrap.cpp
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-10-19 03:01:55 +1300
committerThomas Munro <tmunro@postgresql.org>2023-10-19 03:01:55 +1300
commitf90b4a846b32d3d6d2fd9d55a93735501e4c34fd (patch)
tree6537508d3061a818ff321f4bd1f3b58e099e07d2 /src/backend/jit/llvm/llvmjit_wrap.cpp
parent37d5babb5cfa4c6795b3cb6de964ba019d3d60ab (diff)
downloadpostgresql-f90b4a846b32d3d6d2fd9d55a93735501e4c34fd.tar.gz
postgresql-f90b4a846b32d3d6d2fd9d55a93735501e4c34fd.zip
jit: Supply LLVMGlobalGetValueType() for LLVM < 8.
Commit 37d5babb used this C API function while adding support for LLVM 16 and opaque pointers, but it's not available in LLVM 7 and older. Provide it in our own llvmjit_wrap.cpp. It just calls a C++ function that pre-dates LLVM 3.9, our minimum target. Back-patch to 12, like 37d5babb. Discussion: https://postgr.es/m/CA%2BhUKGKnLnJnWrkr%3D4mSGhE5FuTK55FY15uULR7%3Dzzc%3DwX4Nqw%40mail.gmail.com
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_wrap.cpp')
-rw-r--r--src/backend/jit/llvm/llvmjit_wrap.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/jit/llvm/llvmjit_wrap.cpp b/src/backend/jit/llvm/llvmjit_wrap.cpp
index 997a2c02789..cb896e2b6a5 100644
--- a/src/backend/jit/llvm/llvmjit_wrap.cpp
+++ b/src/backend/jit/llvm/llvmjit_wrap.cpp
@@ -88,3 +88,11 @@ LLVMGetFunctionType(LLVMValueRef r)
{
return llvm::wrap(llvm::unwrap<llvm::Function>(r)->getFunctionType());
}
+
+#if LLVM_VERSION_MAJOR < 8
+LLVMTypeRef
+LLVMGlobalGetValueType(LLVMValueRef g)
+{
+ return llvm::wrap(llvm::unwrap<llvm::GlobalValue>(g)->getValueType());
+}
+#endif