[llvm-dev] Add a pass to opt

Volkan Keles via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 26 15:54:02 PDT 2015

Hi Xiaochu,

There is one more step. You need to call initializeYourPassNamePass
function in opt.cpp.


On Mon, Oct 26, 2015 at 3:12 PM Xiaochu Liu via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Dear there,
> What I was trying to do is to create my own library in lib/Transform
> folder and compile it into an LLVM library. And use opt to invoke that
> the pass in my library by:
> opt -mypass <*.bc>
> I copied the CMakeList and LLVMBuild from lib/Transform/ObjCARC.
> I managed to add my pass in LinkAllPasses.h and InitializePasses.h and
> compiled successfully.
> However, opt does not recognize my pass (-help does not list it at all).
> Can anyone point me a possible way to add a built-in pass for opt?
> Thanks,
> Xiaochu
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151026/778076d4/attachment.html>

More information about the llvm-dev mailing list