[LLVMdev] Assertion `ResultPass && "getAnalysis*() called on an analysis that was not " "'required' by pass!"' failed.

Nick Johnson npjohnso at cs.princeton.edu
Thu Apr 30 13:27:16 PDT 2009


Hello,

I have two passes, A and B.  A is a function pass.  B is a module
pass.  Each uses their getAnalysisUsage() method to .addRequired()
several passes, and each .setPreserveAll()s.  **Pass B requires pass
A**.  But, when I call getAnalysis<A> from within B, it exclaims:

 Assertion `ResultPass && "getAnalysis*() called on an analysis that
was not " "'required' by pass!"' failed.

Clearly, that is nonsense, because I require that pass.

Under what circumstances can this happen, and why?
-- 
Nick Johnson



More information about the llvm-dev mailing list