From: Ted Kremenek Date: Wed, 17 Dec 2008 19:25:50 +0000 (+0000) Subject: Add pretty-printing for AnonTypedRegion. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=500d2ee83d407106d80920fb4325fa2e06fa61a5;p=clang Add pretty-printing for AnonTypedRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61146 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h index 839b427c05..efe0b9a19c 100644 --- a/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/include/clang/Analysis/PathSensitive/MemRegion.h @@ -221,6 +221,8 @@ class AnonTypedRegion : public TypedRegion { public: + void print(llvm::raw_ostream& os) const; + QualType getRValueType(ASTContext&) const { return T; } diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index 898aff031f..eafeee66d5 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Analysis/MemRegion.cpp @@ -135,6 +135,12 @@ void AllocaRegion::print(llvm::raw_ostream& os) const { os << "alloca{" << (void*) Ex << ',' << Cnt << '}'; } +void AnonTypedRegion::print(llvm::raw_ostream& os) const { + os << "anon_type{" << T.getAsString() << ','; + getSuperRegion()->print(os); + os << '}'; +} + void VarRegion::print(llvm::raw_ostream& os) const { os << cast(D)->getNameAsString(); }