Skip to content

Commit 167777f

Browse files
authored
Rollup merge of #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 5360e37 + 50a5ebe commit 167777f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -885,15 +885,18 @@ LLVMRustOptimizeWithNewPassManager(
885885
OptimizerLastEPCallbacks.push_back(
886886
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
887887
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
888-
MPM.addPass(ModuleAddressSanitizerPass(
889-
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
890888
#if LLVM_VERSION_GE(14, 0)
891-
AddressSanitizerOptions opts(/*CompileKernel=*/false,
892-
SanitizerOptions->SanitizeAddressRecover,
893-
/*UseAfterScope=*/true,
894-
AsanDetectStackUseAfterReturnMode::Runtime);
889+
AddressSanitizerOptions opts = AddressSanitizerOptions{
890+
/*CompileKernel=*/false,
891+
SanitizerOptions->SanitizeAddressRecover,
892+
/*UseAfterScope=*/false,
893+
AsanDetectStackUseAfterReturnMode::Runtime,
894+
};
895+
MPM.addPass(ModuleAddressSanitizerPass(opts));
895896
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(opts)));
896897
#else
898+
MPM.addPass(ModuleAddressSanitizerPass(
899+
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
897900
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(
898901
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover,
899902
/*UseAfterScope=*/true)));

0 commit comments

Comments
 (0)