> On 4/5/12 9:54 AM, Richard Guenther wrote: > > >Honza, does this look ok? I am going to continue this way > >until I can re-architect the toplevel pass structure in a way > >that we hand control more to the pass manager. Well, hopefully ;) > > Related to this, have you thought about the handoff points between > front ends and the middle end? > > In LTO (and at some point in the gimple front end branch) we have > all this code setting up various tidbits like: > > - Creating cgraph nodes. > - Creating FUNCTION_DECLs > - Setting their gimple bodies > - Etc. > > It would be nice if front ends had a single handoff point into the > middle-end. > > So, for instance, if the FE only needed to call cgraph_create_node() > or varpool_node() to register new functions and globals.
There are cgraph_finalize_function and varpool equivalent for this. the actual nodes are then build lazily while constructing cgraph... Out of date description of the basic FE API is in the beggining of cgraphunit.c. I guess I should update it. Have some patches to cleanup FE abuse of cgraph in queue now ad symtab front - I am getting rid of the needed flag and thus also all those mark_needed calls done for magical purposes. Honza > > After doing all that registration, the FE calls cgraph_optimize() > (or some other unique entry point). > > I *think* this is roughly how things work, but there seem to be > various other cgraph/middle-end calls made from front ends. > > > > Diego.