Index: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -3076,9 +3076,7 @@ ProgramStateRef State = N->getState(); Out << "{ \"node_id\": " << N->getID(G) << ", \"pointer\": \"" - << (const void *)N << "\", \"state_id\": " << State->getID() - << ", \"has_report\": " << (nodeHasBugReport(N) ? "true" : "false") - << ",\\l"; + << (const void *)N << "\", \"state_id\": " << State->getID() << ",\\l"; Indent(Out, Space, IsDot) << "\"program_points\": [\\l"; @@ -3088,7 +3086,9 @@ [&](const ExplodedNode *OtherNode) { Indent(Out, Space + 1, IsDot) << "{ "; OtherNode->getLocation().printJson(Out, /*NL=*/"\\l"); - Out << ", \"tag\": "; + Out << ", \"has_report\": " + << (nodeHasBugReport(OtherNode) ? "true" : "false") + << ", \"tag\": "; if (const ProgramPointTag *Tag = OtherNode->getLocation().getTag()) Out << '\"' << Tag->getTagDescription() << "\" }"; else @@ -3112,11 +3112,7 @@ Indent(Out, Space, IsDot) << "\"program_state\": null"; } - Out << "\\l}"; - if (!N->succ_empty()) - Out << ','; - Out << "\\l"; - + Out << "\\l}\\l"; return Out.str(); } }; Index: clang/test/Analysis/dump_egraph.c =================================================================== --- clang/test/Analysis/dump_egraph.c +++ clang/test/Analysis/dump_egraph.c @@ -1,6 +1,6 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-dump-egraph=%t.dot %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core \ +// RUN: -analyzer-dump-egraph=%t.dot %s // RUN: cat %t.dot | FileCheck %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-dump-egraph=%t.dot -trim-egraph %s // REQUIRES: asserts int getJ(); @@ -12,7 +12,7 @@ // CHECK: digraph "Exploded Graph" { -// CHECK: \"program_points\": [\l    \{ \"kind\": \"Edge\", \"src_id\": 2, \"dst_id\": 1, \"terminator\": null, \"term_kind\": null, \"tag\": null \}\l  ],\l  \"program_state\": null +// CHECK: \"program_points\": [\l    \{ \"kind\": \"Edge\", \"src_id\": 2, \"dst_id\": 1, \"terminator\": null, \"term_kind\": null, \"has_report\": false, \"tag\": null \}\l  ],\l  \"program_state\": null // CHECK: \"program_points\": [\l    \{ \"kind\": \"BlockEntrance\", \"block_id\": 1