Find function arguments in LLVM IR

Please suggest me a method to find the declaration of the argument passed to the function in llvm IR.

+4
source share
1 answer

You can use the Function::getArgumentList() method to get a list of function arguments. Then you move it using iterators - ArgumentListType::begin() and ArgumentListType::end() .

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

UPD:

The current way to iterate over arguments is with the arg_begin() / arg_end() / args() methods.

+8
source

Source: https://habr.com/ru/post/1395736/


All Articles