immediate predecessors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

immediate predecessors

aditya vishnubhotla
hi,
how to get the number of immediate predecessors for
each basic block (arguements of remarks statement at
the beginning of the basic block)
 
thank you
aditya


      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: immediate predecessors

Bill Wendling
Hi Aditya,

> how to get the number of immediate predecessors for
> each basic block (arguements of remarks statement at
> the beginning of the basic block)
>
Look at include/llvm/Support/CFG.h. It has a "pred_iterator"  
definition. So you can probably do something along the lines of:

        BasicBlock *BB;

        pred_iterator PI = pred_begin(BB);
        pred_iterator PE = pred_end(BB);

        for (; PI != PE; ++PI) {
          // Do something
        }

Do a search on the code base to see examples of its use.

Cheers!
-bw
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: immediate predecessors

Chris Lattner
In reply to this post by aditya vishnubhotla
On Wed, 2 Jan 2008, aditya vishnubhotla wrote:
> how to get the number of immediate predecessors for
> each basic block (arguements of remarks statement at
> the beginning of the basic block)

I added this to the programmer's manual:
http://llvm.org/docs/ProgrammersManual.html#iterate_preds

-Chris

--
http://nondot.org/sabre/
http://llvm.org/
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev