[PATCH] D118016: [clang-tidy] Change code of SignalHandlerCheck (NFC).
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 24 11:10:52 PST 2022
aaron.ballman added a comment.
Thanks for the cleanup, I like the direction this is heading. But is this actually NFC? I thought using a `CallGraph` would change the behavior in code like:
if (false) { // Statically known never to take this branch
bad_call(); // Used to diagnose, does it still?
}
but I could be remembering incorrectly.
================
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
----------------
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?
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