Skip to content

Commit 1fe15be

Browse files
authored
Rollup merge of rust-lang#90589 - durin42:llvm-14-ASO-now-struct, r=nikic
rustc_llvm: update PassWrapper for recent LLVM Now AddressSanitizerOptions is a struct, but at least the change was tiny. r? `@nikic`
2 parents f31622a + d9f2d5f commit 1fe15be

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -889,15 +889,17 @@ LLVMRustOptimizeWithNewPassManager(
889889
OptimizerLastEPCallbacks.push_back(
890890
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
891891
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
892-
MPM.addPass(ModuleAddressSanitizerPass(
893-
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
894892
#if LLVM_VERSION_GE(14, 0)
895-
AddressSanitizerOptions opts(/*CompileKernel=*/false,
896-
SanitizerOptions->SanitizeAddressRecover,
897-
/*UseAfterScope=*/true,
898-
AsanDetectStackUseAfterReturnMode::Runtime);
899-
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(opts)));
893+
AddressSanitizerOptions opts = AddressSanitizerOptions{
894+
/*CompileKernel=*/false,
895+
SanitizerOptions->SanitizeAddressRecover,
896+
/*UseAfterScope=*/true,
897+
AsanDetectStackUseAfterReturnMode::Runtime,
898+
};
899+
MPM.addPass(ModuleAddressSanitizerPass(opts));
900900
#else
901+
MPM.addPass(ModuleAddressSanitizerPass(
902+
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
901903
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(
902904
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover,
903905
/*UseAfterScope=*/true)));

0 commit comments

Comments
 (0)