[PATCH] D118016: [clang-tidy] Change code of SignalHandlerCheck (NFC).
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 24 12:55:12 PST 2022
njames93 added inline comments.
================
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
----------------
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.
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