[LLVMdev] Conflicting passes?

Andrew Lenharth alenhar2 at cs.uiuc.edu
Tue May 2 21:42:22 PDT 2006


On Tue, 2006-05-02 at 20:55 -0500, Domagoj D wrote:
> Hi all,
> 
> Why are these two passes conflicting: UnifyFunctionExitNodes and LowerSwitch?

They do not, sort of.

> AU.addRequired(LowerSwitchID) works, so does AU.addRequired<unifyFunctionExitNodes>(), 
> but the two together don't... 
> 
> opt: PassManagerT.h:387: void llvm::PassManagerT<Trait>::markPassUsed(const llvm::PassInfo*, llvm::Pass*) [with Trait = llvm::MTraits]: Assertion `getAnalysisOrNullUp(P) && dynamic_cast<ImmutablePass*>(getAnalysisOrNullUp(P)) && "Pass available but not found! " "Perhaps this is a module pass requiring a function pass?"' failed.
> opt((anonymous namespace)::PrintStackTrace()+0x18)[0x8706558]
> opt((anonymous namespace)::SignalHandler(int)+0xfe)[0x87067e0]
> and so on...

See:

http://llvm.org/docs/WritingAnLLVMPass.html#PassFunctionPass

This should really be in the FAQ.  But sufice to say if you make your pass a function pass, you will be fine.

Andrew




More information about the llvm-dev mailing list