我有动态库 - LLVM passes 的集合。我想省略调用
opt
调用并使用 clang。研究了How to automatically register and load modern Pass in Clang?,我找到了加载插件的标志,但不清楚如何提供通行证列表:尝试使用以下命令将-passes=
标志传递给LLVM接口
clang -O0 -fpass-plugin=mylib.dylib -mllvm -passes=mypass sourcefile.cpp
但它返回
Unknown command line argument '-passes=mypass'
.
Running
clang --help-hidden
显示了据称熟悉的标志 -foptimization-record-passes=<regex>
,但它也没有执行 pass。 clang -mllvm --help
的检查列表显示了另一个奇特的选项。但是列表中没有-passes
选项。
--print-pipeline-passes Print a '-passes' compatible string describing the pipeline (best-effort only)
我想知道,是否有可能由编译器运行具体的传递以及这样做的方式。
截至 2022 年 8 月他们说方法是添加
-Xclang -load -Xclang mylib.dylib
.