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

Izabela Maffra izabelakarennina at gmail.com
Sun Mar 3 12:28:13 PST 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130303/d477324b/attachment.html>


More information about the llvm-dev mailing list