aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-11-10 13:05:26 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-11-10 13:05:26 +0000
commitcc128b32429494fe04ed36d7ba30c011cb4e173a (patch)
treec7efbe5629ab2c1aa561246eb793f720b517c613
parentfe81bc215e823e57b5a6dfb92fe0363c9bd07c46 (diff)
Add pretty printing to StringRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58985 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/MemRegion.h2
-rw-r--r--lib/Analysis/MemRegion.cpp4
2 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h
index 30e98bf730..04d904623e 100644
--- a/include/clang/Analysis/PathSensitive/MemRegion.h
+++ b/include/clang/Analysis/PathSensitive/MemRegion.h
@@ -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;
}
diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp
index 85ad3d87fa..f6bf4497ba 100644
--- a/lib/Analysis/MemRegion.cpp
+++ b/lib/Analysis/MemRegion.cpp
@@ -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.
//===----------------------------------------------------------------------===//