summaryrefslogtreecommitdiffstats
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
commit45bb8db372398315478a7e367d2c58864c4e5331 (patch)
tree40cb6fa829c33e855100dcbf9cddacee6757be40
parent06119a17ce10bd578b22327d93fc5891a3268764 (diff)
downloadbcm5719-llvm-45bb8db372398315478a7e367d2c58864c4e5331.tar.gz
bcm5719-llvm-45bb8db372398315478a7e367d2c58864c4e5331.zip
Refactor dump methods to make RegionBindingsRef printable in the debugger.
llvm-svn: 170170
-rw-r--r--clang/lib/StaticAnalyzer/Core/RegionStore.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 77e9453ba8d..32eb56ca735 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud