From fc042f95e2c93844fc1a48c75510139b4a626011 Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Sat, 15 Sep 2018 02:03:17 +0000 Subject: [analyzer] Dump reproducible identifiers for statements in exploded graph in store Differential Revision: https://reviews.llvm.org/D51826 llvm-svn: 342313 --- clang/lib/StaticAnalyzer/Core/Environment.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/Environment.cpp') 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; } }); -- cgit v1.2.3