Skip to content

Commit 3cff47b

Browse files
authored
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`
2 parents c97ff09 + bc4d8af commit 3cff47b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,11 @@ LLVMRustOptimizeWithNewPassManager(
875875
#if LLVM_VERSION_GE(11, 0)
876876
OptimizerLastEPCallbacks.push_back(
877877
[Options](ModulePassManager &MPM, OptimizationLevel Level) {
878+
#if LLVM_VERSION_GE(14, 0)
879+
MPM.addPass(ModuleMemorySanitizerPass(Options));
880+
#else
878881
MPM.addPass(MemorySanitizerPass(Options));
882+
#endif
879883
MPM.addPass(createModuleToFunctionPassAdaptor(MemorySanitizerPass(Options)));
880884
}
881885
);
@@ -897,7 +901,11 @@ LLVMRustOptimizeWithNewPassManager(
897901
#if LLVM_VERSION_GE(11, 0)
898902
OptimizerLastEPCallbacks.push_back(
899903
[](ModulePassManager &MPM, OptimizationLevel Level) {
904+
#if LLVM_VERSION_GE(14, 0)
905+
MPM.addPass(ModuleThreadSanitizerPass());
906+
#else
900907
MPM.addPass(ThreadSanitizerPass());
908+
#endif
901909
MPM.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass()));
902910
}
903911
);

0 commit comments

Comments
 (0)