diff options
author | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-05-29 18:17:18 +0000 |
---|---|---|
committer | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-05-29 18:17:18 +0000 |
commit | 9ee26c8d5f049f0f5fc99944a75e4900d4ae3110 (patch) | |
tree | 68704c4dc235dc3d494aa74c157507fb115c56d0 /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | |
parent | 03e1a82f52d219225c22f14ac73966bb97d4fd0d (diff) | |
download | bcm5719-llvm-9ee26c8d5f049f0f5fc99944a75e4900d4ae3110.tar.gz bcm5719-llvm-9ee26c8d5f049f0f5fc99944a75e4900d4ae3110.zip |
[analyzer][AST] print() JSONify: Stmt implementation
Summary:
This patch also adds a function called `JsonFormat()` which:
- Flattens the string so removes the new-lines.
- Escapes double quotes.
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/D62494
llvm-svn: 362000
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index e87b6535c1e..9a9b12dc600 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -170,17 +170,7 @@ public: Out << ", \"pretty\": "; if (S) { - llvm::SmallString<256> TempBuf; - llvm::raw_svector_ostream TempOut(TempBuf); - - // See whether the current statement is pretty-printable. - S->printPretty(TempOut, Helper, PP); - if (!TempBuf.empty()) { - Out << '\"' << TempBuf.str().trim() << '\"'; - TempBuf.clear(); - } else { - Out << "null"; - } + S->printJson(Out, Helper, PP, /*AddQuotes=*/true); } else { Out << '\"' << I->getAnyMember()->getNameAsString() << '\"'; } |