[LLVMdev] Can a Function Pass require a Module Pass?

Izabela Maffra izabelakarennina at gmail.com
Sun Mar 3 13:45:43 PST 2013


Problem solved. The problem is that I cannot call getAnalysis inside the
pass constructor.


On 3 March 2013 17:28, Izabela Maffra <izabelakarennina at gmail.com> wrote:

> Dear LLVMers,
>
> I am implementing a Function Pass and I would like to use analysis
> obtained from a Module Pass. Some extracts of my code look like that:
>
>     struct MyPass : public FunctionPass {
>         static char ID;
>         MyPass() : FunctionPass(ID) {
>             PADriver &PD = getAnalysis<AModulePass>();
>
> ...
>         virtual void getAnalysisUsage(AnalysisUsage &AU) const{
>             AU.setPreservesAll();
>             AU.addRequired<AModulePass>();
>         }
>
> But when I try to run my pass, I get the following error at the point os
> getAnalysis:
>
>  Assertion `Resolver && "Pass has not been inserted into a PassManager
> object!"' failed.
>
>
> Did I do anything I should not or did I miss something?
>
> Regards,
>
> --
> Izabela Maffra.
>
> *Ciência da Computação
> Universidade Federal de Minas Gerais
> (31) 8615-3077*
>
> "Don't count the days, make the days count." -- Muhammad Ali
>



-- 
Izabela Maffra.

*Ciência da Computação
Universidade Federal de Minas Gerais
(31) 8615-3077*

"Don't count the days, make the days count." -- Muhammad Ali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130303/ed02fb48/attachment.html>


More information about the llvm-dev mailing list