llvm-将参数传递给传递 [英] llvm - Pass arguments to a pass
本文介绍了llvm-将参数传递给传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要告诉通行证在文件中查找特定功能.我想指定要在旅途中寻找的功能,即运行通行证时.知道我该怎么做吗?这有点像理论上向函数传递参数.
I need to tell the pass to look out for a specific function in the file. And I want to specify which function to look out for 'on the go' i.e when I run the pass. Any idea how I can do that? It's sort of like passing arguments to a function in theory.
推荐答案
使用 cl :: opt< string>
添加命令行选项,并在运行密码时进行设置.
Add a command line option using cl::opt<string>
and set it when running your pass.
或者,如果要使用clang从C或C ++生成IR,则可以使用 __ attribute((__ annotate __(("foo"))))
来标记您感兴趣的函数.
Alternatively, if you are producing an IR from C or C++ using clang, you can utilize __attribute((__annotate__(("foo"))))
to mark functions you are interested in.
这篇关于llvm-将参数传递给传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文