[cfe-commits] r73926 - /cfe/trunk/lib/Analysis/MemRegion.cpp
Ted Kremenek
kremenek at apple.com
Mon Jun 22 17:04:09 PDT 2009
Author: kremenek
Date: Mon Jun 22 19:04:09 2009
New Revision: 73926
URL: http://llvm.org/viewvc/llvm-project?rev=73926&view=rev
Log:
MemRegionManager: Migrate getObjCObjectRegion() and getTypedViewRegion() to use
the new trait-based construction of MemRegion objects.
Modified:
cfe/trunk/lib/Analysis/MemRegion.cpp
Modified: cfe/trunk/lib/Analysis/MemRegion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/MemRegion.cpp?rev=73926&r1=73925&r2=73926&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/MemRegion.cpp (original)
+++ cfe/trunk/lib/Analysis/MemRegion.cpp Mon Jun 22 19:04:09 2009
@@ -325,40 +325,13 @@
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;
+ const MemRegion* superRegion) {
+ 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) {
More information about the cfe-commits
mailing list