[llvm-dev] llvm pass
Kihong Heo via llvm-dev
llvm-dev at lists.llvm.org
Sat May 25 00:30:33 PDT 2019
I have several questions about LLVM pass.
1) Is building a custom LLVM pass out-of-source not recommended?
The official document only contains instructions about in-source build (http://llvm.org/docs/WritingAnLLVMPass.html <http://llvm.org/docs/WritingAnLLVMPass.html>).
2) opt (ver >= 4) with custom pass libraries does not work as before. When I have a simple custom LLVM pass called “helloworld", loading the library works well with 3.9 but opt-4.0 cannot not find the pass:
$ opt-3.9 -load ../build/hello/LLVMHelloWorld.so -helloworld hello.bc -S > /dev/null
$ opt-4.0 -load ../build/hello/LLVMHelloWorld.so -helloworld hello.bc -S > /dev/null
opt-4.0: Unknown command line argument '-helloworld'. Try: 'opt-4.0 -help'
opt-4.0: Did you mean '-loops’?
3) I tried to invoke custom LLVM passes from clang rather than opt. I followed instructions from several articles like
and registered the pass to clang’s workflow with legacy pass manger. But it raises segmentation fault errors.
What is a recommended way to register custom passes to clang directly?
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev