I have built LLVM/Clang under Linux, and followed the instructions at http://llvm.org/docs/WritingAnLLVMPass.html to create an LLVM shared object pass plugin. The plugin can then be loaded using LLVM's opt
program and the -load
switch. Based on the LLVMHello and LLVMHello2 examples, I have now created a pass of my own.
Is a plugin the only method I can use to incorporate a pass into LLVM/Clang? I would like to build my pass directly in to the LLVM/Clang source, but I'm not sure where to begin.