about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2023-12-11 09:27:09 +0000
committerKrasimir Georgiev <krasimir@google.com>2023-12-11 09:27:09 +0000
commita0c5079889b1f86dd9e246d8863a5c8b44fbdb78 (patch)
tree4673915e16e6db8e7c3c92ecce2579d8f9307850 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentc13187c9983a58f689531002e696ec206450b338 (diff)
downloadrust-a0c5079889b1f86dd9e246d8863a5c8b44fbdb78.tar.gz
rust-a0c5079889b1f86dd9e246d8863a5c8b44fbdb78.zip
llvm-wrapper: adapt for LLVM API change
LLVM commit https://github.com/llvm/llvm-project/commit/1d608fc755a3e15d0020f61c9535c9b730ab9dec
renamed the pass.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 55e1c84c8a2..2601d96b8c8 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -841,7 +841,11 @@ LLVMRustOptimize(
         // cargo run tests in multhreading mode by default
         // so use atomics for coverage counters
         Options.Atomic = true;
+#if LLVM_VERSION_GE(18, 0)
+        MPM.addPass(InstrProfilingLoweringPass(Options, false));
+#else
         MPM.addPass(InstrProfiling(Options, false));
+#endif
       }
     );
   }