I wrote my own in-tree LLVM pass using the new pass manager. I am now trying to run a sequence of other passes from within my pass before my pass goes on to do other things. My code that tries to run other passes looks something like this:
static void runPasses(Function &F) {
FunctionPassManager FPM;
FunctionAnalysisManager FAM;
FPM.addPass(InstCombinePass());
FPM.run(F, FAM);
}
Building llvm leads to these linker errors:
/usr/git/llvm-fork/llvm/include/llvm/IR/PassManagerInternal.h:89: error: undefined reference to 'llvm::InstCombinePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)'
/usr/git/llvm-fork/llvm/lib/Transforms/Utils/MyOwnPass.cpp:667: error: undefined reference to 'llvm::InstCombinePass::InstCombinePass()'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Are there any existing examples or documentation that I can take a look at to understand how to run other passes from within my own pass?