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:
parent
eee8b9c7ba
commit
6234a56949
1 changed files with 9 additions and 6 deletions
|
@ -889,15 +889,18 @@ LLVMRustOptimizeWithNewPassManager(
|
||||||
OptimizerLastEPCallbacks.push_back(
|
OptimizerLastEPCallbacks.push_back(
|
||||||
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
|
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
|
||||||
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
|
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
|
||||||
MPM.addPass(ModuleAddressSanitizerPass(
|
|
||||||
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
|
|
||||||
#if LLVM_VERSION_GE(14, 0)
|
#if LLVM_VERSION_GE(14, 0)
|
||||||
AddressSanitizerOptions opts(/*CompileKernel=*/false,
|
AddressSanitizerOptions opts = AddressSanitizerOptions{
|
||||||
SanitizerOptions->SanitizeAddressRecover,
|
/*CompileKernel=*/false,
|
||||||
/*UseAfterScope=*/true,
|
SanitizerOptions->SanitizeAddressRecover,
|
||||||
AsanDetectStackUseAfterReturnMode::Runtime);
|
/*UseAfterScope=*/false,
|
||||||
|
AsanDetectStackUseAfterReturnMode::Runtime,
|
||||||
|
};
|
||||||
|
MPM.addPass(ModuleAddressSanitizerPass(opts));
|
||||||
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(opts)));
|
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(opts)));
|
||||||
#else
|
#else
|
||||||
|
MPM.addPass(ModuleAddressSanitizerPass(
|
||||||
|
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
|
||||||
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(
|
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(
|
||||||
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover,
|
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover,
|
||||||
/*UseAfterScope=*/true)));
|
/*UseAfterScope=*/true)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue