From 32d96b08dbfb6fbe88d74a9a85aad200ceae656a Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Thu, 6 Aug 2009 02:14:29 +0000 Subject: [PATCH] Completely remove the code using region cast. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78273 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/RegionStore.cpp | 59 ------------------------------------ 1 file changed, 59 deletions(-) diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index d556aed73a..b6604dcd8f 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -493,27 +493,6 @@ const GRState *RegionStoreManager::InvalidateRegion(const GRState *state, const TypedRegion *TR = cast(R); QualType T = TR->getValueType(Ctx); - // FIXME: The code causes a crash when using RegionStore on the test case - // 'test_invalidate_cast_int' (misc-ps.m). Consider removing it - // permanently. Region casts are probably not too strict to handle - // the transient interpretation of memory. Instead we can use the QualType - // passed to 'Retrieve' and friends to determine the most current - // interpretation of memory when it is actually used. -#if 0 - // If the region is cast to another type, use that type. - if (const QualType *CastTy = getCastType(state, R)) { - assert(!(*CastTy)->isObjCObjectPointerType()); - QualType NewT = (*CastTy)->getAs()->getPointeeType(); - - // The only exception is if the original region had a location type as its - // value type we always want to treat the region as binding to a location. - // This issue can arise when pointers are casted to integers and back. - - if (!(Loc::IsLocType(T) && !Loc::IsLocType(NewT))) - T = NewT; - } -#endif - if (const RecordType *RT = T->getAsStructureType()) { // FIXME: handle structs with default region value. const RecordDecl *RD = RT->getDecl()->getDefinition(Ctx); @@ -983,15 +962,6 @@ RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) { return SValuator::CastResult(state, UndefinedVal()); } -#if USE_REGION_CASTS - // If the region is already cast to another type, use that type to create the - // symbol value. - if (const QualType *p = state->get(R)) { - QualType T = *p; - RTy = T->getAs()->getPointeeType(); - } -#endif - // All other values are symbolic. return SValuator::CastResult(state, ValMgr.getRegionValueSymbolValOrUnknown(R, RTy)); @@ -1133,13 +1103,6 @@ SVal RegionStoreManager::RetrieveElement(const GRState* state, QualType Ty = R->getValueType(getContext()); -#if USE_REGION_CASTS - // If the region is already cast to another type, use that type to create the - // symbol value. - if (const QualType *p = state->get(R)) - Ty = (*p)->getAs()->getPointeeType(); -#endif - return ValMgr.getRegionValueSymbolValOrUnknown(R, Ty); } @@ -1210,15 +1173,6 @@ SVal RegionStoreManager::RetrieveField(const GRState* state, if (R->hasStackStorage() && !R->hasParametersStorage()) return UndefinedVal(); -#if USE_REGION_CASTS - // If the region is already cast to another type, use that type to create the - // symbol value. - if (const QualType *p = state->get(R)) { - QualType tmp = *p; - Ty = tmp->getAs()->getPointeeType(); - } -#endif - // All other values are symbolic. return ValMgr.getRegionValueSymbolValOrUnknown(R, Ty); } @@ -1272,19 +1226,6 @@ SVal RegionStoreManager::RetrieveLazySymbol(const GRState *state, QualType valTy = R->getValueType(getContext()); -#if USE_REGION_CASTS - // If the region is already cast to another type, use that type to create the - // symbol value. - if (const QualType *ty = state->get(R)) { - if (const PointerType *PT = (*ty)->getAs()) { - QualType castTy = PT->getPointeeType(); - - if (!IsReinterpreted(valTy, castTy, getContext())) - valTy = castTy; - } - } -#endif - // All other values are symbolic. return ValMgr.getRegionValueSymbolValOrUnknown(R, valTy); } -- 2.40.0