]> git.lizzy.rs Git - rust.git/commitdiff
Enable use after scope detection in the new LLVM pass manager
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Thu, 13 Feb 2020 00:00:00 +0000 (00:00 +0000)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Thu, 13 Feb 2020 00:00:00 +0000 (00:00 +0000)
Implementation of 08a1c566a792dcf9657d293155f7ada87746bb65 for the new
LLVM pass manager, support for which landed in the meantime.

src/rustllvm/PassWrapper.cpp

index 15e2251d763214789e515070d8b870bfddd78f5c..8cebcaccfaad77568ac5ad2776998b556365c71e 100644 (file)
@@ -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(