[cfe-commits] r58421 - in /cfe/trunk: include/clang/Analysis/PathSensitive/Environment.h include/clang/Analysis/PathSensitive/GRExprEngine.h include/clang/Analysis/PathSensitive/GRState.h lib/Analysis/Environment.cpp lib/Analysis/GRExprEngine.cpp lib/Analysis/GRSimpleVals.cpp lib/Analysis/GRState.cpp lib/Analysis/GRTransferFuncs.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Wed Oct 29 22:33:54 PDT 2008
Author: zhongxingxu
Date: Thu Oct 30 00:33:54 2008
New Revision: 58421
URL: http://llvm.org/viewvc/llvm-project?rev=58421&view=rev
Log:
Rename:
- SetSVal(GRState*, Loc, SVal) => BindLoc
- SetSVal(GRState*, Expr*, SVal) => BindExpr
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/Environment.h
cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
cfe/trunk/lib/Analysis/Environment.cpp
cfe/trunk/lib/Analysis/GRExprEngine.cpp
cfe/trunk/lib/Analysis/GRSimpleVals.cpp
cfe/trunk/lib/Analysis/GRState.cpp
cfe/trunk/lib/Analysis/GRTransferFuncs.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/Environment.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/Environment.h?rev=58421&r1=58420&r2=58421&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/Environment.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/Environment.h Thu Oct 30 00:33:54 2008
@@ -139,8 +139,8 @@
return Environment(F.GetEmptyMap(), F.GetEmptyMap());
}
- Environment SetSVal(const Environment& Env, Expr* E, SVal V,
- bool isBlkExpr, bool Invalidate);
+ Environment BindExpr(const Environment& Env, Expr* E, SVal V,
+ bool isBlkExpr, bool Invalidate);
Environment RemoveDeadBindings(Environment Env, Stmt* Loc,
const LiveVariables& Liveness,
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h?rev=58421&r1=58420&r2=58421&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Thu Oct 30 00:33:54 2008
@@ -405,22 +405,22 @@
public:
- const GRState* SetSVal(const GRState* St, Expr* Ex, SVal V) {
- return StateMgr.SetSVal(St, Ex, V);
+ const GRState* BindExpr(const GRState* St, Expr* Ex, SVal V) {
+ return StateMgr.BindExpr(St, Ex, V);
}
- const GRState* SetSVal(const GRState* St, const Expr* Ex, SVal V) {
- return SetSVal(St, const_cast<Expr*>(Ex), V);
+ const GRState* BindExpr(const GRState* St, const Expr* Ex, SVal V) {
+ return BindExpr(St, const_cast<Expr*>(Ex), V);
}
protected:
- const GRState* SetBlkExprSVal(const GRState* St, Expr* Ex, SVal V) {
- return StateMgr.SetSVal(St, Ex, V, true, false);
+ const GRState* BindBlkExpr(const GRState* St, Expr* Ex, SVal V) {
+ return StateMgr.BindExpr(St, Ex, V, true, false);
}
- const GRState* SetSVal(const GRState* St, Loc LV, SVal V) {
- return StateMgr.SetSVal(St, LV, V);
+ const GRState* BindLoc(const GRState* St, Loc LV, SVal V) {
+ return StateMgr.BindLoc(St, LV, V);
}
SVal GetSVal(const GRState* St, Expr* Ex) {
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h?rev=58421&r1=58420&r2=58421&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Thu Oct 30 00:33:54 2008
@@ -398,11 +398,11 @@
return St->getEnvironment().GetBlkExprSVal(Ex, BasicVals);
}
- const GRState* SetSVal(const GRState* St, Expr* Ex, SVal V,
- bool isBlkExpr, bool Invalidate) {
+ const GRState* BindExpr(const GRState* St, Expr* Ex, SVal V,
+ bool isBlkExpr, bool Invalidate) {
const Environment& OldEnv = St->getEnvironment();
- Environment NewEnv = EnvMgr.SetSVal(OldEnv, Ex, V, isBlkExpr, Invalidate);
+ Environment NewEnv = EnvMgr.BindExpr(OldEnv, Ex, V, isBlkExpr, Invalidate);
if (NewEnv == OldEnv)
return St;
@@ -412,8 +412,8 @@
return getPersistentState(NewSt);
}
- const GRState* SetSVal(const GRState* St, Expr* Ex, SVal V,
- bool Invalidate = true) {
+ const GRState* BindExpr(const GRState* St, Expr* Ex, SVal V,
+ bool Invalidate = true) {
bool isBlkExpr = false;
@@ -426,7 +426,7 @@
return St;
}
- return SetSVal(St, Ex, V, isBlkExpr, Invalidate);
+ return BindExpr(St, Ex, V, isBlkExpr, Invalidate);
}
SVal ArrayToPointer(SVal Array) {
@@ -456,11 +456,11 @@
return StoreMgr->GetRegionSVal(St->getStore(), R);
}
- void SetSVal(GRState& St, Loc LV, SVal V) {
+ void BindLoc(GRState& St, Loc LV, SVal V) {
St.St = StoreMgr->Bind(St.St, LV, V);
}
- const GRState* SetSVal(const GRState* St, Loc LV, SVal V);
+ const GRState* BindLoc(const GRState* St, Loc LV, SVal V);
void Unbind(GRState& St, Loc LV) {
St.St = StoreMgr->Remove(St.St, LV);
@@ -558,16 +558,16 @@
}
GRStateRef SetSVal(Expr* Ex, SVal V, bool isBlkExpr, bool Invalidate) {
- return GRStateRef(Mgr->SetSVal(St, Ex, V, isBlkExpr, Invalidate), *Mgr);
+ return GRStateRef(Mgr->BindExpr(St, Ex, V, isBlkExpr, Invalidate), *Mgr);
}
GRStateRef SetSVal(Expr* Ex, SVal V, bool Invalidate = true) {
- return GRStateRef(Mgr->SetSVal(St, Ex, V, Invalidate), *Mgr);
+ return GRStateRef(Mgr->BindExpr(St, Ex, V, Invalidate), *Mgr);
}
GRStateRef SetSVal(Loc LV, SVal V) {
GRState StImpl = *St;
- Mgr->SetSVal(StImpl, LV, V);
+ Mgr->BindLoc(StImpl, LV, V);
return GRStateRef(Mgr->getPersistentState(StImpl), *Mgr);
}
Modified: cfe/trunk/lib/Analysis/Environment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Environment.cpp?rev=58421&r1=58420&r2=58421&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/Environment.cpp (original)
+++ cfe/trunk/lib/Analysis/Environment.cpp Thu Oct 30 00:33:54 2008
@@ -89,8 +89,8 @@
}
}
-Environment EnvironmentManager::SetSVal(const Environment& Env, Expr* E, SVal V,
- bool isBlkExpr, bool Invalidate) {
+Environment EnvironmentManager::BindExpr(const Environment& Env, Expr* E,SVal V,
+ bool isBlkExpr, bool Invalidate) {
assert (E);
if (V.isUnknown()) {
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=58421&r1=58420&r2=58421&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Thu Oct 30 00:33:54 2008
@@ -303,7 +303,7 @@
}
else if (B->getOpcode() == BinaryOperator::Comma) {
const GRState* St = GetState(Pred);
- MakeNode(Dst, B, Pred, SetSVal(St, B, GetSVal(St, B->getRHS())));
+ MakeNode(Dst, B, Pred, BindExpr(St, B, GetSVal(St, B->getRHS())));
break;
}
@@ -390,7 +390,7 @@
assert (!SE->getSubStmt()->body_empty());
if (Expr* LastExpr = dyn_cast<Expr>(*SE->getSubStmt()->body_rbegin()))
- MakeNode(Dst, SE, Pred, SetSVal(St, SE, GetSVal(St, LastExpr)));
+ MakeNode(Dst, SE, Pred, BindExpr(St, SE, GetSVal(St, LastExpr)));
else
Dst.Add(Pred);
@@ -456,7 +456,7 @@
case Stmt::StringLiteralClass: {
const GRState* St = GetState(Pred);
SVal V = StateMgr.GetLValue(St, cast<StringLiteral>(Ex));
- MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, V));
+ MakeNode(Dst, Ex, Pred, BindExpr(St, Ex, V));
return;
}
@@ -513,7 +513,7 @@
(Op == BinaryOperator::LOr && !branchTaken)
? B->getRHS() : B->getLHS();
- return SetBlkExprSVal(St, B, UndefinedVal(Ex));
+ return BindBlkExpr(St, B, UndefinedVal(Ex));
}
case Stmt::ConditionalOperatorClass: { // ?:
@@ -530,7 +530,7 @@
else
Ex = C->getRHS();
- return SetBlkExprSVal(St, C, UndefinedVal(Ex));
+ return BindBlkExpr(St, C, UndefinedVal(Ex));
}
case Stmt::ChooseExprClass: { // ?:
@@ -538,7 +538,7 @@
ChooseExpr* C = cast<ChooseExpr>(Terminator);
Expr* Ex = branchTaken ? C->getLHS() : C->getRHS();
- return SetBlkExprSVal(St, C, UndefinedVal(Ex));
+ return BindBlkExpr(St, C, UndefinedVal(Ex));
}
}
}
@@ -664,7 +664,7 @@
X = GetBlkExprSVal(St, SE);
// Make sure that we invalidate the previous binding.
- MakeNode(Dst, Ex, Pred, StateMgr.SetSVal(St, Ex, X, true, true));
+ MakeNode(Dst, Ex, Pred, StateMgr.BindExpr(St, Ex, X, true, true));
}
/// ProcessSwitch - Called by GRCoreEngine. Used to generate successor
@@ -796,7 +796,7 @@
// Handle undefined values.
if (X.isUndef()) {
- MakeNode(Dst, B, Pred, SetBlkExprSVal(St, B, X));
+ MakeNode(Dst, B, Pred, BindBlkExpr(St, B, X));
return;
}
@@ -812,14 +812,14 @@
if (isFeasible)
MakeNode(Dst, B, Pred,
- SetBlkExprSVal(NewState, B, MakeConstantVal(1U, B)));
+ BindBlkExpr(NewState, B, MakeConstantVal(1U, B)));
isFeasible = false;
NewState = Assume(St, X, false, isFeasible);
if (isFeasible)
MakeNode(Dst, B, Pred,
- SetBlkExprSVal(NewState, B, MakeConstantVal(0U, B)));
+ BindBlkExpr(NewState, B, MakeConstantVal(0U, B)));
}
else {
// We took the LHS expression. Depending on whether we are '&&' or
@@ -827,7 +827,7 @@
// the short-circuiting.
X = MakeConstantVal( B->getOpcode() == BinaryOperator::LAnd ? 0U : 1U, B);
- MakeNode(Dst, B, Pred, SetBlkExprSVal(St, B, X));
+ MakeNode(Dst, B, Pred, BindBlkExpr(St, B, X));
}
}
@@ -847,7 +847,7 @@
SVal V = StateMgr.GetLValue(St, VD);
if (asLValue)
- MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, V));
+ MakeNode(Dst, Ex, Pred, BindExpr(St, Ex, V));
else
EvalLoad(Dst, Ex, Pred, St, V);
return;
@@ -857,7 +857,7 @@
BasicValueFactory& BasicVals = StateMgr.getBasicVals();
SVal V = nonloc::ConcreteInt(BasicVals.getValue(ED->getInitVal()));
- MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, V));
+ MakeNode(Dst, Ex, Pred, BindExpr(St, Ex, V));
return;
} else if (const FunctionDecl* FD = dyn_cast<FunctionDecl>(D)) {
@@ -866,7 +866,7 @@
// FIXME: Does this need to be revised? We were getting cases in
// real code that did this.
SVal V = loc::FuncVal(FD);
- MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, V));
+ MakeNode(Dst, Ex, Pred, BindExpr(St, Ex, V));
return;
}
@@ -892,7 +892,7 @@
SVal V = StateMgr.GetLValue(St, GetSVal(St, Base), GetSVal(St, Idx));
if (asLValue)
- MakeNode(Dst, A, *I2, SetSVal(St, A, V));
+ MakeNode(Dst, A, *I2, BindExpr(St, A, V));
else
EvalLoad(Dst, A, *I2, St, V);
}
@@ -919,7 +919,7 @@
SVal L = StateMgr.GetLValue(St, GetSVal(St, Base), M->getMemberDecl());
if (asLValue)
- MakeNode(Dst, M, *I, SetSVal(St, M, L));
+ MakeNode(Dst, M, *I, BindExpr(St, M, L));
else
EvalLoad(Dst, M, *I, St, L);
}
@@ -981,11 +981,11 @@
MakeNode(Dst, Ex, Pred, St, K);
else if (location.isUnknown()) {
// This is important. We must nuke the old binding.
- MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, UnknownVal()), K);
+ MakeNode(Dst, Ex, Pred, BindExpr(St, Ex, UnknownVal()), K);
}
else
- MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, GetSVal(St, cast<Loc>(location),
- Ex->getType())), K);
+ MakeNode(Dst, Ex, Pred, BindExpr(St, Ex, GetSVal(St, cast<Loc>(location),
+ Ex->getType())), K);
}
void GRExprEngine::EvalStore(NodeSet& Dst, Expr* Ex, Expr* StoreE, NodeTy* Pred,
@@ -999,8 +999,8 @@
}
const GRState* GRExprEngine::EvalLocation(Expr* Ex, NodeTy* Pred,
- const GRState* St,
- SVal location, bool isLoad) {
+ const GRState* St,
+ SVal location, bool isLoad) {
// Check for loads/stores from/to undefined values.
if (location.isUndef()) {
@@ -1234,7 +1234,7 @@
// For __builtin_expect, just return the value of the subexpression.
assert (CE->arg_begin() != CE->arg_end());
SVal X = GetSVal(St, *(CE->arg_begin()));
- MakeNode(Dst, CE, *DI, SetSVal(St, CE, X));
+ MakeNode(Dst, CE, *DI, BindExpr(St, CE, X));
continue;
}
@@ -1299,7 +1299,7 @@
SVal location = StateMgr.GetLValue(St, Ex->getDecl(), BaseVal);
if (asLValue)
- MakeNode(Dst, Ex, *I, SetSVal(St, Ex, location));
+ MakeNode(Dst, Ex, *I, BindExpr(St, Ex, location));
else
EvalLoad(Dst, Ex, *I, St, location);
}
@@ -1512,7 +1512,7 @@
// Undefined?
if (V.isUndef()) {
- MakeNode(Dst, CastE, N, SetSVal(St, CastE, V));
+ MakeNode(Dst, CastE, N, BindExpr(St, CastE, V));
continue;
}
@@ -1521,7 +1521,7 @@
if (C.getCanonicalType(T).getUnqualifiedType() ==
C.getCanonicalType(ExTy).getUnqualifiedType()) {
- MakeNode(Dst, CastE, N, SetSVal(St, CastE, V));
+ MakeNode(Dst, CastE, N, BindExpr(St, CastE, V));
continue;
}
@@ -1534,7 +1534,7 @@
// If not, flag an error.
V = nonloc::LocAsInteger::Make(getBasicVals(), cast<Loc>(V), bits);
- MakeNode(Dst, CastE, N, SetSVal(St, CastE, V));
+ MakeNode(Dst, CastE, N, BindExpr(St, CastE, V));
continue;
}
@@ -1543,7 +1543,7 @@
if (nonloc::LocAsInteger *LV = dyn_cast<nonloc::LocAsInteger>(&V)) {
// Just unpackage the lval and return it.
V = LV->getLoc();
- MakeNode(Dst, CastE, N, SetSVal(St, CastE, V));
+ MakeNode(Dst, CastE, N, BindExpr(St, CastE, V));
continue;
}
@@ -1552,12 +1552,12 @@
assert(T->isPointerType() || T->isReferenceType());
V = StateMgr.ArrayToPointer(V);
- MakeNode(Dst, CastE, N, SetSVal(St, CastE, V));
+ MakeNode(Dst, CastE, N, BindExpr(St, CastE, V));
continue;
}
// All other cases.
- MakeNode(Dst, CastE, N, SetSVal(St, CastE, EvalCast(V, CastE->getType())));
+ MakeNode(Dst, CastE, N, BindExpr(St, CastE, EvalCast(V, CastE->getType())));
}
}
@@ -1586,7 +1586,7 @@
assert (!IVals.empty() && "Initializer cannot be empty.");
St = StateMgr.BindCompoundLiteral(St, R, &IVals[0], &IVals[0]+IVals.size());
- MakeNode(Dst, CL, *I, SetSVal(St, CL, loc::MemRegionVal(R)));
+ MakeNode(Dst, CL, *I, BindExpr(St, CL, loc::MemRegionVal(R)));
}
}
@@ -1653,7 +1653,7 @@
StateMgr.getBasicVals());
// Make final state and node.
- state = SetSVal(state, E, V);
+ state = BindExpr(state, E, V);
MakeNode(Dst, E, Pred, state);
return;
@@ -1672,7 +1672,7 @@
Visit(Init, Pred, Tmp);
for (NodeSet::iterator I = Tmp.begin(), EI = Tmp.end(); I != EI; ++I) {
state = GetState(*I);
- MakeNode(Dst, E, *I, SetSVal(state, E, GetSVal(state, Init)));
+ MakeNode(Dst, E, *I, BindExpr(state, E, GetSVal(state, Init)));
}
return;
}
@@ -1716,8 +1716,8 @@
amt = getContext().getTypeAlign(T) / 8;
MakeNode(Dst, Ex, Pred,
- SetSVal(GetState(Pred), Ex,
- NonLoc::MakeVal(getBasicVals(), amt, Ex->getType())));
+ BindExpr(GetState(Pred), Ex,
+ NonLoc::MakeVal(getBasicVals(), amt, Ex->getType())));
}
@@ -1741,7 +1741,7 @@
SVal location = GetSVal(St, Ex);
if (asLValue)
- MakeNode(Dst, U, *I, SetSVal(St, U, location));
+ MakeNode(Dst, U, *I, BindExpr(St, U, location));
else
EvalLoad(Dst, U, *I, St, location);
}
@@ -1767,7 +1767,7 @@
// For all other types, UnaryOperator::Real is an identity operation.
assert (U->getType() == Ex->getType());
const GRState* St = GetState(*I);
- MakeNode(Dst, U, *I, SetSVal(St, U, GetSVal(St, Ex)));
+ MakeNode(Dst, U, *I, BindExpr(St, U, GetSVal(St, Ex)));
}
return;
@@ -1791,7 +1791,7 @@
assert (Ex->getType()->isIntegerType());
const GRState* St = GetState(*I);
SVal X = NonLoc::MakeVal(getBasicVals(), 0, Ex->getType());
- MakeNode(Dst, U, *I, SetSVal(St, U, X));
+ MakeNode(Dst, U, *I, BindExpr(St, U, X));
}
return;
@@ -1816,7 +1816,7 @@
for (NodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
const GRState* St = GetState(*I);
- MakeNode(Dst, U, *I, SetSVal(St, U, GetSVal(St, Ex)));
+ MakeNode(Dst, U, *I, BindExpr(St, U, GetSVal(St, Ex)));
}
return;
@@ -1832,7 +1832,7 @@
for (NodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
const GRState* St = GetState(*I);
SVal V = GetSVal(St, Ex);
- St = SetSVal(St, U, V);
+ St = BindExpr(St, U, V);
MakeNode(Dst, U, *I, St);
}
@@ -1860,7 +1860,7 @@
// V = EvalCast(V, U->getType());
if (V.isUnknownOrUndef()) {
- MakeNode(Dst, U, *I, SetSVal(St, U, V));
+ MakeNode(Dst, U, *I, BindExpr(St, U, V));
continue;
}
@@ -1871,12 +1871,12 @@
case UnaryOperator::Not:
// FIXME: Do we need to handle promotions?
- St = SetSVal(St, U, EvalComplement(cast<NonLoc>(V)));
+ St = BindExpr(St, U, EvalComplement(cast<NonLoc>(V)));
break;
case UnaryOperator::Minus:
// FIXME: Do we need to handle promotions?
- St = SetSVal(St, U, EvalMinus(U, cast<NonLoc>(V)));
+ St = BindExpr(St, U, EvalMinus(U, cast<NonLoc>(V)));
break;
case UnaryOperator::LNot:
@@ -1889,7 +1889,7 @@
if (isa<Loc>(V)) {
loc::ConcreteInt X(getBasicVals().getZeroWithPtrWidth());
SVal Result = EvalBinOp(BinaryOperator::EQ, cast<Loc>(V), X);
- St = SetSVal(St, U, Result);
+ St = BindExpr(St, U, Result);
}
else {
nonloc::ConcreteInt X(getBasicVals().getValue(0, Ex->getType()));
@@ -1922,7 +1922,7 @@
uint64_t size = getContext().getTypeAlign(T) / 8;
const GRState* St = GetState(Pred);
- St = SetSVal(St, U, NonLoc::MakeVal(getBasicVals(), size, U->getType()));
+ St = BindExpr(St, U, NonLoc::MakeVal(getBasicVals(), size, U->getType()));
MakeNode(Dst, U, Pred, St);
return;
@@ -1939,7 +1939,7 @@
uint64_t size = getContext().getTypeSize(T) / 8;
const GRState* St = GetState(Pred);
- St = SetSVal(St, U, NonLoc::MakeVal(getBasicVals(), size, U->getType()));
+ St = BindExpr(St, U, NonLoc::MakeVal(getBasicVals(), size, U->getType()));
MakeNode(Dst, U, Pred, St);
return;
@@ -1969,7 +1969,7 @@
// Propagate unknown and undefined values.
if (V2.isUnknownOrUndef()) {
- MakeNode(Dst, U, *I2, SetSVal(St, U, V2));
+ MakeNode(Dst, U, *I2, BindExpr(St, U, V2));
continue;
}
@@ -1979,7 +1979,7 @@
: BinaryOperator::Sub;
SVal Result = EvalBinOp(Op, V2, MakeConstantVal(1U, U));
- St = SetSVal(St, U, U->isPostfix() ? V2 : Result);
+ St = BindExpr(St, U, U->isPostfix() ? V2 : Result);
// Perform the store.
EvalStore(Dst, U, *I2, St, V1, Result);
@@ -2031,7 +2031,7 @@
assert (!isa<NonLoc>(X)); // Should be an Lval, or unknown, undef.
if (isa<Loc>(X))
- St = SetSVal(St, cast<Loc>(X), UnknownVal());
+ St = BindLoc(St, cast<Loc>(X), UnknownVal());
}
MakeNode(Dst, A, Pred, St);
@@ -2214,7 +2214,7 @@
// Simulate the effects of a "store": bind the value of the RHS
// to the L-Value represented by the LHS.
- EvalStore(Dst, B, LHS, *I2, SetSVal(St, B, RightV), LeftV, RightV);
+ EvalStore(Dst, B, LHS, *I2, BindExpr(St, B, RightV), LeftV, RightV);
continue;
}
@@ -2265,7 +2265,7 @@
// Otherwise, create a new node.
- MakeNode(Dst, B, *I2, SetSVal(St, B, Result));
+ MakeNode(Dst, B, *I2, BindExpr(St, B, Result));
continue;
}
}
@@ -2305,13 +2305,13 @@
// Propagate undefined values (left-side).
if (V.isUndef()) {
- EvalStore(Dst, B, LHS, *I3, SetSVal(St, B, V), location, V);
+ EvalStore(Dst, B, LHS, *I3, BindExpr(St, B, V), location, V);
continue;
}
// Propagate unknown values (left and right-side).
if (RightV.isUnknown() || V.isUnknown()) {
- EvalStore(Dst, B, LHS, *I3, SetSVal(St, B, UnknownVal()), location,
+ EvalStore(Dst, B, LHS, *I3, BindExpr(St, B, UnknownVal()), location,
UnknownVal());
continue;
}
@@ -2331,7 +2331,7 @@
// Evaluate operands and promote to result type.
if (RightV.isUndef()) {
// Propagate undefined values (right-side).
- EvalStore(Dst, B, LHS, *I3, SetSVal(St, B, RightV), location, RightV);
+ EvalStore(Dst,B, LHS, *I3, BindExpr(St, B, RightV), location, RightV);
continue;
}
@@ -2364,7 +2364,7 @@
: cast<SVal>(nonloc::SymbolVal(Sym));
}
- EvalStore(Dst, B, LHS, *I3, SetSVal(St, B, Result), location, Result);
+ EvalStore(Dst, B, LHS, *I3, BindExpr(St, B, Result), location, Result);
}
}
}
Modified: cfe/trunk/lib/Analysis/GRSimpleVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.cpp?rev=58421&r1=58420&r2=58421&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Thu Oct 30 00:33:54 2008
@@ -370,9 +370,9 @@
SVal V = StateMgr.GetSVal(St, *I);
if (isa<loc::MemRegionVal>(V))
- St = StateMgr.SetSVal(St, cast<Loc>(V), UnknownVal());
+ St = StateMgr.BindLoc(St, cast<Loc>(V), UnknownVal());
else if (isa<nonloc::LocAsInteger>(V))
- St = StateMgr.SetSVal(St, cast<nonloc::LocAsInteger>(V).getLoc(),
+ St = StateMgr.BindLoc(St, cast<nonloc::LocAsInteger>(V).getLoc(),
UnknownVal());
}
@@ -389,7 +389,7 @@
? cast<SVal>(loc::SymbolVal(Sym))
: cast<SVal>(nonloc::SymbolVal(Sym));
- St = StateMgr.SetSVal(St, CE, X, Eng.getCFG().isBlkExpr(CE), false);
+ St = StateMgr.BindExpr(St, CE, X, Eng.getCFG().isBlkExpr(CE), false);
}
Builder.MakeNode(Dst, CE, Pred, St);
@@ -418,7 +418,7 @@
SVal V = StateMgr.GetSVal(St, *I);
if (isa<Loc>(V))
- St = StateMgr.SetSVal(St, cast<Loc>(V), UnknownVal());
+ St = StateMgr.BindLoc(St, cast<Loc>(V), UnknownVal());
}
Builder.MakeNode(Dst, ME, Pred, St);
Modified: cfe/trunk/lib/Analysis/GRState.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRState.cpp?rev=58421&r1=58420&r2=58421&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRState.cpp (original)
+++ cfe/trunk/lib/Analysis/GRState.cpp Thu Oct 30 00:33:54 2008
@@ -59,8 +59,7 @@
LSymbols, DSymbols);
}
-const GRState* GRStateManager::SetSVal(const GRState* St, Loc LV,
- SVal V) {
+const GRState* GRStateManager::BindLoc(const GRState* St, Loc LV, SVal V) {
Store OldStore = St->getStore();
Store NewStore = StoreMgr->Bind(OldStore, LV, V);
Modified: cfe/trunk/lib/Analysis/GRTransferFuncs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRTransferFuncs.cpp?rev=58421&r1=58420&r2=58421&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRTransferFuncs.cpp (original)
+++ cfe/trunk/lib/Analysis/GRTransferFuncs.cpp Thu Oct 30 00:33:54 2008
@@ -35,7 +35,7 @@
Builder.MakeNode(Dst, E, Pred, St);
else
Builder.MakeNode(Dst, E, Pred,
- Eng.getStateManager().SetSVal(St, cast<Loc>(TargetLV), Val));
+ Eng.getStateManager().BindLoc(St, cast<Loc>(TargetLV), Val));
}
void GRTransferFuncs::EvalBinOpNN(GRStateSet& OStates,
@@ -44,5 +44,5 @@
BinaryOperator::Opcode Op,
NonLoc L, NonLoc R) {
- OStates.Add(StateMgr.SetSVal(St, Ex, DetermEvalBinOpNN(StateMgr, Op, L, R)));
+ OStates.Add(StateMgr.BindExpr(St, Ex, DetermEvalBinOpNN(StateMgr, Op, L, R)));
}
More information about the cfe-commits
mailing list