Added iterators to nonloc::CompoundSVal.
Added pretty-printing for nonloc::CompoundSVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58442 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/SVals.cpp b/lib/Analysis/SVals.cpp
index 1fb5875..bba0bde 100644
--- a/lib/Analysis/SVals.cpp
+++ b/lib/Analysis/SVals.cpp
@@ -55,6 +55,18 @@
}
//===----------------------------------------------------------------------===//
+// Other Iterators.
+//===----------------------------------------------------------------------===//
+
+nonloc::CompoundVal::iterator nonloc::CompoundVal::begin() const {
+ return getValue()->begin();
+}
+
+nonloc::CompoundVal::iterator nonloc::CompoundVal::end() const {
+ return getValue()->end();
+}
+
+//===----------------------------------------------------------------------===//
// Useful predicates.
//===----------------------------------------------------------------------===//
@@ -484,6 +496,15 @@
break;
}
+ case nonloc::CompoundValKind: {
+ const nonloc::CompoundVal& C = *cast<nonloc::CompoundVal>(this);
+ Out << " { ";
+ for (nonloc::CompoundVal::iterator I=C.begin(), E=C.end(); I!=E; ++I)
+ (*I).print(Out);
+ Out << " }";
+ break;
+ }
+
default:
assert (false && "Pretty-printed not implemented for this NonLoc.");
break;