diff options
author | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-05-29 18:29:31 +0000 |
---|---|---|
committer | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-05-29 18:29:31 +0000 |
commit | dea605e0907804fd63365ac0273e8a39781fe25d (patch) | |
tree | 3953479f73d8b67fa6140063061113a83d7e4006 /clang/lib/Analysis/ProgramPoint.cpp | |
parent | 02be650617a5c8812e5c4696bcbbab284fe83acd (diff) | |
download | bcm5719-llvm-dea605e0907804fd63365ac0273e8a39781fe25d.tar.gz bcm5719-llvm-dea605e0907804fd63365ac0273e8a39781fe25d.zip |
[analyzer] print() JSONify: CFG implementation
Summary: -
Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus
Reviewed By: NoQ
Subscribers: cfe-commits, szepet, rnkovacs, a.sidorin, mikhail.ramalho,
donat.nagy, dkrupp
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62496
llvm-svn: 362003
Diffstat (limited to 'clang/lib/Analysis/ProgramPoint.cpp')
-rw-r--r-- | clang/lib/Analysis/ProgramPoint.cpp | 13 |
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\": \""; |