[cfe-commits] r66418 - /cfe/trunk/lib/Analysis/RegionStore.cpp

Zhongxing Xu xuzhongxing at gmail.com
Mon Mar 9 02:16:04 PDT 2009


Author: zhongxingxu
Date: Mon Mar  9 04:15:51 2009
New Revision: 66418

URL: http://llvm.org/viewvc/llvm-project?rev=66418&view=rev
Log:
Now we do not retrieve untyped regions.

Modified:
    cfe/trunk/lib/Analysis/RegionStore.cpp

Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=66418&r1=66417&r2=66418&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Mon Mar  9 04:15:51 2009
@@ -665,7 +665,8 @@
 
   // FIXME: Perhaps this method should just take a 'const MemRegion*' argument
   //  instead of 'Loc', and have the other Loc cases handled at a higher level.
-  const MemRegion* R = cast<loc::MemRegionVal>(L).getRegion();
+  const TypedRegion* R 
+    = cast<TypedRegion>(cast<loc::MemRegionVal>(L).getRegion());
   assert(R && "bad region");
 
   // FIXME: We should eventually handle funny addressing.  e.g.:
@@ -677,14 +678,12 @@
   //
   // Such funny addressing will occur due to layering of regions.
 
-  if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) {
-    QualType T =TR->getRValueType(getContext());
-    if (T->isStructureType())
-      return RetrieveStruct(St, TR);
-    // FIXME: handle Vector types.
-    if (T->isVectorType())
+  QualType RTy = R->getRValueType(getContext());
+  if (RTy->isStructureType())
+    return RetrieveStruct(St, R);
+  // FIXME: handle Vector types.
+  if (RTy->isVectorType())
       return UnknownVal();
-  }
   
   RegionBindingsTy B = GetRegionBindings(St->getStore());
   RegionBindingsTy::data_type* V = B.lookup(R);





More information about the cfe-commits mailing list