summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/Environment.cpp
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-09-15 02:03:17 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-09-15 02:03:17 +0000
commitfc042f95e2c93844fc1a48c75510139b4a626011 (patch)
treeea90b3b9d31e143f05203a835b0c706438bb2ad0 /clang/lib/StaticAnalyzer/Core/Environment.cpp
parent141b448ee9a864c4735fb66dbc5a3f1ec4920ad5 (diff)
downloadbcm5719-llvm-fc042f95e2c93844fc1a48c75510139b4a626011.tar.gz
bcm5719-llvm-fc042f95e2c93844fc1a48c75510139b4a626011.zip
[analyzer] Dump reproducible identifiers for statements in exploded graph in store
Differential Revision: https://reviews.llvm.org/D51826 llvm-svn: 342313
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/Environment.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/Environment.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Environment.cpp b/clang/lib/StaticAnalyzer/Core/Environment.cpp
index eccaee292c4..5f1a37c8d6c 100644
--- a/clang/lib/StaticAnalyzer/Core/Environment.cpp
+++ b/clang/lib/StaticAnalyzer/Core/Environment.cpp
@@ -202,7 +202,9 @@ EnvironmentManager::removeDeadBindings(Environment Env,
}
void Environment::print(raw_ostream &Out, const char *NL,
- const char *Sep, const LocationContext *WithLC) const {
+ const char *Sep,
+ const ASTContext &Context,
+ const LocationContext *WithLC) const {
if (ExprBindings.isEmpty())
return;
@@ -222,8 +224,7 @@ void Environment::print(raw_ostream &Out, const char *NL,
assert(WithLC);
- LangOptions LO; // FIXME.
- PrintingPolicy PP(LO);
+ PrintingPolicy PP = Context.getPrintingPolicy();
Out << NL << NL << "Expressions by stack frame:" << NL;
WithLC->dumpStack(Out, "", NL, Sep, [&](const LocationContext *LC) {
@@ -234,8 +235,9 @@ void Environment::print(raw_ostream &Out, const char *NL,
const Stmt *S = I.first.getStmt();
assert(S != nullptr && "Expected non-null Stmt");
- Out << "(" << (const void *)LC << ',' << (const void *)S << ") ";
- S->printPretty(Out, nullptr, PP);
+ Out << "(LC" << (const void *)LC << ", S" << S->getID(Context) << " <"
+ << (const void *)S << "> ) ";
+ S->printPretty(Out, /*Helper=*/nullptr, PP);
Out << " : " << I.second << NL;
}
});
OpenPOWER on IntegriCloud