[cfe-commits] r46477 - /cfe/trunk/Analysis/GRConstants.cpp

Ted Kremenek kremenek at apple.com
Mon Jan 28 16:43:03 PST 2008


Author: kremenek
Date: Mon Jan 28 18:43:03 2008
New Revision: 46477

URL: http://llvm.org/viewvc/llvm-project?rev=46477&view=rev
Log:
Added skeleton code for tracking the values of function parameters.

Modified:
    cfe/trunk/Analysis/GRConstants.cpp

Modified: cfe/trunk/Analysis/GRConstants.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/GRConstants.cpp?rev=46477&r1=46476&r2=46477&view=diff

==============================================================================
--- cfe/trunk/Analysis/GRConstants.cpp (original)
+++ cfe/trunk/Analysis/GRConstants.cpp Mon Jan 28 18:43:03 2008
@@ -619,6 +619,22 @@
   ///  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;
   }
 





More information about the cfe-commits mailing list