[LLVMdev] Fwd: LLVM Help

Dan Liew dan at su-root.co.uk
Fri Nov 7 22:33:19 PST 2014


> It ought to be possible to compile your own pass to a .so file and
> load it into opt dynamically. There's some kind of documentation at
> http://llvm.org/docs/CMake.html#cmake-out-of-source-pass, but I've not
> done it before so I don't know how reliable it is.

It is indeed possible. I have a simple example of doing this for the "hello
pass" in [1] in the "helloPass" folder. In the same directory it also shows
how to load the pass as a clang plug-in and have it run automatically. This
built fine against LLVM3.5 but I've not tested if this builds against trunk.

[1] https://github.com/delcypher/srg-llvm-pass-tutorial/

HTH,
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141108/efe15624/attachment.html>


More information about the llvm-dev mailing list