weili747 <weili747@xxxxxxxxx> 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