Index: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h =================================================================== --- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h +++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h @@ -93,6 +93,7 @@ } void print(raw_ostream &Out, const char *NL, const char *Sep, + const ASTContext &Context, const LocationContext *WithLC = nullptr) const; }; Index: cfe/trunk/lib/StaticAnalyzer/Core/Environment.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/Environment.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/Environment.cpp @@ -202,7 +202,9 @@ } 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 @@ 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 @@ 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; } }); Index: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -3109,7 +3109,7 @@ assert(S != nullptr && "Expecting non-null Stmt"); Out << S->getStmtClassName() << ' ' - << S->getID(Context) << " (" << (const void *)S << ") "; + << S->getID(Context) << " <" << (const void *)S << "> "; S->printPretty(Out, /*helper=*/nullptr, Context.getPrintingPolicy(), /*Indentation=*/2, /*NewlineSymbol=*/"\\l"); printLocation(Out, S->getBeginLoc()); @@ -3171,9 +3171,9 @@ static_cast(State->getStateManager().getOwningEngine()) ->getGraph(); - Out << "StateID: " << State->getID() << " (" << (const void *)State.get() - << ")" - << " NodeID: " << N->getID(&Graph) << " (" << (const void *)N << ")\\|"; + Out << "StateID: " << State->getID() << " <" << (const void *)State.get() + << ">" + << " NodeID: " << N->getID(&Graph) << " <" << (const void *)N << ">\\|"; bool SameAsAllPredecessors = std::all_of(N->pred_begin(), N->pred_end(), [&](const ExplodedNode *P) { Index: cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp @@ -456,14 +456,16 @@ // State pretty-printing. //===----------------------------------------------------------------------===// -void ProgramState::print(raw_ostream &Out, const char *NL, const char *Sep, +void ProgramState::print(raw_ostream &Out, + const char *NL, const char *Sep, const LocationContext *LC) const { // Print the store. ProgramStateManager &Mgr = getStateManager(); + const ASTContext &Context = getStateManager().getContext(); Mgr.getStoreManager().print(getStore(), Out, NL, Sep); // Print out the environment. - Env.print(Out, NL, Sep, LC); + Env.print(Out, NL, Sep, Context, LC); // Print out the constraints. Mgr.getConstraintManager().print(this, Out, NL, Sep); @@ -478,7 +480,8 @@ Mgr.getOwningEngine()->printState(Out, this, NL, Sep, LC); } -void ProgramState::printDOT(raw_ostream &Out, const LocationContext *LC) const { +void ProgramState::printDOT(raw_ostream &Out, + const LocationContext *LC) const { print(Out, "\\l", "\\|", LC); }