如何创建非插件 LLVM 通行证?
我已经在 Linux 下构建了 LLVM/Clang,并按照 http://llvm.org/docs/WritingAnLLVMPass 中的说明进行操作.html 创建 LLVM 共享对象传递插件。然后可以使用 LLVM 的 opt
程序和 -load
开关加载该插件。基于 LLVMHello 和 LLVMHello2 示例,我现在创建了自己的 pass。
插件是我可以用来将 pass 合并到 LLVM/Clang 中的唯一方法吗?我想将我的通行证直接构建到 LLVM/Clang 源中,但我不知道从哪里开始。
I have built LLVM/Clang under Linux, and followed the instructions at http://llvm.org/docs/WritingAnLLVMPass.html to create an LLVM shared object pass plugin. The plugin can then be loaded using LLVM's opt
program and the -load
switch. Based on the LLVMHello and LLVMHello2 examples, I have now created a pass of my own.
Is a plugin the only method I can use to incorporate a pass into LLVM/Clang? I would like to build my pass directly in to the LLVM/Clang source, but I'm not sure where to begin.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需将您的通行证链接到 opt 即可在那里使用。所有标准通道都位于 lib/Transforms/* 中,因此您可以将它们用作示例。
Just link your pass to opt and it will be available there. All standard passes are in lib/Transforms/*, so you can use them as examples.
基本上,您只需将源代码复制到 lib/Transforms/ 并调整构建系统文件即可。
以下是有关如何使用 CMake 执行此操作的信息:http://llvm.org/docs/CMake。 html#passdev
Basically, you can just copy your source into lib/Transforms/ and adjust build system files.
Here is info on how to do it with CMake: http://llvm.org/docs/CMake.html#passdev