[LLVMdev] Find function parameters

Victor Campos vhscampos at gmail.com
Sun Mar 30 11:14:04 PDT 2014


Hi,

you can iterate over a function's formal parameters via
Function::arg_iterator.

Regards,
Victor.


On Sun, Mar 30, 2014 at 12:33 PM, lucefe <noviceup at gmail.com> wrote:

> Hi,
>
> For each variable, I want to figure out whether it is a parameter or not.
> How should I do that?
>
> For example, in the next function, I want to know that variable 'i' is a
> parameter, and 'var' is a variable.
>
> int test (int i) {
>      int var;
>
>      var = 2*i;
>
>      return var;
> }
>
> Thanks in advance.
>
> lucefe
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140330/bda2b731/attachment.html>


More information about the llvm-dev mailing list