shashikiran
shashikiran

Reputation: 379

Find arguments of a function in LLVM IR

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

Upvotes: 11

Views: 12820

Answers (1)

arrowd
arrowd

Reputation: 34411

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.

Upvotes: 18

Related Questions