mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
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`
This commit is contained in:
commit
1fe15be34c
@ -889,15 +889,17 @@ LLVMRustOptimizeWithNewPassManager(
|
||||
OptimizerLastEPCallbacks.push_back(
|
||||
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
|
||||
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
|
||||
#if LLVM_VERSION_GE(14, 0)
|
||||
AddressSanitizerOptions opts = AddressSanitizerOptions{
|
||||
/*CompileKernel=*/false,
|
||||
SanitizerOptions->SanitizeAddressRecover,
|
||||
/*UseAfterScope=*/true,
|
||||
AsanDetectStackUseAfterReturnMode::Runtime,
|
||||
};
|
||||
MPM.addPass(ModuleAddressSanitizerPass(opts));
|
||||
#else
|
||||
MPM.addPass(ModuleAddressSanitizerPass(
|
||||
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
|
||||
#if LLVM_VERSION_GE(14, 0)
|
||||
AddressSanitizerOptions opts(/*CompileKernel=*/false,
|
||||
SanitizerOptions->SanitizeAddressRecover,
|
||||
/*UseAfterScope=*/true,
|
||||
AsanDetectStackUseAfterReturnMode::Runtime);
|
||||
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(opts)));
|
||||
#else
|
||||
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(
|
||||
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover,
|
||||
/*UseAfterScope=*/true)));
|
||||
|
Loading…
Reference in New Issue
Block a user