[cfe-commits] r57724 - in /cfe/trunk: include/clang/Analysis/PathSensitive/MemRegion.h lib/Analysis/MemRegion.cpp
Ted Kremenek
kremenek at apple.com
Fri Oct 17 14:05:44 PDT 2008
Author: kremenek
Date: Fri Oct 17 16:05:44 2008
New Revision: 57724
URL: http://llvm.org/viewvc/llvm-project?rev=57724&view=rev
Log:
Add pretty-printing support for FieldRegions.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
cfe/trunk/lib/Analysis/MemRegion.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h?rev=57724&r1=57723&r2=57724&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h Fri Oct 17 16:05:44 2008
@@ -220,14 +220,17 @@
FieldRegion(const FieldDecl* fd, const MemRegion* sReg)
: DeclRegion(fd, sReg, FieldRegionKind) {}
+public:
+
+ void print(llvm::raw_ostream& os) const;
+
+ const FieldDecl* getDecl() const { return cast<FieldDecl>(D); }
+ QualType getType() const { return getDecl()->getType(); }
+
static void ProfileRegion(llvm::FoldingSetNodeID& ID, FieldDecl* FD,
const MemRegion* superRegion) {
DeclRegion::ProfileRegion(ID, FD, superRegion, FieldRegionKind);
}
-
-public:
- const FieldDecl* getDecl() const { return cast<FieldDecl>(D); }
- QualType getType() const { return getDecl()->getType(); }
static bool classof(const MemRegion* R) {
return R->getKind() == FieldRegionKind;
Modified: cfe/trunk/lib/Analysis/MemRegion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/MemRegion.cpp?rev=57724&r1=57723&r2=57724&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/MemRegion.cpp (original)
+++ cfe/trunk/lib/Analysis/MemRegion.cpp Fri Oct 17 16:05:44 2008
@@ -88,6 +88,11 @@
os << "$" << sym.getNumber();
}
+void FieldRegion::print(llvm::raw_ostream& os) const {
+ superRegion->print(os);
+ os << "->" << getDecl()->getName();
+}
+
//===----------------------------------------------------------------------===//
// MemRegionManager methods.
//===----------------------------------------------------------------------===//
More information about the cfe-commits
mailing list