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

Commitee3e4c4

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 parent82d9a78 commitee3e4c4

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
@@ -140,6 +140,10 @@ extern unsigned LLVMGetAttributeCountAtIndexPG(LLVMValueRef F, uint32 Idx);
140140
externLLVMTypeRefLLVMGetFunctionReturnType(LLVMValueRefr);
141141
externLLVMTypeRefLLVMGetFunctionType(LLVMValueRefr);
142142

143+
#ifLLVM_MAJOR_VERSION<8
144+
externLLVMTypeRefLLVMGlobalGetValueType(LLVMValueRefg);
145+
#endif
146+
143147
#ifdef__cplusplus
144148
}/* extern "C" */
145149
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp