summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
diff options
context:
space:
mode:
authorCsaba Dabis <dabis.csaba98@gmail.com>2019-05-29 18:17:18 +0000
committerCsaba Dabis <dabis.csaba98@gmail.com>2019-05-29 18:17:18 +0000
commit9ee26c8d5f049f0f5fc99944a75e4900d4ae3110 (patch)
tree68704c4dc235dc3d494aa74c157507fb115c56d0 /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
parent03e1a82f52d219225c22f14ac73966bb97d4fd0d (diff)
downloadbcm5719-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.cpp12
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() << '\"';
}
OpenPOWER on IntegriCloud