[cfe-commits] r64646 - /cfe/trunk/lib/Analysis/RangeConstraintManager.cpp
Ted Kremenek
kremenek at apple.com
Mon Feb 16 10:42:57 PST 2009
Author: kremenek
Date: Mon Feb 16 12:42:56 2009
New Revision: 64646
URL: http://llvm.org/viewvc/llvm-project?rev=64646&view=rev
Log:
Add pretty-printing (for GraphViz) support for RangeConstraintManager.
Modified:
cfe/trunk/lib/Analysis/RangeConstraintManager.cpp
Modified: cfe/trunk/lib/Analysis/RangeConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RangeConstraintManager.cpp?rev=64646&r1=64645&r2=64646&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/RangeConstraintManager.cpp (original)
+++ cfe/trunk/lib/Analysis/RangeConstraintManager.cpp Mon Feb 16 12:42:56 2009
@@ -675,44 +675,16 @@
void RangeConstraintManager::print(const GRState* St, std::ostream& Out,
const char* nl, const char *sep) {
-#if 0
- // Print equality constraints.
-
- ConstEqTy CE = St->get<ConstEq>();
-
- if (!CE.isEmpty()) {
- Out << nl << sep << "'==' constraints:";
-
- for (ConstEqTy::iterator I = CE.begin(), E = CE.end(); I!=E; ++I) {
- Out << nl << " $" << I.getKey();
- llvm::raw_os_ostream OS(Out);
- OS << " : " << *I.getData();
- }
- }
-
- // Print != constraints.
- ConstNotEqTy CNE = St->get<ConstNotEq>();
+ ConstRangeTy Ranges = St->get<ConstRange>();
+
+ if (Ranges.isEmpty())
+ return;
- if (!CNE.isEmpty()) {
- Out << nl << sep << "'!=' constraints:";
+ Out << nl << sep << "ranges of symbol values:";
- for (ConstNotEqTy::iterator I = CNE.begin(), EI = CNE.end(); I!=EI; ++I) {
- Out << nl << " $" << I.getKey() << " : ";
- bool isFirst = true;
-
- GRState::IntSetTy::iterator J = I.getData().begin(),
- EJ = I.getData().end();
-
- for ( ; J != EJ; ++J) {
- if (isFirst) isFirst = false;
- else Out << ", ";
-
- Out << (*J)->getSExtValue(); // Hack: should print to raw_ostream.
- }
- }
+ for (ConstRangeTy::iterator I=Ranges.begin(), E=Ranges.end(); I!=E; ++I) {
+ Out << nl << " $" << I.getKey() << " : ";
+ I.getData().Print(Out);
}
-#endif // 0
-
- Out << nl << "Implement range printing";
}
More information about the cfe-commits
mailing list