Alex Rivera | Logout

Find arguments of a function in LLVM IR

Asked 2012-02-10T09:11:43.273
11

Please suggest me method to find declaration of an Argument passed to a Function in llvm IR.

Edit
Report

1 Answer

18

You can use Function::getArgumentList() method to get a list of function's arguments. Then, you traverse it with iterators - ArgumentListType::begin() and ArgumentListType::end().

See class Function documentation - http://llvm.org/doxygen/classllvm_1_1Function.html

UPD:

The current way of iterating over arguments is arg_begin()/arg_end()/args() methods.

answered 2012-02-10T13:08:54.730

Your Answer