return UnknownVal();
if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) {
- QualType T = TR->getObjectType(getContext());
+ QualType T = TR->getValueType(getContext());
if (Loc::IsLocType(T) || T->isIntegerType())
return GetSVal(state, R);
}
TypedRegion(const MemRegion* sReg, Kind k) : SubRegion(sReg, k) {}
public:
- virtual QualType getObjectType(ASTContext &C) const = 0;
+ virtual QualType getValueType(ASTContext &C) const = 0;
virtual QualType getLocationType(ASTContext& C) const {
// FIXME: We can possibly optimize this later to cache this value.
- return C.getPointerType(getObjectType(C));
+ return C.getPointerType(getValueType(C));
}
- QualType getDesugaredObjectType(ASTContext& C) const {
- QualType T = getObjectType(C);
+ QualType getDesugaredValueType(ASTContext& C) const {
+ QualType T = getValueType(C);
return T.getTypePtr() ? T->getDesugaredType() : T;
}
}
bool isBoundable(ASTContext &C) const {
- return !getObjectType(C).isNull();
+ return !getValueType(C).isNull();
}
static bool classof(const MemRegion* R) {
Data(sym),
LocationType(t) {}
- QualType getObjectType(ASTContext &C) const {
+ QualType getValueType(ASTContext &C) const {
// Do not get the object type of a CodeTextRegion.
assert(0);
return QualType();
const StringLiteral* getStringLiteral() const { return Str; }
- QualType getObjectType(ASTContext& C) const {
+ QualType getValueType(ASTContext& C) const {
return Str->getType();
}
return LValueType;
}
- QualType getObjectType(ASTContext&) const {
+ QualType getValueType(ASTContext&) const {
const PointerType* PTy = LValueType->getAsPointerType();
assert(PTy);
return PTy->getPointeeType();
const CompoundLiteralExpr* CL,
const MemRegion* superRegion);
public:
- QualType getObjectType(ASTContext& C) const {
+ QualType getValueType(ASTContext& C) const {
return C.getCanonicalType(CL->getType());
}
public:
const VarDecl* getDecl() const { return cast<VarDecl>(D); }
- QualType getObjectType(ASTContext& C) const {
+ QualType getValueType(ASTContext& C) const {
// FIXME: We can cache this if needed.
return C.getCanonicalType(getDecl()->getType());
}
const FieldDecl* getDecl() const { return cast<FieldDecl>(D); }
- QualType getObjectType(ASTContext& C) const {
+ QualType getValueType(ASTContext& C) const {
// FIXME: We can cache this if needed.
return C.getCanonicalType(getDecl()->getType());
}
return cast<ObjCInterfaceDecl>(D);
}
- QualType getObjectType(ASTContext& C) const {
+ QualType getValueType(ASTContext& C) const {
return C.getObjCInterfaceType(getInterface());
}
public:
const ObjCIvarDecl* getDecl() const { return cast<ObjCIvarDecl>(D); }
- QualType getObjectType(ASTContext&) const { return getDecl()->getType(); }
+ QualType getValueType(ASTContext&) const { return getDecl()->getType(); }
static bool classof(const MemRegion* R) {
return R->getKind() == ObjCIvarRegionKind;
SVal getIndex() const { return Index; }
- QualType getObjectType(ASTContext&) const {
+ QualType getValueType(ASTContext&) const {
return ElementType;
}
if (!R) return false;
}
- QualType T = Ctx.getCanonicalType(R->getObjectType(Ctx));
+ QualType T = Ctx.getCanonicalType(R->getValueType(Ctx));
// FIXME: If the pointee isn't an integer type, should we flag a warning?
// People can do weird stuff with pointers.
// elsewhere. Food for thought.
if (const TypedRegion *TyR = dyn_cast<TypedRegion>(R)) {
if (TyR->isBoundable(C) &&
- Loc::IsLocType(TyR->getObjectType(C)))
+ Loc::IsLocType(TyR->getValueType(C)))
V = X->getLoc();
}
}
if (R->isBoundable(Ctx)) {
// Set the value of the variable to be a conjured symbol.
unsigned Count = Builder.getCurrentBlockCount();
- QualType T = R->getObjectType(Ctx);
+ QualType T = R->getValueType(Ctx);
if (Loc::IsLocType(T) || (T->isIntegerType() && T->isScalarType())){
ValueManager &ValMgr = Eng.getValueManager();
// 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->getObjectType(getContext());
+ QualType T = R->getValueType(getContext());
assert (Loc::IsLocType(T));
unsigned Count = Builder->getCurrentBlockCount();
SymbolRef Sym = SymMgr.getConjuredSymbol(elem, T, Count);
const MemRegion* R) {
if (const VarRegion* VR = dyn_cast<VarRegion>(R)) {
// Get the type of the variable.
- QualType T = VR->getDesugaredObjectType(getContext());
+ QualType T = VR->getDesugaredValueType(getContext());
// FIXME: Handle variable-length arrays.
if (isa<VariableArrayType>(T))
// that type.
if (CastTy) {
QualType EleTy =cast<PointerType>(CastTy->getTypePtr())->getPointeeType();
- QualType VarTy = VR->getObjectType(getContext());
+ QualType VarTy = VR->getValueType(getContext());
uint64_t EleSize = getContext().getTypeSize(EleTy);
uint64_t VarSize = getContext().getTypeSize(VarTy);
return NonLoc::MakeIntVal(getBasicVals(), VarSize / EleSize, false);
if (!ArrayR)
return UnknownVal();
- // Strip off typedefs from the ArrayRegion's ObjectType.
- QualType T = ArrayR->getObjectType(getContext())->getDesugaredType();
+ // Strip off typedefs from the ArrayRegion's ValueType.
+ QualType T = ArrayR->getValueType(getContext())->getDesugaredType();
ArrayType *AT = cast<ArrayType>(T);
T = AT->getElementType();
return CastResult(state, R);
}
- QualType ObjTy = cast<TypedRegion>(R)->getObjectType(getContext());
+ QualType ObjTy = cast<TypedRegion>(R)->getValueType(getContext());
uint64_t PointeeTySize = getContext().getTypeSize(PointeeTy);
uint64_t ObjTySize = getContext().getTypeSize(ObjTy);
// p += 3;
// Note that p binds to a TypedViewRegion(SymbolicRegion).
nonloc::ConcreteInt Idx(getBasicVals().getZeroWithPtrWidth(false));
- ER = MRMgr.getElementRegion(TR->getObjectType(getContext()), Idx, TR);
+ ER = MRMgr.getElementRegion(TR->getValueType(getContext()), Idx, TR);
}
SVal Idx = ER->getIndex();
//
// Such funny addressing will occur due to layering of regions.
- QualType RTy = R->getObjectType(getContext());
+ QualType RTy = R->getValueType(getContext());
if (RTy->isStructureType())
return RetrieveStruct(St, R);
}
SVal RegionStoreManager::RetrieveStruct(const GRState* St,const TypedRegion* R){
- QualType T = R->getObjectType(getContext());
+ QualType T = R->getValueType(getContext());
assert(T->isStructureType());
const RecordType* RT = cast<RecordType>(T.getTypePtr());
}
SVal RegionStoreManager::RetrieveArray(const GRState* St, const TypedRegion* R){
- QualType T = R->getObjectType(getContext());
+ QualType T = R->getValueType(getContext());
ConstantArrayType* CAT = cast<ConstantArrayType>(T.getTypePtr());
llvm::ImmutableList<SVal> ArrayVal = getBasicVals().getEmptySValList();
for (; i < Size; ++i) {
SVal Idx = NonLoc::MakeVal(getBasicVals(), i);
- ElementRegion* ER = MRMgr.getElementRegion(R->getObjectType(getContext()),
+ ElementRegion* ER = MRMgr.getElementRegion(R->getValueType(getContext()),
Idx, R);
QualType ETy = ER->getElementType();
SVal ElementVal = Retrieve(St, loc::MemRegionVal(ER), ETy);
// Check if the region is a struct region.
if (const TypedRegion* TR = dyn_cast<TypedRegion>(R))
- if (TR->getObjectType(getContext())->isStructureType())
+ if (TR->getValueType(getContext())->isStructureType())
return BindStruct(St, TR, V);
Store store = St->getStore();
const GRState* RegionStoreManager::BindArray(const GRState* St,
const TypedRegion* R, SVal Init) {
- QualType T = R->getObjectType(getContext());
+ QualType T = R->getValueType(getContext());
assert(T->isArrayType());
// When we are binding the whole array, it always has default value 0.
const GRState*
RegionStoreManager::BindStruct(const GRState* St, const TypedRegion* R, SVal V){
- QualType T = R->getObjectType(getContext());
+ QualType T = R->getValueType(getContext());
assert(T->isStructureType());
const RecordType* RT = T->getAsRecordType();
SymbolRef sym = SymMgr.getRegionRValueSymbol(R);
if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) {
- QualType T = TR->getObjectType(SymMgr.getContext());
+ QualType T = TR->getValueType(SymMgr.getContext());
// If T is of function pointer type, create a CodeTextRegion wrapping a
// symbol.
QualType SymbolRegionRValue::getType(ASTContext& C) const {
if (const TypedRegion* TR = dyn_cast<TypedRegion>(R))
- return TR->getObjectType(C);
+ return TR->getValueType(C);
return QualType();
}