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-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4d256f38ddb7c0b05390857c3ca912988e8e629;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342308 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 638fc5de10..a1fcd12131 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/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(); } };