From: George Karpenkov Date: Sat, 15 Sep 2018 02:01:26 +0000 (+0000) Subject: [analyzer] Skip printing duplicate nodes, even if nodes have multiple predecessors... X-Git-Tag: llvmorg-8.0.0-rc1~8638 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40cbde9ce28af51a8a1124d3a6f6b1477a6efce8;p=platform%2Fupstream%2Fllvm.git [analyzer] Skip printing duplicate nodes, even if nodes have multiple predecessors/successors Still generate a node, but leave the redundant field empty. Differential Revision: https://reviews.llvm.org/D51821 llvm-svn: 342308 --- diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 638fc5d..a1fcd12 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -3177,7 +3177,12 @@ struct DOTGraphTraits : public DefaultDOTGraphTraits { << ")" << " 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(); } };