[PATCH] D62883: [analyzer] Track terminator conditions on which a tracked expressions depends
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 21 14:40:49 PDT 2019
NoQ added a comment.
In D62883#1553248 <https://reviews.llvm.org/D62883#1553248>, @Szelethus wrote:
> - Add a `TODO:` in `trackExpressionValue` about maybe tracking conditions to all bug locations, rather than only for tracked variables.
What do you mean by "all bug locations"?
================
Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:355-357
+ bool addTrackedCondition(const ExplodedNode *Cond) {
+ return TrackedConditions.insert(Cond).second;
+ }
----------------
Pls add a comment that explains when does this function return true or false. I always forget what does insert().second do :)
================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1628
+ if (const Expr *Condition = NB->getTerminatorConditionExpr())
+ if (BR.addTrackedCondition(N))
+ bugreporter::trackExpressionValue(
----------------
Maybe let's add a comment that this is for inter-visitor communication only. Because otherwise we won't visit the same node twice in the same visitor.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62883/new/
https://reviews.llvm.org/D62883
More information about the cfe-commits
mailing list