I’m writing a CallGraphSCCPass which needs dominator tree information on each function. My getAnalysisUsage is fairly straightforward:
virtual void getAnalysisUsage(AnalysisUsage& au) const override
The pass is registered like this:
char MyPass::ID = 0;
static RegisterPass tmp(“My Pass”, “Do fancy analysis”, true, true);
INITIALIZE_PASS_BEGIN(MyPass, “My Pass”, “Do fancy analysis”, true, true)
INITIALIZE_PASS_END(MyPass, “My Pass”, “Do fancy analysis”, true, true)
When I try to add my pass to a legacy::PassManager, it dies with this error message:
Unable to schedule ‘Dominator Tree Construction’ required by ‘My Pass’
Unable to schedule pass
UNREACHABLE executed at LegacyPassManager.cpp:1264!
I statically link LLVM to my program, and define the pass in my program, too.
Am I doing something wrong? Does it make sense to require the DominatorTreeWrapperPass from a CallGraphSCCPass?