PATCH: remove expand_constant lang_hook (was [RFC] Migrate pointers to members to the middle end)

Mark Mitchell mark@codesourcery.com
Fri Sep 28 08:46:00 GMT 2007


Ollie Wild wrote:

> 2007-09-24  Ollie Wild  <aaw@google.com>
> 
>     * varasm.c (compare_constant): Removed call to
>     lang_hooks.expand_constant.
>     (copy_constants): Removed call to lang_hooks.expand_constant.
>     (compute_reloc_for_constant): Removed call to
>     lang_hooks.expand_constant.
>     (output_addressed_constants): Removed call to
>     lang_hooks.expand_constant.
>     (constructor_static_from_elts_p): Removed call to
>     lang_hooks.expand_constant.
>     (output_constant): Removed calls to lang_hooks.expand_constant.
>     * langhooks.h (struct lang_hooks): Removed field expand_constant.
>     * langhooks-def.h (lhd_return_tree): Removed.
>     (LANG_HOOKS_EXPAND_CONSTANT): Removed.
>     (LANG_HOOKS_INITIALIZER): Removed LANG_HOOKS_EXPAND_CONSTANT.
>     * langhooks.c (lhd_return_tree): Removed.
> 
> 2007-09-24  Ollie Wild  <aaw@google.com>
> 
>     * typeck2.c (digest_init): Call cplus_expand_constant after
>     convert_for_initialization.
>     * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
>     * expr.c (cplus_expand_constant): Updated function description.

This is a nice optimization and makes the compiler simpler as well.  I'd
not normally allow this in Stage 3, but it's a resubmission, so this is
OK for mainline.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list