[PATCH] D118016: [clang-tidy] Change code of SignalHandlerCheck (NFC).
Balázs Kéri via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 25 03:45:10 PST 2022
balazske marked 2 inline comments as done.
balazske added a comment.
The `CallGraph` just scans for `FunctionDecl` and `CallExpr`, no check for unreachable code is there.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp:131
+ if (const auto *TU = Result.Nodes.getNodeAs<TranslationUnitDecl>("TU")) {
+ // Call graph must be populated with the entire TU at the begin.
+ // (It is possible to add a single function but the functions called from it
----------------
njames93 wrote:
> aaron.ballman wrote:
> > Should we also assert that this matcher is triggered before any other matcher is matched?
> >
> > Alternatively, instead of matching on the TU decl itself, would it make sense to walk the decl contexts up to the TU level on the first match?
> The nicest solution would be to change the OnStartOfTranslationUnit callback to pass the ASTContext. That way checks which require setup code like this don't need to register matchers.
> However this would be a breaking change.
Call graph is now populated at the first normal match, no need for the additional AST matcher.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118016/new/
https://reviews.llvm.org/D118016
More information about the cfe-commits
mailing list