summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/Environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/Environment.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/Environment.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Environment.cpp b/clang/lib/StaticAnalyzer/Core/Environment.cpp
index 0ca3f778f1b..551c89b04db 100644
--- a/clang/lib/StaticAnalyzer/Core/Environment.cpp
+++ b/clang/lib/StaticAnalyzer/Core/Environment.cpp
@@ -204,13 +204,13 @@ void Environment::printJson(raw_ostream &Out, const ASTContext &Ctx,
const LocationContext *LCtx, const char *NL,
unsigned int Space, bool IsDot) const {
Indent(Out, Space, IsDot) << "\"environment\": ";
- ++Space;
if (ExprBindings.isEmpty()) {
Out << "null," << NL;
return;
}
+ ++Space;
if (!LCtx) {
// Find the freshest location context.
llvm::SmallPtrSet<const LocationContext *, 16> FoundContexts;
@@ -227,7 +227,8 @@ void Environment::printJson(raw_ostream &Out, const ASTContext &Ctx,
assert(LCtx);
- Out << '[' << NL; // Start of Environment.
+ Out << "{ \"pointer\": \"" << (const void *)LCtx->getStackFrame()
+ << "\", \"items\": [" << NL;
PrintingPolicy PP = Ctx.getPrintingPolicy();
LCtx->printJson(Out, NL, Space, IsDot, [&](const LocationContext *LC) {
@@ -280,5 +281,5 @@ void Environment::printJson(raw_ostream &Out, const ASTContext &Ctx,
Out << "null ";
});
- Indent(Out, --Space, IsDot) << "]," << NL; // End of Environment.
+ Indent(Out, --Space, IsDot) << "]}," << NL;
}
OpenPOWER on IntegriCloud