[cfe-commits] r58493 - /cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
Zhongxing Xu
xuzhongxing at gmail.com
Thu Oct 30 23:30:35 PDT 2008
Author: zhongxingxu
Date: Fri Oct 31 01:30:35 2008
New Revision: 58493
URL: http://llvm.org/viewvc/llvm-project?rev=58493&view=rev
Log:
Make CompoundLiteralRegion a subclass of TypedRegiion.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
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=58493&r1=58492&r2=58493&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h Fri Oct 31 01:30:35 2008
@@ -37,10 +37,9 @@
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 @@
/// 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;
More information about the cfe-commits
mailing list