[cfe-commits] r58074 - /cfe/trunk/lib/Analysis/RegionStore.cpp

Zhongxing Xu xuzhongxing at gmail.com
Thu Oct 23 23:01:33 PDT 2008


Author: zhongxingxu
Date: Fri Oct 24 01:01:33 2008
New Revision: 58074

URL: http://llvm.org/viewvc/llvm-project?rev=58074&view=rev
Log:
Add printing method to RegionStoreManager.

Modified:
    cfe/trunk/lib/Analysis/RegionStore.cpp

Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=58074&r1=58073&r2=58074&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Fri Oct 24 01:01:33 2008
@@ -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 @@
   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;
+  }
 }





More information about the cfe-commits mailing list