summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/ProgramPoint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis/ProgramPoint.cpp')
-rw-r--r--clang/lib/Analysis/ProgramPoint.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Analysis/ProgramPoint.cpp b/clang/lib/Analysis/ProgramPoint.cpp
index 32ae439c8ca..7e05706e487 100644
--- a/clang/lib/Analysis/ProgramPoint.cpp
+++ b/clang/lib/Analysis/ProgramPoint.cpp
@@ -149,13 +149,16 @@ void ProgramPoint::printJson(llvm::raw_ostream &Out, const char *NL) const {
const BlockEdge &E = castAs<BlockEdge>();
const Stmt *T = E.getSrc()->getTerminatorStmt();
Out << "Edge\", \"src_id\": " << E.getSrc()->getBlockID()
- << ", \"dst_id\": " << E.getDst()->getBlockID()
- << ", \"terminator\": " << (!T ? "null, \"term_kind\": null" : "\"");
- if (!T)
+ << ", \"dst_id\": " << E.getDst()->getBlockID() << ", \"terminator\": ";
+
+ if (!T) {
+ Out << "null, \"term_kind\": null";
break;
+ }
- E.getSrc()->printTerminator(Out, Context.getLangOpts());
- Out << "\", ";
+ E.getSrc()->printTerminatorJson(Out, Context.getLangOpts(),
+ /*AddQuotes=*/true);
+ Out << ", ";
printLocJson(Out, T->getBeginLoc(), SM);
Out << ", \"term_kind\": \"";
OpenPOWER on IntegriCloud