using llvm::cast;
using llvm::APSInt;
+ValueState* GRExprEngine::RemoveDeadBindings(ValueState* St) {
+
+ if (StateCleaned || !CurrentStmt)
+ return St;
+
+ StateCleaned = true;
+
+ return StateMgr.RemoveDeadBindings(St, CurrentStmt, Liveness);
+}
+
+
ValueState* GRExprEngine::getInitialState() {
// The LiveVariables information already has a compilation of all VarDecls
ValueState* GRExprEngine::SetRVal(ValueState* St, Expr* Ex, RVal V) {
- if (!StateCleaned) {
- St = RemoveDeadBindings(CurrentStmt, St);
- StateCleaned = true;
- }
+ St = RemoveDeadBindings(St);
bool isBlkExpr = false;
}
ValueState* GRExprEngine::SetRVal(ValueState* St, LVal LV, RVal RV) {
-
- if (!StateCleaned) {
- St = RemoveDeadBindings(CurrentStmt, St);
- StateCleaned = true;
- }
-
+ St = RemoveDeadBindings(St);
return StateMgr.SetRVal(St, LV, RV);
}
ValueState* GRExprEngine::SetBlkExprRVal(ValueState* St, Expr* Ex, RVal V) {
-
- if (CurrentStmt && !StateCleaned) {
- St = RemoveDeadBindings(CurrentStmt, St);
- StateCleaned = true;
- }
-
+ St = RemoveDeadBindings(St);
return StateMgr.SetRVal(St, Ex, V, true, false);
}
if (Dst.size() == 1 && *Dst.begin() == StmtEntryNode) {
ValueState* St =
StateCleaned ? StmtEntryNode->getState() :
- RemoveDeadBindings(S, StmtEntryNode->getState());
+ RemoveDeadBindings(StmtEntryNode->getState());
builder.generateNode(S, St, StmtEntryNode);
}
/// RemoveDeadBindings - Return a new state that is the same as 'St' except
/// that all subexpression mappings are removed and that any
- /// block-level expressions that are not live at 'S' also have their
- /// mappings removed.
- inline ValueState* RemoveDeadBindings(Stmt* S, ValueState* St) {
- return StateMgr.RemoveDeadBindings(St, S, Liveness);
- }
+ /// block-level expressions that are not live at 'CurrentStmt' also have
+ /// their mappings removed.
+ ValueState* RemoveDeadBindings(ValueState* St);
ValueState* SetRVal(ValueState* St, Expr* Ex, RVal V);