]> granicus.if.org Git - clang/commitdiff
Remove the case for casting to compatible type in
authorZhongxing Xu <xuzhongxing@gmail.com>
Sat, 9 May 2009 10:03:08 +0000 (10:03 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Sat, 9 May 2009 10:03:08 +0000 (10:03 +0000)
RegionStoreManager::CastRegion(). This case should be subsumed by others.

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

lib/Analysis/RegionStore.cpp

index a23a47ecc8852dea14c241885000c63eea5357a9..4528ffbd2d73e59aca717460364f36fd1a051fcd 100644 (file)
@@ -637,18 +637,10 @@ RegionStoreManager::CastRegion(const GRState* state, const MemRegion* R,
     return CastResult(state, R);
   }
 
-  // Assume we are casting from pointer to pointer. Other cases are handled
-  // elsewhere.
+  // Now assume we are casting from pointer to pointer. Other cases should
+  // already be handled.
   QualType PointeeTy = cast<PointerType>(ToTy.getTypePtr())->getPointeeType();
 
-  // Return the same region if the region types are compatible.
-  if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) {
-    QualType Ta = Ctx.getCanonicalType(TR->getLocationType(Ctx));
-
-    if (Ta == ToTy)
-      return CastResult(state, R);
-  }
-
   // Process region cast according to the kind of the region being cast.