On 28 June 2010 15:48, Diego Novillo <dnovi...@google.com> wrote: > On Mon, Jun 28, 2010 at 09:38, <jeremie.salvu...@free.fr> wrote: >> Hello all, >> >> I would like to know why does gimple_body returns NULL pointer when I try to >> use it after the "cfg" pass ? Does someone have informations about the >> general use of it ? > > Because the body has been split up into the basic blocks of the CFG. > You need to use the basic block iterators to traverse the CFG (e.g., > FOR_EACH_BB_FN()). > >> Because I am trying to traverse instructions from a C program thanks to MELT >> (cf MELT branch) and I don't know if I have to traverse basic blocks with >> FOR_EACH_BB_FN iterator or if there is another solution with gimple_body. >> Basile believes that gimple_body is nearly useless. > > It is once the CFG has been built, yes.
Jeremie, it may help future users if you added this information to the comment above gimple_body. I think such a small patch wouldn't need any copyright assignment. Thanks, Manuel.