[PATCH] D51821: [analyzer] Skip printing duplicate nodes, even if nodes have multiple predecessors/successors

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 14 19:02:53 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC342308: [analyzer] Skip printing duplicate nodes, even if nodes have multiple… (authored by george.karpenkov, committed by ).
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D51821?vs=165619&id=165624#toc

Repository:
  rC Clang

https://reviews.llvm.org/D51821

Files:
  lib/StaticAnalyzer/Core/ExprEngine.cpp


Index: lib/StaticAnalyzer/Core/ExprEngine.cpp
===================================================================
--- lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -3177,7 +3177,12 @@
         << ")"
         << " NodeID: " << N->getID(&Graph) << " (" << (const void *)N << ")\\|";
 
-    State->printDOT(Out, N->getLocationContext());
+    bool SameAsAllPredecessors =
+        std::all_of(N->pred_begin(), N->pred_end(), [&](const ExplodedNode *P) {
+          return P->getState() == State;
+        });
+    if (!SameAsAllPredecessors)
+      State->printDOT(Out, N->getLocationContext());
     return Out.str();
   }
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51821.165624.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180915/683588be/attachment.bin>


More information about the cfe-commits mailing list