<div dir="ltr">Hi,<div><br></div><div>Thank you for your answer.</div><div>But let me get it straight, when i compile code with the llvm compiler, and my basic block pass is being processed, other passes are concurrently being processed ?</div>
<div><br></div><div>Thanks. </div><div><br><div class="gmail_quote">On Sat, May 23, 2009 at 7:01 PM, John Criswell <span dir="ltr"><<a href="mailto:criswell@cs.uiuc.edu">criswell@cs.uiuc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Rotem Varon wrote:<br>
> Hi,<br>
><br>
> Is there an API for getting (within a basic block pass) the number of basic block in the program ?<br>
><br>
</div>Not of which I am aware.  You will probably need to write code that does<br>
this for you.<br>
<br>
One place to put the code would be in the doInitialization() method of<br>
the BasicBlockPass that you're writing.  However, I'm not sure if the<br>
count would be accurate; other passes could invalidate the information<br>
before the runOnBasicBlock() method is called by the PassManager.<br>
<br>
Another method is to write a separate ModulePass that counts the number<br>
of basic blocks.  Your pass could list it as a prerequisite, and the<br>
PassManager would automatically run this separate ModulePass for you.<br>
<br>
-- John T.<br>
<br>
> Thanks.<br>
><br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div></div>