From 765811b731af8358d40d66f3f6d3cac31e5a12f1 Mon Sep 17 00:00:00 2001 From: Logan Riggs Date: Wed, 18 Dec 2024 12:06:15 -0800 Subject: [PATCH] Fix error from JIT revert. --- cpp/src/gandiva/engine.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cpp/src/gandiva/engine.cc b/cpp/src/gandiva/engine.cc index 8c0fdbbcc8cb8..42316dce8d002 100644 --- a/cpp/src/gandiva/engine.cc +++ b/cpp/src/gandiva/engine.cc @@ -193,8 +193,13 @@ Status Engine::Make(const std::shared_ptr& conf, bool cached, // original Module. auto module_ptr = module.get(); - auto opt_level = - conf->optimize() ? llvm::CodeGenOpt::Aggressive : llvm::CodeGenOpt::None; +#if LLVM_VERSION_MAJOR >= 18 + using CodeGenOptLevel = llvm::CodeGenOptLevel; +#else + using CodeGenOptLevel = llvm::CodeGenOpt::Level; +#endif + auto const opt_level = + conf->optimize() ? CodeGenOptLevel::Aggressive : CodeGenOptLevel::None; // Note that the lifetime of the error string is not captured by the // ExecutionEngine but only for the lifetime of the builder. Found by