[cfe-commits] r58077 - in /cfe/trunk: include/clang/Analysis/PathSensitive/MemRegion.h lib/Analysis/MemRegion.cpp

Zhongxing Xu xuzhongxing at gmail.com
Thu Oct 23 23:30:08 PDT 2008


Author: zhongxingxu
Date: Fri Oct 24 01:30:07 2008
New Revision: 58077

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

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
    cfe/trunk/lib/Analysis/MemRegion.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h?rev=58077&r1=58076&r2=58077&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h Fri Oct 24 01:30:07 2008
@@ -54,9 +54,11 @@
   virtual void Profile(llvm::FoldingSetNodeID& ID) const = 0;
   
   std::string getString() const;
+
   virtual void print(llvm::raw_ostream& os) const;  
   
   Kind getKind() const { return kind; }  
+
   static bool classof(const MemRegion*) { return true; }
 };
   
@@ -275,6 +277,8 @@
 
   SVal getIndex() const { return Index; }
 
+  void print(llvm::raw_ostream& os) const;
+
   void Profile(llvm::FoldingSetNodeID& ID) const;
 
   static bool classof(const MemRegion* R) {

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

==============================================================================
--- cfe/trunk/lib/Analysis/MemRegion.cpp (original)
+++ cfe/trunk/lib/Analysis/MemRegion.cpp Fri Oct 24 01:30:07 2008
@@ -103,6 +103,11 @@
   os << "->" << getDecl()->getName();
 }
 
+void ElementRegion::print(llvm::raw_ostream& os) const {
+  superRegion->print(os);
+  os << '['; Index.print(os); os << ']';
+}
+
 //===----------------------------------------------------------------------===//
 // MemRegionManager methods.
 //===----------------------------------------------------------------------===//





More information about the cfe-commits mailing list