在LLVM IR中查找函数的参数

时间:2012-02-10 09:11:43

标签: llvm

请建议我找一个传递给llvm IR中函数的参数声明的方法。

1 个答案:

答案 0 :(得分:11)

您可以使用Function::getArgumentList()方法获取函数参数的列表。然后,使用迭代器遍历它 - ArgumentListType::begin()ArgumentListType::end()

请参阅class Function文档 - http://llvm.org/doxygen/classllvm_1_1Function.html

<强> UPD:

当前迭代参数的方法是arg_begin() / arg_end() / args()方法。