[PATCH] D53076: [analyzer] Enhance ConditionBRVisitor to write out more information

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 25 10:54:28 PDT 2018


Charusso added inline comments.


================
Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1853
+
+    const auto *Cond = cast<Expr>(PS->getStmt());
+    auto Piece = VisitTrueTest(Cond, tag == tags.first, BRC, BR, N);
----------------
george.karpenkov wrote:
> How do we know that it's always an `Expr`?
`VisitTrueTest` operates with `Expr` only, so I just left the type.


================
Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1970
 
+bool ConditionBRVisitor::insertOrUpdateConstraintMessage(const Stmt *Cond,
+                                                         StringRef Message) {
----------------
george.karpenkov wrote:
> 1. What about the refactoring I have previously suggested twice?
> 2. I know you have started with that -- and sorry for spurious changes -- but I also think your original name of `constraintsChanged` is better.
> We have multiple messages at the same place so we have to update the message. The problem with your code is insert operates with disjunct keys, not values.

I have commented this after the last refactor, sorry for the inconvenience.


https://reviews.llvm.org/D53076





More information about the cfe-commits mailing list