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 3505457946 GH-44222: [C++][Gandiva] Accept LLVM 19.1 (#44233)
3505457946 is described below

commit 3505457946192ef2ee0beac3356d9c0ed0d22b0f
Author: Sutou Kouhei <[email protected]>
AuthorDate: Fri Sep 27 10:34:48 2024 +0900

    GH-44222: [C++][Gandiva] Accept LLVM 19.1 (#44233)
    
    ### Rationale for this change
    
    LLVM 19.1.0 was released.
    
    ### What changes are included in this PR?
    
    Accept LLVM 19.1.0.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    Yes.
    * GitHub Issue: #44222
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/CMakeLists.txt        | 1 +
 cpp/src/gandiva/engine.cc | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 423744c388..a40afd00c8 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -160,6 +160,7 @@ set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}")
 set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support")
 
 set(ARROW_LLVM_VERSIONS
+    "19.1"
     "18.1"
     "17.0"
     "16.0"
diff --git a/cpp/src/gandiva/engine.cc b/cpp/src/gandiva/engine.cc
index 065ea5a598..244e1a45bd 100644
--- a/cpp/src/gandiva/engine.cc
+++ b/cpp/src/gandiva/engine.cc
@@ -263,9 +263,15 @@ void Engine::InitOnce() {
   llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr);
 
   cpu_name = llvm::sys::getHostCPUName();
+#if LLVM_VERSION_MAJOR >= 19
+  auto host_features = llvm::sys::getHostCPUFeatures();
+  const bool have_host_features = true;
+#else
   llvm::StringMap<bool> host_features;
+  const auto have_host_features = llvm::sys::getHostCPUFeatures(host_features);
+#endif
   std::string cpu_attrs_str;
-  if (llvm::sys::getHostCPUFeatures(host_features)) {
+  if (have_host_features) {
     for (auto& f : host_features) {
       std::string attr = f.second ? std::string("+") + f.first().str()
                                   : std::string("-") + f.first().str();

Reply via email to