From ded1221db96976b392b3dca7b9f2209a923eb68e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 23 Jun 2009 00:04:09 +0000 Subject: [PATCH] MemRegionManager: Migrate getObjCObjectRegion() and getTypedViewRegion() to use the new trait-based construction of MemRegion objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73926 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/MemRegion.cpp | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index 2afd0b40ec..bd42858a4f 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Analysis/MemRegion.cpp @@ -325,40 +325,13 @@ 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(data); - - if (!R) { - R = (ObjCObjectRegion*) A.Allocate(); - new (R) ObjCObjectRegion(d, superRegion); - Regions.InsertNode(R, InsertPos); - } - - return R; + const MemRegion* superRegion) { + return getRegion(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(data); - - if (!R) { - R = (TypedViewRegion*) A.Allocate(); - new (R) TypedViewRegion(t, superRegion); - Regions.InsertNode(R, InsertPos); - } - - return R; + return getRegion(t, superRegion); } AllocaRegion* MemRegionManager::getAllocaRegion(const Expr* E, unsigned cnt) { -- 2.40.0