]> granicus.if.org Git - clang/commitdiff
Remove dead code. We no longer need it because now we treat the first element
authorZhongxing Xu <xuzhongxing@gmail.com>
Sat, 21 Aug 2010 08:55:42 +0000 (08:55 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Sat, 21 Aug 2010 08:55:42 +0000 (08:55 +0000)
region and its base region as the same binding key.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111732 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/RegionStore.cpp

index d93d364eec379eb2981d8824adcb8a6dee56f80a..97344939d3d7b81cc9babf5ba7dac9cdb35186ad 100644 (file)
@@ -922,29 +922,6 @@ Optional<SVal> RegionStoreManager::getDefaultBinding(RegionBindings B,
   return Optional<SVal>();
 }
 
-static bool IsReinterpreted(QualType RTy, QualType UsedTy, ASTContext &Ctx) {
-  RTy = Ctx.getCanonicalType(RTy);
-  UsedTy = Ctx.getCanonicalType(UsedTy);
-
-  if (RTy == UsedTy)
-    return false;
-
-
-  // Recursively check the types.  We basically want to see if a pointer value
-  // is ever reinterpreted as a non-pointer, e.g. void** and intptr_t*
-  // represents a reinterpretation.
-  if (Loc::IsLocType(RTy) && Loc::IsLocType(UsedTy)) {
-    const PointerType *PRTy = RTy->getAs<PointerType>();
-    const PointerType *PUsedTy = UsedTy->getAs<PointerType>();
-
-    return PUsedTy && PRTy &&
-           IsReinterpreted(PRTy->getPointeeType(),
-                           PUsedTy->getPointeeType(), Ctx);
-  }
-
-  return true;
-}
-
 SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) {
   assert(!isa<UnknownVal>(L) && "location unknown");
   assert(!isa<UndefinedVal>(L) && "location undefined");
@@ -983,17 +960,6 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) {
   //
   // Such funny addressing will occur due to layering of regions.
 
-#if 0
-  ASTContext &Ctx = getContext();
-  if (!T.isNull() && IsReinterpreted(RTy, T, Ctx)) {
-    SVal ZeroIdx = ValMgr.makeZeroArrayIndex();
-    R = MRMgr.getElementRegion(T, ZeroIdx, R, Ctx);
-    RTy = T;
-    assert(Ctx.getCanonicalType(RTy) ==
-           Ctx.getCanonicalType(R->getValueType(Ctx)));
-  }
-#endif
-
   if (RTy->isStructureOrClassType())
     return RetrieveStruct(store, R);