aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-12-14 01:23:13 +0000
committerTed Kremenek <kremenek@apple.com>2012-12-14 01:23:13 +0000
commitb0abacf2f1f77214e4c77d6ec8a02b097bb98f7a (patch)
tree23b792c3d1d075008b0d55cef6f3ed2a7d12ccb9 /lib/StaticAnalyzer/Core/RegionStore.cpp
parent877efce7a8691d7083c8cae9271181ef8568f715 (diff)
Refactor dump methods to make RegionBindingsRef printable in the debugger.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170170 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/RegionStore.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp
index 77e9453ba8..32eb56ca73 100644
--- a/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -201,6 +201,21 @@ public:
Store asStore() const {
return asImmutableMap().getRootWithoutRetain();
}
+
+ void dump(llvm::raw_ostream &OS, const char *nl) const {
+ for (iterator I = begin(), E = end(); I != E; ++I) {
+ const ClusterBindings &Cluster = I.getData();
+ for (ClusterBindings::iterator CI = Cluster.begin(), CE = Cluster.end();
+ CI != CE; ++CI) {
+ OS << ' ' << CI.getKey() << " : " << CI.getData() << nl;
+ }
+ OS << nl;
+ }
+ }
+
+ LLVM_ATTRIBUTE_USED void dump() const {
+ dump(llvm::errs(), "\n");
+ }
};
} // end anonymous namespace
@@ -2037,13 +2052,5 @@ void RegionStoreManager::print(Store store, raw_ostream &OS,
OS << "Store (direct and default bindings), "
<< B.asStore()
<< " :" << nl;
-
- for (RegionBindingsRef::iterator I = B.begin(), E = B.end(); I != E; ++I) {
- const ClusterBindings &Cluster = I.getData();
- for (ClusterBindings::iterator CI = Cluster.begin(), CE = Cluster.end();
- CI != CE; ++CI) {
- OS << ' ' << CI.getKey() << " : " << CI.getData() << nl;
- }
- OS << nl;
- }
+ B.dump(OS, nl);
}