Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find arguments of a function in LLVM IR

Tags:

llvm

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

like image 941
shashikiran Avatar asked Feb 10 '12 09:02

shashikiran


1 Answers

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.

like image 114
arrowd Avatar answered Sep 28 '22 06:09

arrowd