Skip to content

Commit

Permalink
apacheGH-44222: [C++][Gandiva] Accept LLVM 19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 26, 2024
1 parent f43e92d commit b9189ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion cpp/src/gandiva/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b9189ae

Please sign in to comment.