From: Ted Kremenek Date: Tue, 21 Apr 2009 19:56:58 +0000 (+0000) Subject: Recommit 69694 but this time also include the header changes (sorry for breaking X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72e032004b0d2c2c298e8e4f7027f23a21c0cc7d;p=clang Recommit 69694 but this time also include the header changes (sorry for breaking the build). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69702 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h index 3f287a0eb0..7397c92138 100644 --- a/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/include/clang/Analysis/PathSensitive/MemRegion.h @@ -223,7 +223,14 @@ public: return static_cast(Data); } - virtual bool isBoundable(ASTContext&) const { return false; } + SymbolRef getSymbol() const { + assert(codekind == Symbolic); + return const_cast(static_cast(Data)); + } + + bool isBoundable(ASTContext&) const { return false; } + + virtual void print(llvm::raw_ostream& os) const; void Profile(llvm::FoldingSetNodeID& ID) const; diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index 5e71924bf9..ad7e80d724 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/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 << " }";