diff options
author | Leonard Chan <leonardchan@google.com> | 2019-02-14 01:07:47 +0000 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2019-02-14 01:07:47 +0000 |
commit | 619b6d5378554cdcc2e6311112e3bfef7c169d51 (patch) | |
tree | 1df792dcebc936812be513bba91b6ab521232e83 /clang/lib/CodeGen/BackendUtil.cpp | |
parent | 77e1f27476c89f65eeb496d131065177e6417f23 (diff) | |
download | bcm5719-llvm-619b6d5378554cdcc2e6311112e3bfef7c169d51.tar.gz bcm5719-llvm-619b6d5378554cdcc2e6311112e3bfef7c169d51.zip |
Fix for asan bots
llvm-svn: 353999
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 633c0dfb666..d86e24ff2dd 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -1066,19 +1066,22 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager( RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>()); }); bool Recover = CodeGenOpts.SanitizeRecover.has(SanitizerKind::Address); + bool UseAfterScope = CodeGenOpts.SanitizeAddressUseAfterScope; PB.registerOptimizerLastEPCallback( - [&](FunctionPassManager &FPM, - PassBuilder::OptimizationLevel Level) { + [Recover, UseAfterScope](FunctionPassManager &FPM, + PassBuilder::OptimizationLevel Level) { FPM.addPass(AddressSanitizerPass( - /*CompileKernel=*/false, Recover, - CodeGenOpts.SanitizeAddressUseAfterScope)); + /*CompileKernel=*/false, Recover, UseAfterScope)); }); bool ModuleUseAfterScope = asanUseGlobalsGC(TargetTriple, CodeGenOpts); - PB.registerPipelineStartEPCallback([&](ModulePassManager &MPM) { - MPM.addPass(ModuleAddressSanitizerPass( - /*CompileKernel=*/false, Recover, ModuleUseAfterScope, - CodeGenOpts.SanitizeAddressUseOdrIndicator)); - }); + bool UseOdrIndicator = CodeGenOpts.SanitizeAddressUseOdrIndicator; + PB.registerPipelineStartEPCallback( + [Recover, ModuleUseAfterScope, + UseOdrIndicator](ModulePassManager &MPM) { + MPM.addPass(ModuleAddressSanitizerPass( + /*CompileKernel=*/false, Recover, ModuleUseAfterScope, + UseOdrIndicator)); + }); } if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts)) PB.registerPipelineStartEPCallback([Options](ModulePassManager &MPM) { |