[PATCH] D52814: [PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address
Fedor Sergeev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 4 03:18:19 PDT 2018
fedor.sergeev added inline comments.
================
Comment at: lib/CodeGen/BackendUtil.cpp:1031-1038
+ MPM.addPass(AddressSanitizerModulePass());
+
+ // Add Function Pass
+ CGSCCPassManager MainCGPipeline(CodeGenOpts.DebugPassManager);
+ MainCGPipeline.addPass(createCGSCCToFunctionPassAdaptor(
+ buildAddressSanitizerPipeline(CodeGenOpts.DebugPassManager)));
+ MPM.addPass(
----------------
I dont believe CGSCC is appropriate here.
I would expect to see a simple ModuleToFunction adapter, something like this:
MPM.addPass(AddressSanitizerModulePass());
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerFunctionPass())
Also, it seems that legacy runs Function sanitizer first and then Module sanitizer after it.
This sequence does it backwards. Is it intentional?
Repository:
rC Clang
https://reviews.llvm.org/D52814
More information about the cfe-commits
mailing list