我需要告诉pass查找文件中的特定函数。我想指定在运行过程中,即运行pass时要注意哪个函数。你知道我怎么做吗?这有点像在理论上把参数传递给函数。
使用添加命令行选项 cl::opt<string> 并在传球时设置。
cl::opt<string>
或者,如果您使用clang从C或C++生成IR,您可以利用 __attribute((__annotate__(("foo")))) 标记您感兴趣的函数。
__attribute((__annotate__(("foo"))))