diff options
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/BasicObjCFoundationChecks.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/BasicStore.cpp | 6 | ||||
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/MemRegion.cpp | 8 | ||||
-rw-r--r-- | lib/Analysis/RegionStore.cpp | 35 | ||||
-rw-r--r-- | lib/Analysis/SVals.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/Store.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/SymbolManager.cpp | 2 |
9 files changed, 24 insertions, 37 deletions
diff --git a/lib/Analysis/BasicObjCFoundationChecks.cpp b/lib/Analysis/BasicObjCFoundationChecks.cpp index 0eee9374da..112a3a1d66 100644 --- a/lib/Analysis/BasicObjCFoundationChecks.cpp +++ b/lib/Analysis/BasicObjCFoundationChecks.cpp @@ -417,7 +417,7 @@ bool AuditCFNumberCreate::Audit(ExplodedNode<GRState>* N,GRStateManager&){ if (!R) return false; } - QualType T = Ctx.getCanonicalType(R->getRValueType(Ctx)); + QualType T = Ctx.getCanonicalType(R->getObjectType(Ctx)); // FIXME: If the pointee isn't an integer type, should we flag a warning? // People can do weird stuff with pointers. diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp index 598191f578..e4e0cfa983 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -290,7 +290,7 @@ SVal BasicStoreManager::Retrieve(const GRState* state, Loc loc, QualType T) { // Just support void**, void***, intptr_t*, intptr_t**, etc., for now. // This is needed to handle OSCompareAndSwapPtr() and friends. ASTContext &Ctx = StateMgr.getContext(); - QualType T = ER->getLValueType(Ctx); + QualType T = ER->getLocationType(Ctx); if (!isHigherOrderRawPtr(T, Ctx)) return UnknownVal(); @@ -334,7 +334,7 @@ Store BasicStoreManager::BindInternal(Store store, Loc loc, SVal V) { if (isa<Loc>(V) || isa<nonloc::LocAsInteger>(V)) if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) { // FIXME: Should check for index 0. - QualType T = ER->getLValueType(C); + QualType T = ER->getLocationType(C); if (isHigherOrderRawPtr(T, C)) R = ER->getSuperRegion(); @@ -357,7 +357,7 @@ Store BasicStoreManager::BindInternal(Store store, Loc loc, SVal V) { // elsewhere. Food for thought. if (const TypedRegion *TyR = dyn_cast<TypedRegion>(R)) { if (TyR->isBoundable(C) && - Loc::IsLocType(TyR->getRValueType(C))) + Loc::IsLocType(TyR->getObjectType(C))) V = X->getLoc(); } } diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index c8d0bf78ae..0e4d660f35 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -2612,7 +2612,7 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst, if (R->isBoundable(Ctx)) { // Set the value of the variable to be a conjured symbol. unsigned Count = Builder.getCurrentBlockCount(); - QualType T = R->getRValueType(Ctx); + QualType T = R->getObjectType(Ctx); if (Loc::IsLocType(T) || (T->isIntegerType() && T->isScalarType())){ ValueManager &ValMgr = Eng.getValueManager(); diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 7054f3c0bb..b92705c3bc 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -1785,7 +1785,7 @@ void GRExprEngine::VisitObjCForCollectionStmtAux(ObjCForCollectionStmt* S, // FIXME: The proper thing to do is to really iterate over the // container. We will do this with dispatch logic to the store. // For now, just 'conjure' up a symbolic value. - QualType T = R->getRValueType(getContext()); + QualType T = R->getObjectType(getContext()); assert (Loc::IsLocType(T)); unsigned Count = Builder->getCurrentBlockCount(); SymbolRef Sym = SymMgr.getConjuredSymbol(elem, T, Count); diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index 84fd163093..9f066f4469 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Analysis/MemRegion.cpp @@ -121,14 +121,6 @@ void CodeTextRegion::Profile(llvm::FoldingSetNodeID& ID) const { } //===----------------------------------------------------------------------===// -// getLValueType() and getRValueType() -//===----------------------------------------------------------------------===// - -QualType StringRegion::getRValueType(ASTContext& C) const { - return Str->getType(); -} - -//===----------------------------------------------------------------------===// // Region pretty-printing. //===----------------------------------------------------------------------===// diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index 017526cb83..ff86708c35 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -492,7 +492,7 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St, const MemRegion* R) { if (const VarRegion* VR = dyn_cast<VarRegion>(R)) { // Get the type of the variable. - QualType T = VR->getDesugaredRValueType(getContext()); + QualType T = VR->getDesugaredObjectType(getContext()); // FIXME: Handle variable-length arrays. if (isa<VariableArrayType>(T)) @@ -510,7 +510,7 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St, // that type. if (CastTy) { QualType EleTy =cast<PointerType>(CastTy->getTypePtr())->getPointeeType(); - QualType VarTy = VR->getRValueType(getContext()); + QualType VarTy = VR->getObjectType(getContext()); uint64_t EleSize = getContext().getTypeSize(EleTy); uint64_t VarSize = getContext().getTypeSize(VarTy); return NonLoc::MakeIntVal(getBasicVals(), VarSize / EleSize, false); @@ -545,7 +545,7 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St, llvm::APSInt SSize = cast<nonloc::ConcreteInt>(*Extent).getValue(); // Get the size of the element in bits. - QualType LvT = ATR->getLValueType(getContext()); + QualType LvT = ATR->getLocationType(getContext()); QualType ElemTy = cast<PointerType>(LvT.getTypePtr())->getPointeeType(); uint64_t X = getContext().getTypeSize(ElemTy); @@ -605,8 +605,8 @@ SVal RegionStoreManager::ArrayToPointer(Loc Array) { if (!ArrayR) return UnknownVal(); - // Strip off typedefs from the ArrayRegion's RvalueType. - QualType T = ArrayR->getRValueType(getContext())->getDesugaredType(); + // Strip off typedefs from the ArrayRegion's ObjectType. + QualType T = ArrayR->getObjectType(getContext())->getDesugaredType(); ArrayType *AT = cast<ArrayType>(T); T = AT->getElementType(); @@ -643,7 +643,7 @@ RegionStoreManager::CastRegion(const GRState* state, const MemRegion* R, // Return the same region if the region types are compatible. if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) { - QualType Ta = Ctx.getCanonicalType(TR->getLValueType(Ctx)); + QualType Ta = Ctx.getCanonicalType(TR->getLocationType(Ctx)); if (Ta == ToTy) return CastResult(state, R); @@ -676,7 +676,7 @@ RegionStoreManager::CastRegion(const GRState* state, const MemRegion* R, return CastResult(state, R); } - QualType ObjTy = cast<TypedRegion>(R)->getRValueType(getContext()); + QualType ObjTy = cast<TypedRegion>(R)->getObjectType(getContext()); uint64_t PointeeTySize = getContext().getTypeSize(PointeeTy); uint64_t ObjTySize = getContext().getTypeSize(ObjTy); @@ -722,7 +722,7 @@ SVal RegionStoreManager::EvalBinOp(BinaryOperator::Opcode Op, Loc L, NonLoc R) { // p += 3; // Note that p binds to a TypedViewRegion(SymbolicRegion). nonloc::ConcreteInt Idx(getBasicVals().getZeroWithPtrWidth(false)); - ER = MRMgr.getElementRegion(TR->getRValueType(getContext()), Idx, TR); + ER = MRMgr.getElementRegion(TR->getObjectType(getContext()), Idx, TR); } SVal Idx = ER->getIndex(); @@ -782,7 +782,7 @@ SVal RegionStoreManager::Retrieve(const GRState* St, Loc L, QualType T) { // // Such funny addressing will occur due to layering of regions. - QualType RTy = R->getRValueType(getContext()); + QualType RTy = R->getObjectType(getContext()); if (RTy->isStructureType()) return RetrieveStruct(St, R); @@ -868,8 +868,7 @@ SVal RegionStoreManager::Retrieve(const GRState* St, Loc L, QualType T) { } SVal RegionStoreManager::RetrieveStruct(const GRState* St,const TypedRegion* R){ - // FIXME: Verify we want getRValueType instead of getLValueType. - QualType T = R->getRValueType(getContext()); + QualType T = R->getObjectType(getContext()); assert(T->isStructureType()); const RecordType* RT = cast<RecordType>(T.getTypePtr()); @@ -894,7 +893,7 @@ SVal RegionStoreManager::RetrieveStruct(const GRState* St,const TypedRegion* R){ } SVal RegionStoreManager::RetrieveArray(const GRState* St, const TypedRegion* R){ - QualType T = R->getRValueType(getContext()); + QualType T = R->getObjectType(getContext()); ConstantArrayType* CAT = cast<ConstantArrayType>(T.getTypePtr()); llvm::ImmutableList<SVal> ArrayVal = getBasicVals().getEmptySValList(); @@ -904,7 +903,7 @@ SVal RegionStoreManager::RetrieveArray(const GRState* St, const TypedRegion* R){ for (; i < Size; ++i) { SVal Idx = NonLoc::MakeVal(getBasicVals(), i); - ElementRegion* ER = MRMgr.getElementRegion(R->getRValueType(getContext()), + ElementRegion* ER = MRMgr.getElementRegion(R->getObjectType(getContext()), Idx, R); QualType ETy = ER->getElementType(); SVal ElementVal = Retrieve(St, loc::MemRegionVal(ER), ETy); @@ -921,8 +920,7 @@ const GRState* RegionStoreManager::Bind(const GRState* St, Loc L, SVal V) { // Check if the region is a struct region. if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) - // FIXME: Verify we want getRValueType(). - if (TR->getRValueType(getContext())->isStructureType()) + if (TR->getObjectType(getContext())->isStructureType()) return BindStruct(St, TR, V); Store store = St->getStore(); @@ -1156,9 +1154,7 @@ void RegionStoreManager::print(Store store, std::ostream& Out, const GRState* RegionStoreManager::BindArray(const GRState* St, const TypedRegion* R, SVal Init) { - - // FIXME: Verify we should use getLValueType or getRValueType. - QualType T = R->getRValueType(getContext()); + QualType T = R->getObjectType(getContext()); assert(T->isArrayType()); // When we are binding the whole array, it always has default value 0. @@ -1223,8 +1219,7 @@ const GRState* RegionStoreManager::BindArray(const GRState* St, const GRState* RegionStoreManager::BindStruct(const GRState* St, const TypedRegion* R, SVal V){ - // FIXME: Verify that we should use getRValueType or getLValueType. - QualType T = R->getRValueType(getContext()); + QualType T = R->getObjectType(getContext()); assert(T->isStructureType()); const RecordType* RT = T->getAsRecordType(); diff --git a/lib/Analysis/SVals.cpp b/lib/Analysis/SVals.cpp index 724b8cf8c5..1090aaa681 100644 --- a/lib/Analysis/SVals.cpp +++ b/lib/Analysis/SVals.cpp @@ -301,7 +301,7 @@ SVal ValueManager::getRValueSymbolVal(const MemRegion* R) { SymbolRef sym = SymMgr.getRegionRValueSymbol(R); if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) { - QualType T = TR->getRValueType(SymMgr.getContext()); + QualType T = TR->getObjectType(SymMgr.getContext()); // If T is of function pointer type, create a CodeTextRegion wrapping a // symbol. diff --git a/lib/Analysis/Store.cpp b/lib/Analysis/Store.cpp index 49411b468e..13326ab31f 100644 --- a/lib/Analysis/Store.cpp +++ b/lib/Analysis/Store.cpp @@ -32,7 +32,7 @@ StoreManager::CastRegion(const GRState* state, const MemRegion* R, // Return the same region if the region types are compatible. if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) { - QualType Ta = Ctx.getCanonicalType(TR->getLValueType(Ctx)); + QualType Ta = Ctx.getCanonicalType(TR->getLocationType(Ctx)); if (Ta == ToTy) return CastResult(state, R); diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Analysis/SymbolManager.cpp index f8e2db7268..ee18f2c9e4 100644 --- a/lib/Analysis/SymbolManager.cpp +++ b/lib/Analysis/SymbolManager.cpp @@ -167,7 +167,7 @@ QualType SymbolConjured::getType(ASTContext&) const { QualType SymbolRegionRValue::getType(ASTContext& C) const { if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) - return TR->getRValueType(C); + return TR->getObjectType(C); return QualType(); } |