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

include/clang/Analysis/PathSensitive/MemRegion.h
lib/Analysis/MemRegion.cpp

index ff419a8e06b89caa507e944995587f68308dad32..a78059dfedb63748fa07404c2d346a20b3cdb840 100644 (file)
@@ -54,9 +54,11 @@ public:
   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 @@ public:
 
   SVal getIndex() const { return Index; }
 
+  void print(llvm::raw_ostream& os) const;
+
   void Profile(llvm::FoldingSetNodeID& ID) const;
 
   static bool classof(const MemRegion* R) {
index cae053f595829caf3cf446a346396ca1a5871c4a..9c76e452e886947851cbe2f1c9c15f82e5617f45 100644 (file)
@@ -103,6 +103,11 @@ void FieldRegion::print(llvm::raw_ostream& os) const {
   os << "->" << getDecl()->getName();
 }
 
+void ElementRegion::print(llvm::raw_ostream& os) const {
+  superRegion->print(os);
+  os << '['; Index.print(os); os << ']';
+}
+
 //===----------------------------------------------------------------------===//
 // MemRegionManager methods.
 //===----------------------------------------------------------------------===//