Take first step to migrating handling of "stores" to values from GRExprEngine

to the plug-in GRTransferFuncs object.

llvm-svn: 49801
This commit is contained in:
Ted Kremenek 2008-04-16 18:21:25 +00:00
parent 8dc8a8d8af
commit 2044a5183d
2 changed files with 15 additions and 3 deletions

View File

@ -602,6 +602,13 @@ protected:
TF->EvalObjCMessageExpr(Dst, *this, *Builder, ME, Pred);
}
void EvalStore(NodeSet& Dst, Expr* E, NodeTy* Pred, ValueState* St,
LVal TargetLV, RVal Val) {
assert (Builder && "GRStmtNodeBuilder must be defined.");
MakeNode(Dst, E, Pred, SetRVal(St, TargetLV, Val));
}
ValueState* MarkBranch(ValueState* St, Stmt* Terminator, bool branchTaken);
};
} // end clang namespace

View File

@ -1637,8 +1637,11 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
// Simulate the effects of a "store": bind the value of the RHS
// to the L-Value represented by the LHS.
St = SetRVal(SetRVal(St, B, RightV), cast<LVal>(LeftV), RightV);
break;
EvalStore(Dst, B, N2, SetRVal(St, B, RightV),
cast<LVal>(LeftV), RightV);
// St = SetRVal(SetRVal(St, B, RightV), cast<LVal>(LeftV), RightV);
continue;
}
// Compound assignment operators.
@ -1784,7 +1787,9 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
continue;
}
St = SetRVal(SetRVal(St, B, Result), LeftLV, Result);
// St = SetRVal(SetRVal(St, B, Result), LeftLV, Result);
EvalStore(Dst, B, N2, SetRVal(St, B, Result), LeftLV, Result);
continue;
}
}