<br>hi again :)<br><br><div class="gmail_quote">On Tue, Apr 13, 2010 at 8:57 AM, ether zhhb <span dir="ltr"><<a href="mailto:etherzhhb@gmail.com">etherzhhb@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
hi john,<br><br>thanks very much, i will try it out.<br><br>--best regards<br><font color="#888888">ether</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Mon, Apr 12, 2010 at 10:03 PM, John Criswell <span dir="ltr"><<a href="mailto:criswell@uiuc.edu" target="_blank">criswell@uiuc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div>ether zhhb wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
hi all,<br>
<br>
i have some thing not so sure about "scope" of llvm passes:<br>
<br>
suppose i have a function pass PassF and a BasicBlock analysis pass PassB. if i want to use the analysis result of PassB for a BasicBlock in PassF, i think i can create PassB in runOnFunction of PassF, and call runOnBasicBlock manually to get the result:<br>
<br>
PassB pb; //create a PassB<br>
//we also need consider the analysis usage of PassB<br>
pb.runOnBasicBlock(bb); // run PassB on bb manually<br>
.... use the result of pb ......<br>
<br>
is there any other better way?<br>
</blockquote>
<br></div></div>
I think the correct way to do this is to declare PassB as a prerequisite pass in PassF's getAnalysisUsage() method and then to use getAnalysis<PassB>(BasicBlock * BB) in PassF.<br>
<br>
A ModulePass can use a FunctionPass, so I assume a FunctionPass can use a BasicBlockPass in this fashion.<br></blockquote></div></div></div></blockquote><div>that's because FunctionPass implement the "addLowerLevelRequiredPass" function, but others not.<br>
<br>so, is there any special reason that only "addLowerLevelRequiredPass" is allow?<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="h5"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
-- John T.</blockquote></div></div></div></blockquote><div> </div>--best regards<br>ether<br><div> </div></div><br>