From: Ted Kremenek Date: Tue, 29 Jan 2008 00:43:03 +0000 (+0000) Subject: Added skeleton code for tracking the values of function parameters. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff6e3c596e38328447461894cb8fd3ae22f499c4;p=clang Added skeleton code for tracking the values of function parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46477 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Analysis/GRConstants.cpp b/Analysis/GRConstants.cpp index f003007f65..a0a58db79a 100644 --- a/Analysis/GRConstants.cpp +++ b/Analysis/GRConstants.cpp @@ -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; }