[PATCH] D112098: [ASan] Added stack safety support in address sanitizer.
Vitaly Buka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 21 23:17:19 PDT 2021
vitalybuka added inline comments.
================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:813
+ const StackSafetyGlobalInfo *SSI = nullptr;
+ if (ClUseStackSafety) {
+ SSI = &getAnalysis<StackSafetyGlobalInfoWrapperPass>().getResult();
----------------
usually we don't use {} for one liners.
But I'd prefer here:
const StackSafetyGlobalInfo *SSI = ClUseStackSafety ? get...: nullptr
================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1343
INITIALIZE_PASS_DEPENDENCY(ASanGlobalsMetadataWrapperPass)
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
INITIALIZE_PASS_END(
----------------
INITIALIZE_PASS_DEPENDENCY(StackSafetyGlobalInfoWrapperPass)
================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1265
GlobalsMetadata ASanGlobalsMetadataAnalysis::run(Module &M,
ModuleAnalysisManager &AM) {
return GlobalsMetadata(M);
----------------
vitalybuka wrote:
> You can make this module pass to calculate StackSafetyGlobalAnalysis and use cached one below.
> This way we will avoid exposure of this logic to PM
It should probably be in ModuleAddressSanitizerPass, so it wll return ::all() and we don't care about invalidation.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112098/new/
https://reviews.llvm.org/D112098
More information about the cfe-commits
mailing list