如何创建非插件 LLVM 通行证?

发布于 2024-12-04 05:25:23 字数 373 浏览 1 评论 0原文

我已经在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

友欢 2024-12-11 05:25:23

只需将您的通行证链接到 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.

断爱 2024-12-11 05:25:23

基本上,您只需将源代码复制到 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文