]> granicus.if.org Git - clang/commitdiff
Added skeleton code for tracking the values of function parameters.
authorTed Kremenek <kremenek@apple.com>
Tue, 29 Jan 2008 00:43:03 +0000 (00:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 29 Jan 2008 00:43:03 +0000 (00:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46477 91177308-0d34-0410-b5e6-96231b3b80d8

Analysis/GRConstants.cpp

index f003007f6543207076bbf617af6bd977347b10d8..a0a58db79a25aac3976a812fa6113ba5a677436a 100644 (file)
@@ -619,6 +619,22 @@ public:
   ///  in the ExplodedGraph.
   StateTy getInitialState() {
     StateTy St = StateMgr.GetEmptyMap();
+    
+    // Iterate the parameters.
+    FunctionDecl& F = G.getFunctionDecl();
+    
+    for (FunctionDecl::param_iterator I=F.param_begin(), E=F.param_end(); 
+          I!=E; ++I) {
+
+      // For now we only support symbolic values for non-pointer types.
+      if ((*I)->getType()->isPointerType() || 
+          (*I)->getType()->isReferenceType())
+        continue;
+      
+      // FIXME: Set these values to a symbol, not Uninitialized.
+      St = SetValue(St, LValueDecl(*I), UninitializedValue());
+    }
+    
     return St;
   }