about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-11 20:02:55 +0000
committerbors <bors@rust-lang.org>2023-12-11 20:02:55 +0000
commit21cce21d8c012f14cf74d5afddd795d324600dac (patch)
tree1f8f0d99025eb4f1bd7a19a97d7ae18fc121d4f6 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent57010939ed1d00076b4af0ed06a81ec69ea5e4a8 (diff)
parent1cf538b0b10805a20d1ca610919bc0d908ed260a (diff)
downloadrust-21cce21d8c012f14cf74d5afddd795d324600dac.tar.gz
rust-21cce21d8c012f14cf74d5afddd795d324600dac.zip
Auto merge of #118838 - matthiaskrgr:rollup-8kwzpho, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #118620 (resolve: Use `def_kind` query to cleanup some code)
 - #118647 (dump bootstrap shims)
 - #118726 (Do not parenthesize exterior struct lit inside match guards)
 - #118818 (llvm-wrapper: adapt for LLVM API change)
 - #118822 (Extract exhaustiveness into its own crate)
 - #118826 (Edit target doc template to remove email)
 - #118827 (Update table for linker-plugin-lto docs)
 - #118835 (Fix again `rustc_codegen_gcc` tests)

r? `@ghost`
`@rustbot` modify labels: rollup
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
       }
     );
   }