diff --git a/src/LLVM_Headers.h b/src/LLVM_Headers.h index 9718d94b2a35..f384e446933b 100644 --- a/src/LLVM_Headers.h +++ b/src/LLVM_Headers.h @@ -92,6 +92,9 @@ #include #include #include +#if LLVM_VERSION >= 220 +#include "llvm/Analysis/RuntimeLibcallInfo.h" +#endif // IWYU pragma: end_exports diff --git a/src/LLVM_Output.cpp b/src/LLVM_Output.cpp index 63171c63e731..5cc2fe0a341a 100644 --- a/src/LLVM_Output.cpp +++ b/src/LLVM_Output.cpp @@ -390,6 +390,14 @@ void emit_file(const llvm::Module &module_in, Internal::LLVMOStream &out, const auto &triple = llvm::Triple(module->getTargetTriple()); pass_manager.add(new llvm::TargetLibraryInfoWrapperPass(triple)); +#if LLVM_VERSION >= 220 + pass_manager.add(new llvm::RuntimeLibraryInfoWrapper( + module->getTargetTriple(), target_machine->Options.ExceptionModel, + target_machine->Options.FloatABIType, + target_machine->Options.EABIVersion, + target_machine->Options.MCOptions.ABIName, + target_machine->Options.VecLib)); +#endif // Make sure things marked as always-inline get inlined pass_manager.add(llvm::createAlwaysInlinerLegacyPass());