summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRSimpleVals.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-15 23:06:53 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-15 23:06:53 +0000
commit667cacb2ff2c25ce786488623620d9894aeb965c (patch)
treef220710bcbe6c30303fae2c1eaf12612f8bcff8c /clang/lib/Analysis/GRSimpleVals.cpp
parent32b1537cc2eca732f6da8af7fb11666c902d0708 (diff)
downloadbcm5719-llvm-667cacb2ff2c25ce786488623620d9894aeb965c.tar.gz
bcm5719-llvm-667cacb2ff2c25ce786488623620d9894aeb965c.zip
Added some comments to GRExprEngine. Reorder some of the method definitions
to start logically organizing them. Added initial plug-in transfer function support for Objective-C message expressions. llvm-svn: 49752
Diffstat (limited to 'clang/lib/Analysis/GRSimpleVals.cpp')
-rw-r--r--clang/lib/Analysis/GRSimpleVals.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/clang/lib/Analysis/GRSimpleVals.cpp b/clang/lib/Analysis/GRSimpleVals.cpp
index dabae43523c..c8805ab7757 100644
--- a/clang/lib/Analysis/GRSimpleVals.cpp
+++ b/clang/lib/Analysis/GRSimpleVals.cpp
@@ -552,7 +552,7 @@ RVal GRSimpleVals::EvalNE(GRExprEngine& Eng, LVal L, LVal R) {
}
//===----------------------------------------------------------------------===//
-// Transfer function for Function Calls.
+// Transfer function for function calls.
//===----------------------------------------------------------------------===//
void GRSimpleVals::EvalCall(ExplodedNodeSet<ValueState>& Dst,
@@ -590,3 +590,32 @@ void GRSimpleVals::EvalCall(ExplodedNodeSet<ValueState>& Dst,
Builder.MakeNode(Dst, CE, Pred, St);
}
+
+//===----------------------------------------------------------------------===//
+// Transfer function for Objective-C message expressions.
+//===----------------------------------------------------------------------===//
+
+void GRSimpleVals::EvalObjCMessageExpr(ExplodedNodeSet<ValueState>& Dst,
+ GRExprEngine& Eng,
+ GRStmtNodeBuilder<ValueState>& Builder,
+ ObjCMessageExpr* ME,
+ ExplodedNode<ValueState>* Pred) {
+
+
+ // The basic transfer function logic for message expressions does nothing.
+ // We just invalidate all arguments passed in by references.
+
+ ValueStateManager& StateMgr = Eng.getStateManager();
+ ValueState* St = Builder.GetState(Pred);
+
+ for (ObjCMessageExpr::arg_iterator I = ME->arg_begin(), E = ME->arg_end();
+ I != E; ++I) {
+
+ RVal V = StateMgr.GetRVal(St, *I);
+
+ if (isa<LVal>(V))
+ St = StateMgr.SetRVal(St, cast<LVal>(V), UnknownVal());
+ }
+
+ Builder.MakeNode(Dst, ME, Pred, St);
+}
OpenPOWER on IntegriCloud