Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf90b4a8

Browse files
committed
jit: Supply LLVMGlobalGetValueType() for LLVM < 8.
Commit37d5bab used this C API function while adding support for LLVM16 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++ functionthat pre-dates LLVM 3.9, our minimum target.Back-patch to 12, like37d5bab.Discussion:https://postgr.es/m/CA%2BhUKGKnLnJnWrkr%3D4mSGhE5FuTK55FY15uULR7%3Dzzc%3DwX4Nqw%40mail.gmail.com
1 parent37d5bab commitf90b4a8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

‎src/backend/jit/llvm/llvmjit_wrap.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,11 @@ LLVMGetFunctionType(LLVMValueRef r)
8888
{
8989
returnllvm::wrap(llvm::unwrap<llvm::Function>(r)->getFunctionType());
9090
}
91+
92+
#if LLVM_VERSION_MAJOR < 8
93+
LLVMTypeRef
94+
LLVMGlobalGetValueType(LLVMValueRef g)
95+
{
96+
returnllvm::wrap(llvm::unwrap<llvm::GlobalValue>(g)->getValueType());
97+
}
98+
#endif

‎src/include/jit/llvmjit.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ extern unsigned LLVMGetAttributeCountAtIndexPG(LLVMValueRef F, uint32 Idx);
146146
externLLVMTypeRefLLVMGetFunctionReturnType(LLVMValueRefr);
147147
externLLVMTypeRefLLVMGetFunctionType(LLVMValueRefr);
148148

149+
#ifLLVM_MAJOR_VERSION<8
150+
externLLVMTypeRefLLVMGlobalGetValueType(LLVMValueRefg);
151+
#endif
152+
149153
#ifdef__cplusplus
150154
}/* extern "C" */
151155
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp