From 15803eb1cf96e6bd806595cbf6038ec9be861781 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..9f0a447f5 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, ThinOrFullLTOPhase::None); +#else llvm::ModulePassManager MPM = PB.buildPerModuleDefaultPipeline(level, false); - +#endif if (passes->should_verify) { MPM.addPass(llvm::VerifierPass());