class SymExpr : public llvm::FoldingSetNode {
public:
- enum Kind { BEGIN_SYMBOLS, RegionRValue, ConjuredKind, END_SYMBOLS,
+ enum Kind { BEGIN_SYMBOLS, RegionValueKind, ConjuredKind, END_SYMBOLS,
SymIntKind, SymSymKind };
private:
Kind K;
typedef const SymbolData* SymbolRef;
-class SymbolRegionRValue : public SymbolData {
+class SymbolRegionValue : public SymbolData {
const MemRegion *R;
public:
- SymbolRegionRValue(SymbolID sym, const MemRegion *r)
- : SymbolData(RegionRValue, sym), R(r) {}
+ SymbolRegionValue(SymbolID sym, const MemRegion *r)
+ : SymbolData(RegionValueKind, sym), R(r) {}
const MemRegion* getRegion() const { return R; }
static void Profile(llvm::FoldingSetNodeID& profile, const MemRegion* R) {
- profile.AddInteger((unsigned) RegionRValue);
+ profile.AddInteger((unsigned) RegionValueKind);
profile.AddPointer(R);
}
// Implement isa<T> support.
static inline bool classof(const SymExpr* SE) {
- return SE->getKind() == RegionRValue;
+ return SE->getKind() == RegionValueKind;
}
};
QualType getType(ASTContext& C) const { return T; }
static void Profile(llvm::FoldingSetNodeID& ID, const SymExpr *lhs,
- BinaryOperator::Opcode op, const SymExpr *rhs, QualType t) {
+ BinaryOperator::Opcode op, const SymExpr *rhs, QualType t) {
ID.AddInteger((unsigned) SymSymKind);
ID.AddPointer(lhs);
ID.AddInteger(op);
static bool canSymbolicate(QualType T);
/// Make a unique symbol for MemRegion R according to its kind.
- const SymbolRegionRValue* getRegionRValueSymbol(const MemRegion* R);
+ const SymbolRegionValue* getRegionValueSymbol(const MemRegion* R);
const SymbolConjured* getConjuredSymbol(const Stmt* E, QualType T,
unsigned VisitCount,
const void* SymbolTag = 0);
return getConjuredSymbol(E, E->getType(), VisitCount, SymbolTag);
}
- const SymIntExpr *getSymIntExpr(const SymExpr *lhs, BinaryOperator::Opcode op,
+ const SymIntExpr *getSymIntExpr(const SymExpr *lhs, BinaryOperator::Opcode op,
const llvm::APSInt& rhs, QualType t);
const SymIntExpr *getSymIntExpr(const SymExpr &lhs, BinaryOperator::Opcode op,
/// elements.
SVal makeZeroArrayIndex();
- /// GetRValueSymbolVal - make a unique symbol for value of R.
- SVal getRValueSymbolVal(const MemRegion* R);
+ /// GetRegionValueSymbolVal - make a unique symbol for value of R.
+ SVal getRegionValueSymbolVal(const MemRegion* R);
SVal getConjuredSymbolVal(const Expr *E, unsigned Count);
SVal getConjuredSymbolVal(const Expr* E, QualType T, unsigned Count);
if (DR->getDecl() == SelfDecl) {
const MemRegion *IVR = MRMgr.getObjCIvarRegion(IV->getDecl(),
SelfRegion);
- SVal X = ValMgr.getRValueSymbolVal(IVR);
+ SVal X = ValMgr.getRegionValueSymbolVal(IVR);
St = BindInternal(St, Loc::MakeVal(IVR), X);
}
}
const MemRegion *R = StateMgr.getRegion(VD);
SVal X = (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD) ||
isa<ImplicitParamDecl>(VD))
- ? ValMgr.getRValueSymbolVal(R)
+ ? ValMgr.getRegionValueSymbolVal(R)
: UndefinedVal();
St = BindInternal(St, Loc::MakeVal(R), X);
if (SR == SelfRegion) {
// FIXME: Do we need to handle the case where the super region
// has a view? We want to canonicalize the bindings.
- return ValMgr.getRValueSymbolVal(R);
+ return ValMgr.getRegionValueSymbolVal(R);
}
// Otherwise, we need a new symbol. For now return Unknown.
VD->hasGlobalStorage()) {
QualType VTy = VD->getType();
if (Loc::IsLocType(VTy) || VTy->isIntegerType())
- return ValMgr.getRValueSymbolVal(VR);
+ return ValMgr.getRegionValueSymbolVal(VR);
else
return UnknownVal();
}
// All other integer values are symbolic.
if (Loc::IsLocType(RTy) || RTy->isIntegerType())
- return ValMgr.getRValueSymbolVal(R);
+ return ValMgr.getRegionValueSymbolVal(R);
else
return UnknownVal();
}
return nonloc::CompoundVal(BasicVals.getCompoundValData(T, Vals));
}
-SVal ValueManager::getRValueSymbolVal(const MemRegion* R) {
- SymbolRef sym = SymMgr.getRegionRValueSymbol(R);
+SVal ValueManager::getRegionValueSymbolVal(const MemRegion* R) {
+ SymbolRef sym = SymMgr.getRegionValueSymbol(R);
if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) {
QualType T = TR->getValueType(SymMgr.getContext());
static void print(llvm::raw_ostream& os, const SymExpr *SE) {
switch (SE->getKind()) {
case SymExpr::BEGIN_SYMBOLS:
- case SymExpr::RegionRValue:
+ case SymExpr::RegionValueKind:
case SymExpr::ConjuredKind:
case SymExpr::END_SYMBOLS:
os << '$' << cast<SymbolData>(SE)->getSymbolID();
return os;
}
-const SymbolRegionRValue*
-SymbolManager::getRegionRValueSymbol(const MemRegion* R) {
+const SymbolRegionValue*
+SymbolManager::getRegionValueSymbol(const MemRegion* R) {
llvm::FoldingSetNodeID profile;
- SymbolRegionRValue::Profile(profile, R);
+ SymbolRegionValue::Profile(profile, R);
void* InsertPos;
SymExpr *SD = DataSet.FindNodeOrInsertPos(profile, InsertPos);
if (!SD) {
- SD = (SymExpr*) BPAlloc.Allocate<SymbolRegionRValue>();
- new (SD) SymbolRegionRValue(SymbolCounter, R);
+ SD = (SymExpr*) BPAlloc.Allocate<SymbolRegionValue>();
+ new (SD) SymbolRegionValue(SymbolCounter, R);
DataSet.InsertNode(SD, InsertPos);
++SymbolCounter;
}
- return cast<SymbolRegionRValue>(SD);
+ return cast<SymbolRegionValue>(SD);
}
const SymbolConjured*
return T;
}
-QualType SymbolRegionRValue::getType(ASTContext& C) const {
+QualType SymbolRegionValue::getType(ASTContext& C) const {
if (const TypedRegion* TR = dyn_cast<TypedRegion>(R))
return TR->getValueType(C);
// Interogate the symbol. It may derive from an input value to
// the analyzed function/method.
- return isa<SymbolRegionRValue>(sym);
+ return isa<SymbolRegionValue>(sym);
}
SymbolVisitor::~SymbolVisitor() {}