Skip to content

Commit 4872860

Browse files
committed
GH-47469: [C++][Gandiva] Add support for LLVM 21.1.0
1 parent 427caf0 commit 4872860

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}")
177177
set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support")
178178

179179
set(ARROW_LLVM_VERSIONS
180+
"21.1"
180181
"20.1"
181182
"19.1"
182183
"18.1"

cpp/src/gandiva/engine.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,16 @@ Status UseJITLinkIfEnabled(llvm::orc::LLJITBuilder& jit_builder) {
202202
static auto maybe_use_jit_link = ::arrow::internal::GetEnvVar("GANDIVA_USE_JIT_LINK");
203203
if (maybe_use_jit_link.ok()) {
204204
ARROW_ASSIGN_OR_RAISE(static auto memory_manager, CreateMemmoryManager());
205+
# if LLVM_VERSION_MAJOR >= 21
206+
jit_builder.setObjectLinkingLayerCreator([&](llvm::orc::ExecutionSession& ES) {
207+
return std::make_unique<llvm::orc::ObjectLinkingLayer>(ES, *memory_manager);
208+
});
209+
# else
205210
jit_builder.setObjectLinkingLayerCreator(
206211
[&](llvm::orc::ExecutionSession& ES, const llvm::Triple& TT) {
207212
return std::make_unique<llvm::orc::ObjectLinkingLayer>(ES, *memory_manager);
208213
});
214+
# endif
209215
}
210216
return Status::OK();
211217
}

cpp/src/gandiva/llvm_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class GANDIVA_EXPORT LLVMTypes {
5656
llvm::Type* double_type() { return llvm::Type::getDoubleTy(context_); }
5757

5858
llvm::PointerType* ptr_type(llvm::Type* type) {
59-
return llvm::PointerType::get(type, 0);
59+
return llvm::PointerType::get(context_, 0);
6060
}
6161

6262
llvm::PointerType* i8_ptr_type() { return ptr_type(i8_type()); }

0 commit comments

Comments
 (0)