[LTO][PATCH] Add lang-hooks for LTO operation modes.

Ollie Wild aaw@google.com
Thu Sep 18 18:01:00 GMT 2008


2008/9/18 Doug Kwan (關振德) <dougkwan@google.com>
>
> > Why two langhooks?  The get/set functions need not be langhooks, you
> > only need a single langhook lto_mode_supported_p.
>
> The mode is set by the command line but not all modes are supported by
> all front-end. I can eliminate the get_mode lang-hook and use a global
> instead.

Just a suggestion, but since only one mode of the new option is
relevant to non-lto front ends, it seems odd to add it to all front
ends.  Why not leave -flto alone and add -fwpa and -fltrans to
lto/lang.opt.  These can still be implemented under the covers using a
common lto_mode global, but then you no longer need a language hook
for validity checking.

Or does this prevent the options from being passed to the linker
driver?  I'm not quite sure how command line processing is handled
there.

Even if the new modes do need to be included in common.opt, you can
implement the WPA and LTRANS modes inside the lto_handle_option
function rather than in a language hook.

Ollie


More information about the Gcc-patches mailing list