summaryrefslogtreecommitdiff
path: root/src/include/jit/llvmjit.h
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:04:00 +1300
commit981292c19f387c5416294096a22507a54ca30136 (patch)
tree9bcdf13e6950112ecfe4f8f46366b8eada0442e8 /src/include/jit/llvmjit.h
parentf28956b239f19858e7c429d3065678ce79c5104b (diff)
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/include/jit/llvmjit.h')
-rw-r--r--src/include/jit/llvmjit.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/jit/llvmjit.h b/src/include/jit/llvmjit.h
index a0e910323b8..7d3f8b358fc 100644
--- a/src/include/jit/llvmjit.h
+++ b/src/include/jit/llvmjit.h
@@ -139,6 +139,10 @@ extern unsigned LLVMGetAttributeCountAtIndexPG(LLVMValueRef F, uint32 Idx);
extern LLVMTypeRef LLVMGetFunctionReturnType(LLVMValueRef r);
extern LLVMTypeRef LLVMGetFunctionType(LLVMValueRef r);
+#if LLVM_MAJOR_VERSION < 8
+extern LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef g);
+#endif
+
#ifdef __cplusplus
} /* extern "C" */
#endif