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

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 22 19:00:43 PDT 2018


george.karpenkov requested changes to this revision.
george.karpenkov added inline comments.
This revision now requires changes to proceed.


================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h:202
+  void finalizeConstraints() {
+    Constraints.clear();
+  }
----------------
These constraints are conceptually part of the visitor, not part of the constraint manager. Could they be simply stored in the visitor?


================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:235
+  /// Check if the state has changed based on the constraint has changed.
+  bool isChanged(const Stmt *Cond, StringRef Message) const;
+
----------------
Probably should be replaced by the expression above and inlined.


================
Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:187
 
-void
-BugReporterVisitor::finalizeVisitor(BugReporterContext &,
-                                    const ExplodedNode *, BugReport &) {}
+void BugReporterVisitor::finalizeVisitor(BugReporterContext &,
+                                         const ExplodedNode *, BugReport &) {}
----------------
spurious change


================
Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1831
+      const Stmt *Cond = srcBlk->getTerminatorCondition();
+      auto piece = VisitTerminator(term, N, srcBlk, BE->getDst(), BR, BRC);
+      if (piece && State->isChanged(Cond, piece->getString()))
----------------
capital letter


https://reviews.llvm.org/D53076





More information about the cfe-commits mailing list