Skip to content

Commit

Permalink
Add support for llvm 19 to original (reverted-to) code.
Browse files Browse the repository at this point in the history
  • Loading branch information
lriggs committed Jan 2, 2025
1 parent 4e8a57a commit 150d723
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cpp/src/gandiva/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,14 @@ static void SetDataLayout(llvm::Module* module) {
llvm::SubtargetFeatures features;
llvm::StringMap<bool> host_features;

if (llvm::sys::getHostCPUFeatures(host_features)) {
#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
if (have_host_features) {
for (auto& f : host_features) {
features.AddFeature(f.first(), f.second);
}
Expand Down

0 comments on commit 150d723

Please sign in to comment.