summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-07-06 23:37:21 +0000
committerTed Kremenek <kremenek@apple.com>2010-07-06 23:37:21 +0000
commit0fc6354f2f991addedd90e7c238d2aa6d75e7112 (patch)
treed7a6c34108ae4fd3d43005499cbfa0d62e958bd1
parent3ed511bc6b6beec47e5a6849968860f5fb4a1021 (diff)
downloadbcm5719-llvm-0fc6354f2f991addedd90e7c238d2aa6d75e7112.tar.gz
bcm5719-llvm-0fc6354f2f991addedd90e7c238d2aa6d75e7112.zip
Implement dumpToStream() for NonStaticGlobalSpaceRegion and StaticGlobalSpaceRegion.
llvm-svn: 107731
-rw-r--r--clang/include/clang/Checker/PathSensitive/MemRegion.h5
-rw-r--r--clang/lib/Checker/MemRegion.cpp9
2 files changed, 13 insertions, 1 deletions
diff --git a/clang/include/clang/Checker/PathSensitive/MemRegion.h b/clang/include/clang/Checker/PathSensitive/MemRegion.h
index 48a7ad2aab1..feb4b7218a7 100644
--- a/clang/include/clang/Checker/PathSensitive/MemRegion.h
+++ b/clang/include/clang/Checker/PathSensitive/MemRegion.h
@@ -172,6 +172,8 @@ class StaticGlobalSpaceRegion : public GlobalsSpaceRegion {
public:
void Profile(llvm::FoldingSetNodeID &ID) const;
+ void dumpToStream(llvm::raw_ostream& os) const;
+
const CodeTextRegion *getCodeRegion() const { return CR; }
static bool classof(const MemRegion *R) {
@@ -186,6 +188,9 @@ class NonStaticGlobalSpaceRegion : public GlobalsSpaceRegion {
: GlobalsSpaceRegion(mgr, NonStaticGlobalSpaceRegionKind) {}
public:
+
+ void dumpToStream(llvm::raw_ostream& os) const;
+
static bool classof(const MemRegion *R) {
return R->getKind() == NonStaticGlobalSpaceRegionKind;
}
diff --git a/clang/lib/Checker/MemRegion.cpp b/clang/lib/Checker/MemRegion.cpp
index b0e57fd251e..9cfeb7ae2b5 100644
--- a/clang/lib/Checker/MemRegion.cpp
+++ b/clang/lib/Checker/MemRegion.cpp
@@ -402,7 +402,6 @@ void BlockDataRegion::dumpToStream(llvm::raw_ostream& os) const {
os << "block_data{" << BC << '}';
}
-
void CompoundLiteralRegion::dumpToStream(llvm::raw_ostream& os) const {
// FIXME: More elaborate pretty-printing.
os << "{ " << (void*) CL << " }";
@@ -421,6 +420,10 @@ void FieldRegion::dumpToStream(llvm::raw_ostream& os) const {
os << superRegion << "->" << getDecl();
}
+void NonStaticGlobalSpaceRegion::dumpToStream(llvm::raw_ostream &os) const {
+ os << "NonStaticGlobalSpaceRegion";
+}
+
void ObjCIvarRegion::dumpToStream(llvm::raw_ostream& os) const {
os << "ivar{" << superRegion << ',' << getDecl() << '}';
}
@@ -445,6 +448,10 @@ void RegionRawOffset::dumpToStream(llvm::raw_ostream& os) const {
os << "raw_offset{" << getRegion() << ',' << getByteOffset() << '}';
}
+void StaticGlobalSpaceRegion::dumpToStream(llvm::raw_ostream &os) const {
+ os << "StaticGlobalsMemSpace{" << CR << '}';
+}
+
//===----------------------------------------------------------------------===//
// MemRegionManager methods.
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud