summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Core/Environment.cpp12
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngine.cpp8
-rw-r--r--clang/lib/StaticAnalyzer/Core/ProgramState.cpp9
3 files changed, 17 insertions, 12 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;
}
});
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
index b8ec06e9b98..a0cb43284df 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -3109,7 +3109,7 @@ struct DOTGraphTraits<ExplodedNode*> : public DefaultDOTGraphTraits {
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 @@ struct DOTGraphTraits<ExplodedNode*> : public DefaultDOTGraphTraits {
static_cast<ExprEngine *>(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) {
diff --git a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
index 361255b4b18..01c1c8c6187 100644
--- a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
@@ -456,14 +456,16 @@ void ProgramState::setStore(const StoreRef &newStore) {
// 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 @@ void ProgramState::print(raw_ostream &Out, const char *NL, const char *Sep,
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);
}
OpenPOWER on IntegriCloud