From: Ted Kremenek Date: Sun, 1 Mar 2009 05:44:08 +0000 (+0000) Subject: Rename AnonTypedRegion to TypedViewRegion. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0312c0e09c9de480d78607972ac64a88f4e94a33;p=clang Rename AnonTypedRegion to TypedViewRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65764 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h index ba08e38387..cd7011e53a 100644 --- a/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/include/clang/Analysis/PathSensitive/MemRegion.h @@ -45,7 +45,7 @@ public: SymbolicRegionKind, CompoundLiteralRegionKind, StringRegionKind, ElementRegionKind, - AnonTypedRegionKind, + TypedViewRegionKind, AnonPointeeRegionKind, // Decl Regions. BEG_DECL_REGIONS, @@ -224,13 +224,13 @@ public: } }; -class AnonTypedRegion : public TypedRegion { +class TypedViewRegion : public TypedRegion { friend class MemRegionManager; QualType T; - AnonTypedRegion(QualType t, const MemRegion* sreg) - : TypedRegion(sreg, AnonTypedRegionKind), T(t) {} + TypedViewRegion(QualType t, const MemRegion* sreg) + : TypedRegion(sreg, TypedViewRegionKind), T(t) {} static void ProfileRegion(llvm::FoldingSetNodeID& ID, QualType T, const MemRegion* superRegion); @@ -248,7 +248,7 @@ public: } static bool classof(const MemRegion* R) { - return R->getKind() == AnonTypedRegionKind; + return R->getKind() == TypedViewRegionKind; } }; @@ -527,7 +527,7 @@ public: ObjCIvarRegion* getObjCIvarRegion(const ObjCIvarDecl* ivd, const MemRegion* superRegion); - AnonTypedRegion* getAnonTypedRegion(QualType t, const MemRegion* superRegion); + TypedViewRegion* getTypedViewRegion(QualType t, const MemRegion* superRegion); bool hasStackStorage(const MemRegion* R); diff --git a/lib/Analysis/BasicObjCFoundationChecks.cpp b/lib/Analysis/BasicObjCFoundationChecks.cpp index 8a5c3e0a84..88f480e68c 100644 --- a/lib/Analysis/BasicObjCFoundationChecks.cpp +++ b/lib/Analysis/BasicObjCFoundationChecks.cpp @@ -412,7 +412,7 @@ bool AuditCFNumberCreate::Audit(ExplodedNode* N,GRStateManager&){ const TypedRegion* R = dyn_cast(LV->getRegion()); if (!R) return false; - while (const AnonTypedRegion* ATR = dyn_cast(R)) { + while (const TypedViewRegion* ATR = dyn_cast(R)) { R = dyn_cast(ATR->getSuperRegion()); if (!R) return false; } diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp index ad542b884a..85d96c4780 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -159,7 +159,7 @@ BasicStoreManager::CastRegion(const GRState* state, const MemRegion* R, return CastResult(state, R); } - return CastResult(state, MRMgr.getAnonTypedRegion(CastToTy, R)); + return CastResult(state, MRMgr.getTypedViewRegion(CastToTy, R)); } SVal BasicStoreManager::getLValueField(const GRState* St, SVal Base, @@ -223,7 +223,7 @@ SVal BasicStoreManager::getLValueElement(const GRState* St, SVal Base, StateMgr.getSymbolManager()); // Layered a typed region on top of this. QualType T = StateMgr.getSymbolManager().getType(Sym); - BaseR = MRMgr.getAnonTypedRegion(T, SymR); + BaseR = MRMgr.getTypedViewRegion(T, SymR); break; } diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index d42a936834..59669976b1 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -1643,9 +1643,9 @@ void CFRefCount::EvalSummary(ExplodedNodeSet& Dst, const TypedRegion* R = dyn_cast(MR->getRegion()); - // Blast through AnonTypedRegions to get the original region type. + // Blast through TypedViewRegions to get the original region type. while (R) { - const AnonTypedRegion* ATR = dyn_cast(R); + const TypedViewRegion* ATR = dyn_cast(R); if (!ATR) break; R = dyn_cast(ATR->getSuperRegion()); } diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index 779f651edb..b2d7ad2d89 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Analysis/MemRegion.cpp @@ -57,9 +57,9 @@ void AllocaRegion::Profile(llvm::FoldingSetNodeID& ID) const { ProfileRegion(ID, Ex, Cnt); } -void AnonTypedRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, QualType T, +void TypedViewRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, QualType T, const MemRegion* superRegion) { - ID.AddInteger((unsigned) AnonTypedRegionKind); + ID.AddInteger((unsigned) TypedViewRegionKind); ID.Add(T); ID.AddPointer(superRegion); } @@ -160,7 +160,7 @@ void AllocaRegion::print(llvm::raw_ostream& os) const { os << "alloca{" << (void*) Ex << ',' << Cnt << '}'; } -void AnonTypedRegion::print(llvm::raw_ostream& os) const { +void TypedViewRegion::print(llvm::raw_ostream& os) const { os << "anon_type{" << T.getAsString() << ','; getSuperRegion()->print(os); os << '}'; @@ -399,18 +399,18 @@ MemRegionManager::getObjCObjectRegion(const ObjCInterfaceDecl* d, return R; } -AnonTypedRegion* -MemRegionManager::getAnonTypedRegion(QualType t, const MemRegion* superRegion) { +TypedViewRegion* +MemRegionManager::getTypedViewRegion(QualType t, const MemRegion* superRegion) { llvm::FoldingSetNodeID ID; - AnonTypedRegion::ProfileRegion(ID, t, superRegion); + TypedViewRegion::ProfileRegion(ID, t, superRegion); void* InsertPos; MemRegion* data = Regions.FindNodeOrInsertPos(ID, InsertPos); - AnonTypedRegion* R = cast_or_null(data); + TypedViewRegion* R = cast_or_null(data); if (!R) { - R = (AnonTypedRegion*) A.Allocate(); - new (R) AnonTypedRegion(t, superRegion); + R = (TypedViewRegion*) A.Allocate(); + new (R) TypedViewRegion(t, superRegion); Regions.InsertNode(R, InsertPos); } diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index c61094c20c..e6e530bc0f 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -365,7 +365,7 @@ SVal RegionStoreManager::getLValueElement(const GRState* St, // char *p = __builtin_alloc(10); // p[1] = 8; // - // Observe that 'p' binds to an AnonTypedRegion. + // Observe that 'p' binds to an TypedViewRegion. // // Offset might be unsigned. We have to convert it to signed ConcreteInt. @@ -442,7 +442,7 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St, return NonLoc::MakeIntVal(getBasicVals(), Str->getByteLength()+1, false); } - if (const AnonTypedRegion* ATR = dyn_cast(R)) { + if (const TypedViewRegion* ATR = dyn_cast(R)) { #if 0 // FIXME: This logic doesn't really work, as we can have all sorts of // weird cases. For example, this crashes on test case 'rdar-6442306-1.m'. @@ -547,7 +547,7 @@ RegionStoreManager::CastRegion(const GRState* state, const MemRegion* R, // char* y = (char*) x; // void* z = (void*) y; // <-- we should get the same region that is // bound to 'x' - const MemRegion* ViewR = MRMgr.getAnonTypedRegion(CastToTy, R); + const MemRegion* ViewR = MRMgr.getTypedViewRegion(CastToTy, R); return CastResult(AddRegionView(state, ViewR, R), ViewR); }