From 1bf5adf0ee695b892e853c459612be61186b53b4 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Sat, 21 Aug 2010 08:55:42 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111732 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Checker/RegionStore.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp index d93d364eec..97344939d3 100644 --- a/lib/Checker/RegionStore.cpp +++ b/lib/Checker/RegionStore.cpp @@ -922,29 +922,6 @@ Optional RegionStoreManager::getDefaultBinding(RegionBindings B, return Optional(); } -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(); - const PointerType *PUsedTy = UsedTy->getAs(); - - return PUsedTy && PRTy && - IsReinterpreted(PRTy->getPointeeType(), - PUsedTy->getPointeeType(), Ctx); - } - - return true; -} - SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) { assert(!isa(L) && "location unknown"); assert(!isa(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); -- 2.40.0