SymbolicRegionKind,
CompoundLiteralRegionKind,
StringRegionKind, ElementRegionKind,
- AnonTypedRegionKind,
+ TypedViewRegionKind,
AnonPointeeRegionKind,
// Decl Regions.
BEG_DECL_REGIONS,
}
};
-class AnonTypedRegion : public TypedRegion {
+class TypedViewRegion : public TypedRegion {
friend class MemRegionManager;
QualType T;
- AnonTypedRegion(QualType t, const MemRegion* sreg)
- : TypedRegion(sreg, AnonTypedRegionKind), T(t) {}
+ TypedViewRegion(QualType t, const MemRegion* sreg)
+ : TypedRegion(sreg, TypedViewRegionKind), T(t) {}
static void ProfileRegion(llvm::FoldingSetNodeID& ID, QualType T,
const MemRegion* superRegion);
}
static bool classof(const MemRegion* R) {
- return R->getKind() == AnonTypedRegionKind;
+ return R->getKind() == TypedViewRegionKind;
}
};
ObjCIvarRegion* getObjCIvarRegion(const ObjCIvarDecl* ivd,
const MemRegion* superRegion);
- AnonTypedRegion* getAnonTypedRegion(QualType t, const MemRegion* superRegion);
+ TypedViewRegion* getTypedViewRegion(QualType t, const MemRegion* superRegion);
bool hasStackStorage(const MemRegion* R);
const TypedRegion* R = dyn_cast<TypedRegion>(LV->getRegion());
if (!R) return false;
- while (const AnonTypedRegion* ATR = dyn_cast<AnonTypedRegion>(R)) {
+ while (const TypedViewRegion* ATR = dyn_cast<TypedViewRegion>(R)) {
R = dyn_cast<TypedRegion>(ATR->getSuperRegion());
if (!R) return false;
}
return CastResult(state, R);
}
- return CastResult(state, MRMgr.getAnonTypedRegion(CastToTy, R));
+ return CastResult(state, MRMgr.getTypedViewRegion(CastToTy, R));
}
SVal BasicStoreManager::getLValueField(const GRState* St, SVal Base,
StateMgr.getSymbolManager());
// Layered a typed region on top of this.
QualType T = StateMgr.getSymbolManager().getType(Sym);
- BaseR = MRMgr.getAnonTypedRegion(T, SymR);
+ BaseR = MRMgr.getTypedViewRegion(T, SymR);
break;
}
const TypedRegion* R = dyn_cast<TypedRegion>(MR->getRegion());
- // Blast through AnonTypedRegions to get the original region type.
+ // Blast through TypedViewRegions to get the original region type.
while (R) {
- const AnonTypedRegion* ATR = dyn_cast<AnonTypedRegion>(R);
+ const TypedViewRegion* ATR = dyn_cast<TypedViewRegion>(R);
if (!ATR) break;
R = dyn_cast<TypedRegion>(ATR->getSuperRegion());
}
ProfileRegion(ID, Ex, Cnt);
}
-void AnonTypedRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, QualType T,
+void TypedViewRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, QualType T,
const MemRegion* superRegion) {
- ID.AddInteger((unsigned) AnonTypedRegionKind);
+ ID.AddInteger((unsigned) TypedViewRegionKind);
ID.Add(T);
ID.AddPointer(superRegion);
}
os << "alloca{" << (void*) Ex << ',' << Cnt << '}';
}
-void AnonTypedRegion::print(llvm::raw_ostream& os) const {
+void TypedViewRegion::print(llvm::raw_ostream& os) const {
os << "anon_type{" << T.getAsString() << ',';
getSuperRegion()->print(os);
os << '}';
return R;
}
-AnonTypedRegion*
-MemRegionManager::getAnonTypedRegion(QualType t, const MemRegion* superRegion) {
+TypedViewRegion*
+MemRegionManager::getTypedViewRegion(QualType t, const MemRegion* superRegion) {
llvm::FoldingSetNodeID ID;
- AnonTypedRegion::ProfileRegion(ID, t, superRegion);
+ TypedViewRegion::ProfileRegion(ID, t, superRegion);
void* InsertPos;
MemRegion* data = Regions.FindNodeOrInsertPos(ID, InsertPos);
- AnonTypedRegion* R = cast_or_null<AnonTypedRegion>(data);
+ TypedViewRegion* R = cast_or_null<TypedViewRegion>(data);
if (!R) {
- R = (AnonTypedRegion*) A.Allocate<AnonTypedRegion>();
- new (R) AnonTypedRegion(t, superRegion);
+ R = (TypedViewRegion*) A.Allocate<TypedViewRegion>();
+ new (R) TypedViewRegion(t, superRegion);
Regions.InsertNode(R, InsertPos);
}
// char *p = __builtin_alloc(10);
// p[1] = 8;
//
- // Observe that 'p' binds to an AnonTypedRegion<AllocaRegion>.
+ // Observe that 'p' binds to an TypedViewRegion<AllocaRegion>.
//
// Offset might be unsigned. We have to convert it to signed ConcreteInt.
return NonLoc::MakeIntVal(getBasicVals(), Str->getByteLength()+1, false);
}
- if (const AnonTypedRegion* ATR = dyn_cast<AnonTypedRegion>(R)) {
+ if (const TypedViewRegion* ATR = dyn_cast<TypedViewRegion>(R)) {
#if 0
// FIXME: This logic doesn't really work, as we can have all sorts of
// weird cases. For example, this crashes on test case 'rdar-6442306-1.m'.
// char* y = (char*) x;
// void* z = (void*) y; // <-- we should get the same region that is
// bound to 'x'
- const MemRegion* ViewR = MRMgr.getAnonTypedRegion(CastToTy, R);
+ const MemRegion* ViewR = MRMgr.getTypedViewRegion(CastToTy, R);
return CastResult(AddRegionView(state, ViewR, R), ViewR);
}