From b0fe18a4bfd3bc1e69de8e541baa9bdf8a0cbddc Mon Sep 17 00:00:00 2001 From: Yue Ni Date: Tue, 26 Sep 2023 17:56:07 +0800 Subject: [PATCH] Support LLVM 17 for Gandiva. --- cpp/CMakeLists.txt | 1 + cpp/src/gandiva/CMakeLists.txt | 2 -- cpp/src/gandiva/engine.cc | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index f2906b960eba6..f0acab0389b19 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -152,6 +152,7 @@ set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}") set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support") set(ARROW_LLVM_VERSIONS + "17.0" "16.0" "15.0" "14.0" diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt index db260b5acc933..d2810c39f723c 100644 --- a/cpp/src/gandiva/CMakeLists.txt +++ b/cpp/src/gandiva/CMakeLists.txt @@ -31,8 +31,6 @@ if(ARROW_WITH_ZSTD AND "${zstd_SOURCE}" STREQUAL "SYSTEM") provide_find_module(zstdAlt "Gandiva") endif() -add_definitions(-DGANDIVA_LLVM_VERSION=${LLVM_VERSION_MAJOR}) - # Set the path where the bitcode file generated, see precompiled/CMakeLists.txt set(GANDIVA_PRECOMPILED_BC_PATH "${CMAKE_CURRENT_BINARY_DIR}/irhelpers.bc") set(GANDIVA_PRECOMPILED_CC_PATH "${CMAKE_CURRENT_BINARY_DIR}/precompiled_bitcode.cc") diff --git a/cpp/src/gandiva/engine.cc b/cpp/src/gandiva/engine.cc index b4eae03e1a2c0..6abe81405349a 100644 --- a/cpp/src/gandiva/engine.cc +++ b/cpp/src/gandiva/engine.cc @@ -54,7 +54,11 @@ #include #include #include +#if LLVM_VERSION_MAJOR >= 17 +#include +#else #include +#endif #include #include #include