[llvm-dev] Add a pass to opt

Xiaochu Liu via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 26 15:12:34 PDT 2015

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?


More information about the llvm-dev mailing list