<div dir="ltr">Problem solved. The problem is that I cannot call getAnalysis inside the pass constructor.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 3 March 2013 17:28, Izabela Maffra <span dir="ltr"><<a href="mailto:izabelakarennina@gmail.com" target="_blank">izabelakarennina@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Dear LLVMers,<br><br></div>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:<br>
<br> struct MyPass : public FunctionPass {<br>
static char ID;<br> MyPass() : FunctionPass(ID) {<br> PADriver &PD = getAnalysis<AModulePass>();<br><br>...<br> virtual void getAnalysisUsage(AnalysisUsage &AU) const{<br> AU.setPreservesAll();<br>
AU.addRequired<AModulePass>();<br> }<br><br></div>But when I try to run my pass, I get the following error at the point os getAnalysis:<br><br> Assertion `Resolver && "Pass has not been inserted into a PassManager object!"' failed.<br>
<br><br></div>Did I do anything I should not or did I miss something?<br><br></div>Regards,<span class="HOEnZb"><font color="#888888"><br clear="all"><div><div><div><div><div><br>-- <br>Izabela Maffra.<br><br><i>Ciência da Computação<span></span><br>
Universidade Federal de Minas Gerais<br>
(31) 8615-3077</i><br><br>“Don't count the days, make the days count.”
― Muhammad Ali<br>
</div></div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>Izabela Maffra.<br><br><i>Ciência da Computação<span></span><br>Universidade Federal de Minas Gerais<br>(31) 8615-3077</i><br><br>“Don't count the days, make the days count.”
― Muhammad Ali<br>
</div>