On Thu, Sep 13, 2012 at 2:29 PM, Jan Hubicka <hubi...@ucw.cz> wrote: > +/* Get the set of nodes for the cycle in the reduced call graph starting > + from NODE. */ > + > +VEC (cgraph_node_p, heap) * > +ipa_get_nodes_in_cycle (struct cgraph_node *node) > > I never really like the api of SCC searching that made user to walk across AUX > pointer. > > I however also do not like allocating a temporary vector and requiring user to > mind to free it just to add abstraction about single linked list walk.
I think this new ipa_get_nodes_in_cycle thing is an improvement over what there is now, but I agree that something better is necessary in the long term. Not just for visiting nodes in a cycle, but also for how a cycle is represented. Linking via the aux pointer wouldn't have been my choice to begin with... (FWIW, I also dislike the get_loop_body stuff. Loop nodes should just be a set directly available from the loop info without a CFG DFS.) > What > about adding convenient iterator API, especially now when we have the C++ > wonderland? Maybe later. But I'll wait with C++ iterators until someone has put an example in the trunk that I can copy-and-paste :-) Ciao! Steven