From bf437994e81a546dd9b29e8d812bf9744b286832 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sun, 3 Nov 2024 23:25:28 +0100 Subject: [PATCH] Fix LLVM 20 compilation --- wrapper/src/wrapper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wrapper/src/wrapper.cpp b/wrapper/src/wrapper.cpp index a2e8b8bc3..81ee9a0e4 100644 --- a/wrapper/src/wrapper.cpp +++ b/wrapper/src/wrapper.cpp @@ -191,8 +191,11 @@ bool llvm_run_passes(LLVMModuleRef m, LLVMTargetMachineRef tm, default: exit(-1); } +#if LLVM_VERSION_MAJOR > 19 + llvm::ModulePassManager MPM = PB.buildPerModuleDefaultPipeline(level, llvm::ThinOrFullLTOPhase::None); +#else llvm::ModulePassManager MPM = PB.buildPerModuleDefaultPipeline(level, false); - +#endif if (passes->should_verify) { MPM.addPass(llvm::VerifierPass());