[LLVMdev] Basic Block API

Rotem Varon varonrotem at gmail.com
Sat May 23 09:12:22 PDT 2009


Hi,
Thank you for your answer.
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 ?

Thanks.

On Sat, May 23, 2009 at 7:01 PM, John Criswell <criswell at cs.uiuc.edu> wrote:

> Rotem Varon wrote:
> > Hi,
> >
> > Is there an API for getting (within a basic block pass) the number of
> basic block in the program ?
> >
> Not of which I am aware.  You will probably need to write code that does
> this for you.
>
> One place to put the code would be in the doInitialization() method of
> the BasicBlockPass that you're writing.  However, I'm not sure if the
> count would be accurate; other passes could invalidate the information
> before the runOnBasicBlock() method is called by the PassManager.
>
> Another method is to write a separate ModulePass that counts the number
> of basic blocks.  Your pass could list it as a prerequisite, and the
> PassManager would automatically run this separate ModulePass for you.
>
> -- John T.
>
> > Thanks.
> >
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090523/4c9d0190/attachment.html>


More information about the llvm-dev mailing list