diff options
| author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-21 08:55:42 +0000 |
|---|---|---|
| committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-21 08:55:42 +0000 |
| commit | e70b6d17a4a31ac3a96710f15995fbc4ccd8a543 (patch) | |
| tree | c707ce02534388fcda88e530d1709422af03b9a4 | |
| parent | cdadf8d9b2c6fc84654235b42055701bc4d946e0 (diff) | |
| download | bcm5719-llvm-e70b6d17a4a31ac3a96710f15995fbc4ccd8a543.tar.gz bcm5719-llvm-e70b6d17a4a31ac3a96710f15995fbc4ccd8a543.zip | |
Remove dead code. We no longer need it because now we treat the first element
region and its base region as the same binding key.
llvm-svn: 111732
| -rw-r--r-- | clang/lib/Checker/RegionStore.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp index d93d364eec3..97344939d3d 100644 --- a/clang/lib/Checker/RegionStore.cpp +++ b/clang/lib/Checker/RegionStore.cpp @@ -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); |

