This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 235841d644 GH-49087 [CI][Packaging][Gandiva] Add support for LLVM 15
or earlier again (#49091)
235841d644 is described below
commit 235841d644d5454f7067c44f580f301446ba1cc0
Author: Logan Riggs <[email protected]>
AuthorDate: Sat Jan 31 01:19:38 2026 -0800
GH-49087 [CI][Packaging][Gandiva] Add support for LLVM 15 or earlier again
(#49091)
### Rationale for this change
LLVM 15 or earlier uses `llvm::Optional` not `std::optional`.
### What changes are included in this PR?
Use `llvm::Optional` with LLVM 15 or earlier.
### Are these changes tested?
Yes, compiling.
### Are there any user-facing changes?
No
* GitHub Issue: #49087
Authored-by: [email protected] <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/gandiva/engine.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cpp/src/gandiva/engine.cc b/cpp/src/gandiva/engine.cc
index 496722b1ea..cc10eb352d 100644
--- a/cpp/src/gandiva/engine.cc
+++ b/cpp/src/gandiva/engine.cc
@@ -230,7 +230,11 @@ Result<std::unique_ptr<llvm::orc::LLJIT>> BuildJIT(
#endif
jit_builder.setJITTargetMachineBuilder(std::move(jtmb));
+#if LLVM_VERSION_MAJOR >= 16
jit_builder.setDataLayout(std::make_optional(data_layout));
+#else
+ jit_builder.setDataLayout(llvm::Optional<llvm::DataLayout>(data_layout));
+#endif
if (object_cache.has_value()) {
jit_builder.setCompileFunctionCreator(