On Tue, 6 Jul 2010, Alex Turjan wrote:
> Hi, > Is there functionality in gcc based on which the CFG can be traversed in > such a way that a node gets visited once all of its predecessors have been > visited? (Assuming you mean when there are no loops) Yes, see post_order_compute in cfganal.c. It computes topological sort order (which is what you need) in reverse: nodes that must be visited last come first in the array. Hope that helps. Alexander