Added boilerplate for plug-in transfer function support for CallExprs.
GRSimpleVals performs the following action: invalidate all values passed-by-reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47638 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/GRSimpleVals.cpp b/Analysis/GRSimpleVals.cpp
index 549aa0b..4d9dccf 100644
--- a/Analysis/GRSimpleVals.cpp
+++ b/Analysis/GRSimpleVals.cpp
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "GRSimpleVals.h"
+#include "ValueState.h"
 #include "clang/Basic/Diagnostic.h"
 
 using namespace clang;
@@ -329,3 +330,27 @@
   
   return NonLVal::MakeIntTruthVal(ValMgr, true);
 }
+
+//===----------------------------------------------------------------------===//
+// Transfer function for Function Calls.
+//===----------------------------------------------------------------------===//
+
+ValueStateImpl*
+GRSimpleVals::EvalCall(ValueStateManager& StateMgr, ValueManager& ValMgr,
+                           CallExpr* CE, LVal L, ValueStateImpl* StImpl) {
+  
+  ValueState St(StImpl);
+  
+  // Invalidate all arguments passed in by reference (LVals).
+
+  for (CallExpr::arg_iterator I = CE->arg_begin(), E = CE->arg_end();
+        I != E; ++I) {
+
+    RVal V = StateMgr.GetRVal(St, *I);
+    
+    if (isa<LVal>(V))
+      St = StateMgr.SetRVal(St, cast<LVal>(V), UnknownVal());
+  }
+  
+  return St.getImpl();
+}
diff --git a/Analysis/GRSimpleVals.h b/Analysis/GRSimpleVals.h
index 870166e..10d4acd 100644
--- a/Analysis/GRSimpleVals.h
+++ b/Analysis/GRSimpleVals.h
@@ -50,6 +50,13 @@
   virtual RVal EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
                          LVal L, NonLVal R);  
   
+  // Calls.
+  
+  virtual ValueStateImpl* EvalCall(ValueStateManager& StateMgr,
+                                   ValueManager& ValMgr,
+                                   CallExpr* CE, LVal L,
+                                   ValueStateImpl* StImpl);
+  
 protected:
   
   // Equality operators for LVals.