diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-09-17 14:09:50 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-17 14:09:50 +0900 |
| commit | 3cff47b608d68db3b59fd0cb8e8d34052f04dbff (patch) | |
| tree | 2bc8ac1d9dd8d3f9c3f31cf50763048966c8112c /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | c97ff098f192901b81dc2ad7142195757853964d (diff) | |
| parent | bc4d8af123ce376261b1abd7acbc7d67a0197280 (diff) | |
| download | rust-3cff47b608d68db3b59fd0cb8e8d34052f04dbff.tar.gz rust-3cff47b608d68db3b59fd0cb8e8d34052f04dbff.zip | |
Rollup merge of #89014 - durin42:llvm-14-module-pass-manager, r=nikic
PassWrapper: handle separate Module*SanitizerPass Change ab41eef9aca3 in LLVM split MemorySanitizerPass into MemorySanitizerPass for functions and ModuleMemorySanitizerPass for modules. There's a related change for ThreadSanitizerPass, and in here since we're using a ModulePassManager I only add the module flavor of the pass on LLVM 14. r? `@nikic` cc `@nagisa`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index b3f86f3295a..b7cad1c3ba6 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -875,7 +875,11 @@ LLVMRustOptimizeWithNewPassManager( #if LLVM_VERSION_GE(11, 0) OptimizerLastEPCallbacks.push_back( [Options](ModulePassManager &MPM, OptimizationLevel Level) { +#if LLVM_VERSION_GE(14, 0) + MPM.addPass(ModuleMemorySanitizerPass(Options)); +#else MPM.addPass(MemorySanitizerPass(Options)); +#endif MPM.addPass(createModuleToFunctionPassAdaptor(MemorySanitizerPass(Options))); } ); @@ -897,7 +901,11 @@ LLVMRustOptimizeWithNewPassManager( #if LLVM_VERSION_GE(11, 0) OptimizerLastEPCallbacks.push_back( [](ModulePassManager &MPM, OptimizationLevel Level) { +#if LLVM_VERSION_GE(14, 0) + MPM.addPass(ModuleThreadSanitizerPass()); +#else MPM.addPass(ThreadSanitizerPass()); +#endif MPM.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass())); } ); |
