Skip to content

Commit

Permalink
Make LLVM backend compile again with LLVM 15.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Mar 31, 2024
1 parent 1349a0f commit ab77016
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ using namespace std;
// Assuming there is a single JSON string in the module
std::string llvm_dsp_factory_aux::findJSON(llvm::Module* module)
{
#if LLVM_VERSION_MAJOR >= 16
for (const auto& global : module->globals()) {
auto* initializer = global.getInitializer();
if (auto* array = llvm::dyn_cast<llvm::ConstantDataArray>(initializer)) {
if (array->isString()) return array->getAsString().str();
}
}
#endif
return "";
}

Expand Down

0 comments on commit ab77016

Please sign in to comment.