jit: Use opaque pointers in all supported LLVM versions.

LLVM's opaque pointer change began in LLVM 14, but remained optional
until LLVM 16.  When commit 37d5babb added opaque pointer support, we
didn't turn it on for LLVM 14 and 15 yet because we didn't want to risk
weird bitcode incompatibility problems in released branches of
PostgreSQL.  (That might have been overly cautious, I don't know.)

Now that PostgreSQL 18 has dropped support for LLVM versions < 14, and
since it hasn't been released yet and no extensions or bitcode have been
built against it in the wild yet, we can be more aggressive.  We can rip
out the support code and build system clutter that made opaque pointer
use optional.

Author: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussions: https://postgr.es/m/CA%2BhUKGLhNs5geZaVNj2EJ79Dx9W8fyWUU3HxcpZy55sMGcY%3DiA%40mail.gmail.com
This commit is contained in:
Peter Eisentraut
2024-10-01 05:05:51 -04:00
parent 972c2cd288
commit ee4859123e
5 changed files with 0 additions and 124 deletions

View File

@ -107,41 +107,25 @@ l_pbool_const(bool i)
static inline LLVMValueRef
l_struct_gep(LLVMBuilderRef b, LLVMTypeRef t, LLVMValueRef v, int32 idx, const char *name)
{
#if LLVM_VERSION_MAJOR < 16
return LLVMBuildStructGEP(b, v, idx, "");
#else
return LLVMBuildStructGEP2(b, t, v, idx, "");
#endif
}
static inline LLVMValueRef
l_gep(LLVMBuilderRef b, LLVMTypeRef t, LLVMValueRef v, LLVMValueRef *indices, int32 nindices, const char *name)
{
#if LLVM_VERSION_MAJOR < 16
return LLVMBuildGEP(b, v, indices, nindices, name);
#else
return LLVMBuildGEP2(b, t, v, indices, nindices, name);
#endif
}
static inline LLVMValueRef
l_load(LLVMBuilderRef b, LLVMTypeRef t, LLVMValueRef v, const char *name)
{
#if LLVM_VERSION_MAJOR < 16
return LLVMBuildLoad(b, v, name);
#else
return LLVMBuildLoad2(b, t, v, name);
#endif
}
static inline LLVMValueRef
l_call(LLVMBuilderRef b, LLVMTypeRef t, LLVMValueRef fn, LLVMValueRef *args, int32 nargs, const char *name)
{
#if LLVM_VERSION_MAJOR < 16
return LLVMBuildCall(b, fn, args, nargs, name);
#else
return LLVMBuildCall2(b, t, fn, args, nargs, name);
#endif
}
/*