Modified state pretty-printing to include the '!=' and '==' constraints on

symbols (for constant integers).

llvm-svn: 46795
This commit is contained in:
Ted Kremenek 2008-02-06 03:56:15 +00:00
parent 0ea8fea0ba
commit b2652827e6
1 changed files with 40 additions and 0 deletions

View File

@ -1001,6 +1001,43 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRConstants::NodeTy*> :
}
}
static void PrintEQ(std::ostream& Out, GRConstants::StateTy St) {
ValueState::ConstantEqTy CE = St.getImpl()->ConstantEq;
if (CE.isEmpty())
return;
Out << "\\l\\|'==' constraints:";
for (ValueState::ConstantEqTy::iterator I=CE.begin(), E=CE.end(); I!=E;++I)
Out << "\\l $" << I.getKey() << " : " << I.getData()->toString();
}
static void PrintNE(std::ostream& Out, GRConstants::StateTy St) {
ValueState::ConstantNotEqTy NE = St.getImpl()->ConstantNotEq;
if (NE.isEmpty())
return;
Out << "\\l\\|'!=' constraints:";
for (ValueState::ConstantNotEqTy::iterator I=NE.begin(), EI=NE.end();
I != EI; ++I){
Out << "\\l $" << I.getKey() << " : ";
bool isFirst = true;
ValueState::IntSetTy::iterator J=I.getData().begin(),
EJ=I.getData().end();
for ( ; J != EJ; ++J) {
if (isFirst) isFirst = false;
else Out << ", ";
Out << (*J)->toString();
}
}
}
static std::string getNodeLabel(const GRConstants::NodeTy* N, void*) {
std::ostringstream Out;
@ -1060,6 +1097,9 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRConstants::NodeTy*> :
PrintKind(Out, N->getState(), VarBindKey::IsDecl, true);
PrintKind(Out, N->getState(), VarBindKey::IsBlkExpr);
PrintKind(Out, N->getState(), VarBindKey::IsSubExpr);
PrintEQ(Out, N->getState());
PrintNE(Out, N->getState());
Out << "\\l";
return Out.str();