This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CFG from the GCC


weili747 <weili747@gmail.com> writes:

> I am trying to get CFG for a function in a program after all optimization
> passes have been applied. How can I get it? Thanks in advance.

You can get the basic blocks via FOR_EACH_BB.  Given a basic block, you
can use FOR_EACH_EDGE to get the edges.  For each edge, you can
EDGE_PRED and EDGE_SUCC to get the basic blocks that the edges connect
to.  See basic-block.h for these and other things.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]