File tree 1 file changed +7
-1
lines changed
compiler/rustc_llvm/llvm-wrapper 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -936,12 +936,14 @@ LLVMRustOptimizeWithNewPassManager(
936
936
/* CompileKernel=*/ false );
937
937
OptimizerLastEPCallbacks.push_back (
938
938
[Options](ModulePassManager &MPM, OptimizationLevel Level) {
939
- #if LLVM_VERSION_GE(14, 0)
939
+ #if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)
940
940
MPM.addPass (ModuleMemorySanitizerPass (Options));
941
941
#else
942
942
MPM.addPass (MemorySanitizerPass (Options));
943
943
#endif
944
+ #if LLVM_VERSION_LT(16, 0)
944
945
MPM.addPass (createModuleToFunctionPassAdaptor (MemorySanitizerPass (Options)));
946
+ #endif
945
947
}
946
948
);
947
949
}
@@ -972,7 +974,11 @@ LLVMRustOptimizeWithNewPassManager(
972
974
/* UseAfterScope=*/ true ,
973
975
AsanDetectStackUseAfterReturnMode::Runtime,
974
976
};
977
+ #if LLVM_VERSION_LT(16, 0)
975
978
MPM.addPass (ModuleAddressSanitizerPass (opts));
979
+ #else
980
+ MPM.addPass (AddressSanitizerPass (opts));
981
+ #endif
976
982
#else
977
983
MPM.addPass (ModuleAddressSanitizerPass (
978
984
/* CompileKernel=*/ false , SanitizerOptions->SanitizeAddressRecover ));
You can’t perform that action at this time.
0 commit comments