summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-04-21 19:56:58 +0000
committerTed Kremenek <kremenek@apple.com>2009-04-21 19:56:58 +0000
commit9bb660c3f49d1747c1958d0b1be1896b091b7f9e (patch)
tree8550716fb55541130bebf68afb62db9531fc4db9
parent37920f53599e558d7d241402f9391f0a51d5d0e3 (diff)
downloadbcm5719-llvm-9bb660c3f49d1747c1958d0b1be1896b091b7f9e.tar.gz
bcm5719-llvm-9bb660c3f49d1747c1958d0b1be1896b091b7f9e.zip
Recommit 69694 but this time also include the header changes (sorry for breaking
the build). llvm-svn: 69702
-rw-r--r--clang/include/clang/Analysis/PathSensitive/MemRegion.h9
-rw-r--r--clang/lib/Analysis/MemRegion.cpp10
2 files changed, 18 insertions, 1 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/MemRegion.h b/clang/include/clang/Analysis/PathSensitive/MemRegion.h
index 3f287a0eb05..7397c921380 100644
--- a/clang/include/clang/Analysis/PathSensitive/MemRegion.h
+++ b/clang/include/clang/Analysis/PathSensitive/MemRegion.h
@@ -223,7 +223,14 @@ public:
return static_cast<const FunctionDecl*>(Data);
}
- virtual bool isBoundable(ASTContext&) const { return false; }
+ SymbolRef getSymbol() const {
+ assert(codekind == Symbolic);
+ return const_cast<SymbolRef>(static_cast<const SymbolRef>(Data));
+ }
+
+ bool isBoundable(ASTContext&) const { return false; }
+
+ virtual void print(llvm::raw_ostream& os) const;
void Profile(llvm::FoldingSetNodeID& ID) const;
diff --git a/clang/lib/Analysis/MemRegion.cpp b/clang/lib/Analysis/MemRegion.cpp
index 5e71924bf9c..ad7e80d7249 100644
--- a/clang/lib/Analysis/MemRegion.cpp
+++ b/clang/lib/Analysis/MemRegion.cpp
@@ -157,6 +157,16 @@ void AllocaRegion::print(llvm::raw_ostream& os) const {
os << "alloca{" << (void*) Ex << ',' << Cnt << '}';
}
+void CodeTextRegion::print(llvm::raw_ostream& os) const {
+ os << "code{";
+ if (isDeclared())
+ os << getDecl()->getDeclName();
+ else
+ os << '$' << getSymbol();
+
+ os << '}';
+}
+
void CompoundLiteralRegion::print(llvm::raw_ostream& os) const {
// FIXME: More elaborate pretty-printing.
os << "{ " << (void*) CL << " }";
OpenPOWER on IntegriCloud