Skip to content

Commit

Permalink
apacheGH-44222: [C++][Gandiva] Accept LLVM 19.1 (apache#44233)
Browse files Browse the repository at this point in the history
### 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: apache#44222

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou authored Sep 27, 2024
1 parent f43e92d commit 3505457
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 3505457

Please sign in to comment.