Enable use after scope detection in the new LLVM pass manager
Implementation of 08a1c566a7 for the new
LLVM pass manager, support for which landed in the meantime.
This commit is contained in:
@@ -761,14 +761,14 @@ LLVMRustOptimizeWithNewPassManager(
|
||||
}
|
||||
|
||||
if (SanitizerOptions->SanitizeAddress) {
|
||||
// FIXME: Rust does not expose the UseAfterScope option.
|
||||
PipelineStartEPCallbacks.push_back([&](ModulePassManager &MPM) {
|
||||
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
|
||||
});
|
||||
OptimizerLastEPCallbacks.push_back(
|
||||
[SanitizerOptions](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) {
|
||||
FPM.addPass(AddressSanitizerPass(
|
||||
/*CompileKernel=*/false, SanitizerOptions->SanitizeRecover));
|
||||
/*CompileKernel=*/false, SanitizerOptions->SanitizeRecover,
|
||||
/*UseAfterScope=*/true));
|
||||
}
|
||||
);
|
||||
PipelineStartEPCallbacks.push_back(
|
||||
|
||||
Reference in New Issue
Block a user