semantics of null lang_hooks.callgraph.expand_function?

Jim Wilson wilson@specifix.com
Wed Oct 26 23:22:00 GMT 2005


Gary Funck wrote:
> While working with GCC's language hooks, we found that
> certain places in GCC test for a null value of
> lang_hooks.callgraph.expand_function, but
> cgraph_expand_function() calls the hook directly:

When cgraph was first added, it was optional, and could be disabled if 
-fno-unit-at-a-time was used, or if the language front-end did not 
support cgraph.

For a while, our intentions have been to make this mandatory, and 
eliminate the -fno-unit-at-a-time option.  It appears that we have 
already reached the point where front end support for cgraph is 
mandatory, as the code no longer works when callgraph.expand_function is 
NULL.  This means all of the checks for NULL are now obsolete and can be 
removed.  The -fno-unit-at-a-time options still exists meanwhile, but 
will eventually be dropped.

It looks like gcc-3.4 supports a NULL callgraph.expand_function hook, 
and gcc-4.0 and later do not, so I'd guess this transition happened when 
tree-ssa got merged in.  Or maybe it was enabled by the tree-ssa work.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com



More information about the Gcc mailing list