Change Name of LLVM Function

荒凉一梦 提交于 2019-12-02 07:27:18

问题


I have a LLVM Module object which contains a particular function that I would like to rename. Is there any way of simply changing the name of a Function?


回答1:


Given a module, you can look up a specific function by name using the getFunction method, or you can iterate over all the functions in the module using begin() and end(). From there, Function inherits from Value, so you can just use the setName method change the name. This will also automatically update all the references and calls to it inside the same module.



来源:https://stackoverflow.com/questions/30990032/change-name-of-llvm-function

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!