MemRegionManager: Migrate getObjCObjectRegion() and getTypedViewRegion() to use

the new trait-based construction of MemRegion objects.

llvm-svn: 73926
This commit is contained in:
Ted Kremenek 2009-06-23 00:04:09 +00:00
parent bee30f58fb
commit 2266640a7a
1 changed files with 3 additions and 30 deletions

View File

@ -326,39 +326,12 @@ MemRegionManager::getObjCIvarRegion(const ObjCIvarDecl* d,
ObjCObjectRegion*
MemRegionManager::getObjCObjectRegion(const ObjCInterfaceDecl* d,
const MemRegion* superRegion) {
llvm::FoldingSetNodeID ID;
DeclRegion::ProfileRegion(ID, d, superRegion,
MemRegion::ObjCObjectRegionKind);
void* InsertPos;
MemRegion* data = Regions.FindNodeOrInsertPos(ID, InsertPos);
ObjCObjectRegion* R = cast_or_null<ObjCObjectRegion>(data);
if (!R) {
R = (ObjCObjectRegion*) A.Allocate<ObjCObjectRegion>();
new (R) ObjCObjectRegion(d, superRegion);
Regions.InsertNode(R, InsertPos);
}
return R;
return getRegion<ObjCObjectRegion>(d, superRegion);
}
TypedViewRegion*
MemRegionManager::getTypedViewRegion(QualType t, const MemRegion* superRegion) {
llvm::FoldingSetNodeID ID;
TypedViewRegion::ProfileRegion(ID, t, superRegion);
void* InsertPos;
MemRegion* data = Regions.FindNodeOrInsertPos(ID, InsertPos);
TypedViewRegion* R = cast_or_null<TypedViewRegion>(data);
if (!R) {
R = (TypedViewRegion*) A.Allocate<TypedViewRegion>();
new (R) TypedViewRegion(t, superRegion);
Regions.InsertNode(R, InsertPos);
}
return R;
return getRegion<TypedViewRegion>(t, superRegion);
}
AllocaRegion* MemRegionManager::getAllocaRegion(const Expr* E, unsigned cnt) {