From e5ccd27e679d44e9251bc7f5a879f14c23eb8c25 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Fri, 25 Nov 2022 11:29:00 +0000 Subject: [PATCH] [llvm-wrapper] adapt for LLVM API change Adapt for the LLVM API changes from https://github.com/llvm/llvm-project/commit/721f975d3518403502f770ce11f3f02509b30c5b#diff-5a347903b8412ed1b1b1948c3fce47f9a6ff05dc70bfaeedb6d06b622e399d91. --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 5f02bb6c307..7f4d63eed8b 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -627,7 +627,11 @@ LLVMRustOptimize( bool DebugPassManager = false; PassInstrumentationCallbacks PIC; +#if LLVM_VERSION_LT(16, 0) StandardInstrumentations SI(DebugPassManager); +#else + StandardInstrumentations SI(TheModule->getContext(), DebugPassManager); +#endif SI.registerCallbacks(PIC); if (LlvmSelfProfiler){