]> granicus.if.org Git - clang/commitdiff
Add pretty printing to StringRegion.
authorZhongxing Xu <xuzhongxing@gmail.com>
Mon, 10 Nov 2008 13:05:26 +0000 (13:05 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Mon, 10 Nov 2008 13:05:26 +0000 (13:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58985 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 30e98bf730e880255808eb77581281c415b4c592..04d904623e2b0d9cb261ffb295041c6282cb5f3f 100644 (file)
@@ -194,6 +194,8 @@ public:
     ProfileRegion(ID, Str, superRegion);
   }
 
+  void print(llvm::raw_ostream& os) const;
+
   static bool classof(const MemRegion* R) {
     return R->getKind() == StringRegionKind;
   }
index 85ad3d87fa086e4a56c4a18e1996292bb36a9fc5..f6bf4497ba664576dc3df85a21fec869488bb1c1 100644 (file)
@@ -151,6 +151,10 @@ void CompoundLiteralRegion::print(llvm::raw_ostream& os) const {
   os << "{ " << (void*) CL <<  " }";
 }
 
+void StringRegion::print(llvm::raw_ostream& os) const {
+  os << "\"" << Str->getStrData() << "\"";
+}
+
 //===----------------------------------------------------------------------===//
 // MemRegionManager methods.
 //===----------------------------------------------------------------------===//