Renamed InvalidValue to UnknownVal.
Renamed UninitializedValue to UninitializedVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46874 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/GRConstants.cpp b/Analysis/GRConstants.cpp
index 858ed93..7e23098 100644
--- a/Analysis/GRConstants.cpp
+++ b/Analysis/GRConstants.cpp
@@ -439,14 +439,14 @@
RValue R1 = GetValue(PrevState, B->getLHS());
RValue R2 = GetValue(PrevState, B->getRHS(), hasR2);
- if (isa<InvalidValue>(R1) &&
- (isa<InvalidValue>(R2) ||
- isa<UninitializedValue>(R2))) {
+ if (isa<UnknownVal>(R1) &&
+ (isa<UnknownVal>(R2) ||
+ isa<UninitializedVal>(R2))) {
Nodify(Dst, B, Pred, SetValue(PrevState, B, R2));
return;
}
- else if (isa<UninitializedValue>(R1)) {
+ else if (isa<UninitializedVal>(R1)) {
Nodify(Dst, B, Pred, SetValue(PrevState, B, R1));
return;
}
@@ -644,7 +644,7 @@
if (const VarDecl* VD = dyn_cast<VarDecl>(D)) {
const Expr* E = VD->getInit();
St = SetValue(St, lval::DeclVal(VD),
- E ? GetValue(St, E) : UninitializedValue());
+ E ? GetValue(St, E) : UninitializedVal());
}
Nodify(Dst, DS, Pred, St);
@@ -660,7 +660,7 @@
StateTy St = Pred->getState();
RValue R = GetValue(St, LHS);
- if (isa<InvalidValue>(R)) R = GetValue(St, RHS);
+ if (isa<UnknownVal>(R)) R = GetValue(St, RHS);
Nodify(Dst, S, Pred, SetValue(St, S, R));
}
@@ -880,7 +880,7 @@
if (Op <= BinaryOperator::Or) {
- if (isa<InvalidValue>(V1) || isa<UninitializedValue>(V1)) {
+ if (isa<UnknownVal>(V1) || isa<UninitializedVal>(V1)) {
Nodify(Dst, B, N2, SetValue(St, B, V1));
continue;
}
@@ -915,7 +915,7 @@
assert (B->isCompoundAssignmentOp());
const LValue& L1 = cast<LValue>(V1);
- RValue Result = cast<NonLValue>(InvalidValue());
+ RValue Result = cast<NonLValue>(UnknownVal());
Op = (BinaryOperator::Opcode)
(((unsigned) Op) - ((unsigned) BinaryOperator::MulAssign));
diff --git a/Analysis/RValues.cpp b/Analysis/RValues.cpp
index 387a30c..9813dcb 100644
--- a/Analysis/RValues.cpp
+++ b/Analysis/RValues.cpp
@@ -149,11 +149,11 @@
BinaryOperator::Opcode Op,
const NonLValue& RHS) const {
- if (isa<InvalidValue>(this) || isa<InvalidValue>(RHS))
- return cast<NonLValue>(InvalidValue());
+ if (isa<UnknownVal>(this) || isa<UnknownVal>(RHS))
+ return cast<NonLValue>(UnknownVal());
- if (isa<UninitializedValue>(this) || isa<UninitializedValue>(RHS))
- return cast<NonLValue>(UninitializedValue());
+ if (isa<UninitializedVal>(this) || isa<UninitializedVal>(RHS))
+ return cast<NonLValue>(UninitializedVal());
switch (getSubKind()) {
default:
@@ -166,8 +166,8 @@
return self.EvalBinaryOp(ValMgr, Op,
cast<nonlval::ConcreteInt>(RHS));
}
- else if(isa<InvalidValue>(RHS))
- return cast<NonLValue>(InvalidValue());
+ else if(isa<UnknownVal>(RHS))
+ return cast<NonLValue>(UnknownVal());
else
return RHS.EvalBinaryOp(ValMgr, Op, *this);
@@ -263,7 +263,7 @@
case nonlval::ConcreteIntKind:
return cast<nonlval::ConcreteInt>(this)->EvalComplement(ValMgr);
default:
- return cast<NonLValue>(InvalidValue());
+ return cast<NonLValue>(UnknownVal());
}
}
@@ -276,7 +276,7 @@
RValue NonLValue::EvalCast(ValueManager& ValMgr, Expr* CastExpr) const {
if (!isa<nonlval::ConcreteInt>(this))
- return InvalidValue();
+ return UnknownVal();
APSInt V = cast<nonlval::ConcreteInt>(this)->getValue();
QualType T = CastExpr->getType();
@@ -296,7 +296,7 @@
case nonlval::ConcreteIntKind:
return cast<nonlval::ConcreteInt>(this)->EvalMinus(ValMgr, U);
default:
- return cast<NonLValue>(InvalidValue());
+ return cast<NonLValue>(UnknownVal());
}
}
@@ -345,7 +345,7 @@
switch (getSubKind()) {
default:
assert(false && "EQ not implemented for this LValue.");
- return cast<NonLValue>(InvalidValue());
+ return cast<NonLValue>(UnknownVal());
case lval::ConcreteIntKind:
if (isa<lval::ConcreteInt>(RHS)) {
@@ -398,7 +398,7 @@
switch (getSubKind()) {
default:
assert(false && "NE not implemented for this LValue.");
- return cast<NonLValue>(InvalidValue());
+ return cast<NonLValue>(UnknownVal());
case lval::ConcreteIntKind:
if (isa<lval::ConcreteInt>(RHS)) {
@@ -456,7 +456,7 @@
assert (CastExpr->getType()->isIntegerType());
if (!isa<lval::ConcreteInt>(*this))
- return InvalidValue();
+ return UnknownVal();
APSInt V = cast<lval::ConcreteInt>(this)->getValue();
QualType T = CastExpr->getType();
diff --git a/Analysis/RValues.h b/Analysis/RValues.h
index ce9b8a6..92f847b 100644
--- a/Analysis/RValues.h
+++ b/Analysis/RValues.h
@@ -244,7 +244,7 @@
enum BaseKind { LValueKind=0x0,
NonLValueKind=0x1,
UninitializedKind=0x2,
- InvalidKind=0x3 };
+ UnknownKind=0x3 };
enum { BaseBits = 2,
BaseMask = 0x3 };
@@ -290,8 +290,8 @@
static RValue GetSymbolValue(SymbolManager& SymMgr, ParmVarDecl *D);
- inline bool isValid() const { return getRawKind() != InvalidKind; }
- inline bool isInvalid() const { return getRawKind() == InvalidKind; }
+ inline bool isKnown() const { return getRawKind() != UnknownKind; }
+ inline bool isUnknown() const { return getRawKind() == UnknownKind; }
void print(std::ostream& OS) const;
void print() const;
@@ -300,18 +300,18 @@
static inline bool classof(const RValue*) { return true; }
};
-class InvalidValue : public RValue {
+class UnknownVal : public RValue {
public:
- InvalidValue() : RValue(InvalidKind) {}
+ UnknownVal() : RValue(UnknownKind) {}
static inline bool classof(const RValue* V) {
- return V->getBaseKind() == InvalidKind;
+ return V->getBaseKind() == UnknownKind;
}
};
-class UninitializedValue : public RValue {
+class UninitializedVal : public RValue {
public:
- UninitializedValue() : RValue(UninitializedKind) {}
+ UninitializedVal() : RValue(UninitializedKind) {}
static inline bool classof(const RValue* V) {
return V->getBaseKind() == UninitializedKind;
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp
index 20112c8..d278619 100644
--- a/Analysis/ValueState.cpp
+++ b/Analysis/ValueState.cpp
@@ -35,15 +35,15 @@
RValue ValueStateManager::GetValue(const StateTy& St, const LValue& LV,
QualType* T) {
- if (isa<InvalidValue>(LV))
- return InvalidValue();
+ if (isa<UnknownVal>(LV))
+ return UnknownVal();
switch (LV.getSubKind()) {
case lval::DeclValKind: {
StateTy::VariableBindingsTy::TreeTy* T =
St.getImpl()->VariableBindings.SlimFind(cast<lval::DeclVal>(LV).getDecl());
- return T ? T->getValue().second : InvalidValue();
+ return T ? T->getValue().second : UnknownVal();
}
// FIXME: We should bind how far a "ContentsOf" will go...
@@ -63,7 +63,7 @@
break;
}
- return InvalidValue();
+ return UnknownVal();
}
ValueStateManager::StateTy
@@ -160,7 +160,7 @@
}
else {
if (hasVal) *hasVal = false;
- return InvalidValue();
+ return UnknownVal();
}
}
@@ -185,7 +185,7 @@
const RValue& V) {
assert (S);
- return V.isValid() ? Add(St, VarBindKey(S, isBlkExpr), V) : St;
+ return V.isKnown() ? Add(St, VarBindKey(S, isBlkExpr), V) : St;
}
ValueStateManager::StateTy
@@ -193,7 +193,7 @@
switch (LV.getSubKind()) {
case lval::DeclValKind:
- return V.isValid() ? Add(St, cast<lval::DeclVal>(LV).getDecl(), V)
+ return V.isKnown() ? Add(St, cast<lval::DeclVal>(LV).getDecl(), V)
: Remove(St, cast<lval::DeclVal>(LV).getDecl());
default: