aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Analysis/PathSensitive/MemRegion.h4
-rw-r--r--lib/Analysis/MemRegion.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h
index ff419a8e06..a78059dfed 100644
--- a/include/clang/Analysis/PathSensitive/MemRegion.h
+++ b/include/clang/Analysis/PathSensitive/MemRegion.h
@@ -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) {
diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp
index cae053f595..9c76e452e8 100644
--- a/lib/Analysis/MemRegion.cpp
+++ b/lib/Analysis/MemRegion.cpp
@@ -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.
//===----------------------------------------------------------------------===//