]> granicus.if.org Git - clang/commitdiff
Add printing method to RegionStoreManager.
authorZhongxing Xu <xuzhongxing@gmail.com>
Fri, 24 Oct 2008 06:01:33 +0000 (06:01 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Fri, 24 Oct 2008 06:01:33 +0000 (06:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58074 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index d0798db2c49159627a48d9c65eb347da40b137c0..417521a14ec5e55e8dae4bb978c47d4498552153 100644 (file)
@@ -19,6 +19,7 @@
 #include "clang/Analysis/Analyses/LiveVariables.h"
 
 #include "llvm/ADT/ImmutableMap.h"
+#include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Compiler.h"
 
 using namespace clang;
@@ -344,7 +345,14 @@ Store RegionStoreManager::AddDecl(Store store,
   return store;
 }
 
-void RegionStoreManager::print(Store store, std::ostream& Out, const char* nl, 
-                               const char *sep) {
-  
+void RegionStoreManager::print(Store store, std::ostream& Out, 
+                               const char* nl, const char *sep) {
+  llvm::raw_os_ostream OS(Out);
+  RegionBindingsTy B = GetRegionBindings(store);
+  OS << "Store:" << nl;
+
+  for (RegionBindingsTy::iterator I = B.begin(), E = B.end(); I != E; ++I) {
+    OS << ' '; I.getKey()->print(OS); OS << " : ";
+    I.getData().print(OS); OS << nl;
+  }
 }