[cfe-commits] r49801 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRExprEngine.h lib/Analysis/GRExprEngine.cpp
Ted Kremenek
kremenek at apple.com
Wed Apr 16 11:21:25 PDT 2008
Author: kremenek
Date: Wed Apr 16 13:21:25 2008
New Revision: 49801
URL: http://llvm.org/viewvc/llvm-project?rev=49801&view=rev
Log:
Take first step to migrating handling of "stores" to values from GRExprEngine
to the plug-in GRTransferFuncs object.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
cfe/trunk/lib/Analysis/GRExprEngine.cpp
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=49801&r1=49800&r2=49801&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Wed Apr 16 13:21:25 2008
@@ -602,6 +602,13 @@
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
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=49801&r1=49800&r2=49801&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Apr 16 13:21:25 2008
@@ -1637,8 +1637,11 @@
// 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 @@
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;
}
}
More information about the cfe-commits
mailing list