From 77cfac623178d0c16e16e2f171d20b0fea8fde30 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Fri, 31 Oct 2008 06:30:35 +0000 Subject: [PATCH] Make CompoundLiteralRegion a subclass of TypedRegiion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58493 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Analysis/PathSensitive/MemRegion.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h index c35cda36c6..49d5782351 100644 --- a/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/include/clang/Analysis/PathSensitive/MemRegion.h @@ -37,10 +37,9 @@ class MemRegionManager; class MemRegion : public llvm::FoldingSetNode { public: enum Kind { MemSpaceRegionKind, SymbolicRegionKind, - // Subregions. - CompoundLiteralRegionKind, // Typed regions. BEG_TYPED_REGIONS, + CompoundLiteralRegionKind, StringRegionKind, ElementRegionKind, // Decl Regions. BEG_DECL_REGIONS, @@ -221,18 +220,22 @@ class AnonHeapRegion : public AnonTypedRegion { /// CompoundLiteralRegion - A memory region representing a compound literal. /// Compound literals are essentially temporaries that are stack allocated /// or in the global constant pool. -class CompoundLiteralRegion : public SubRegion { +class CompoundLiteralRegion : public TypedRegion { private: friend class MemRegionManager; const CompoundLiteralExpr* CL; CompoundLiteralRegion(const CompoundLiteralExpr* cl, const MemRegion* sReg) - : SubRegion(sReg,CompoundLiteralRegionKind), CL(cl) {} + : TypedRegion(sReg, CompoundLiteralRegionKind), CL(cl) {} static void ProfileRegion(llvm::FoldingSetNodeID& ID, const CompoundLiteralExpr* CL, const MemRegion* superRegion); public: + QualType getType(ASTContext& C) const { + return C.getCanonicalType(CL->getType()); + } + void Profile(llvm::FoldingSetNodeID& ID) const; void print(llvm::raw_ostream& os) const; -- 2.50.1