Hi!

On Thu, Aug 06, 2020 at 08:37:23PM +0800, Kewen.Lin wrote:
> When I was working to update patch as Richard's review comments
> here https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551474.html,
> I noticed that the options "-Q --help=params" don't show the final values
> after target option overriding, instead it emits the default values in
> params.opt (without any explicit param settings).
> 
> I guess it's more meaningful to get it to emit values post-overrided,
> to avoid possible confusion for users.  Does it make sense?
> Or are there any concerns?

I think this makes a lot of sense.

> btw, not sure whether it's a good idea to move target_option_override_hook
> call into print_specific_help and use one function local static
> variable to control it's called once for all kinds of help dumping
> (possible combination), then can remove the calls in function 
> common_handle_option.

I cannot easily imagine what that will look like...  it could easily be
worse than what you have here (callbacks aren't so nice, but there are
worse things).

> @@ -2145,9 +2146,11 @@ print_help (struct gcc_options *opts, unsigned int 
> lang_mask,
>    if (!(include_flags & CL_PARAMS))
>      exclude_flags |= CL_PARAMS;
>  
> -  if (include_flags)
> +  if (include_flags) {
> +    target_option_override_hook ();
>      print_specific_help (include_flags, exclude_flags, 0, opts,
>                        lang_mask);
> +  }
>  }

Indenting should be like

  if (include_flags)
    {
      target_option_override_hook ();
      print_specific_help (include_flags, exclude_flags, 0, opts, lang_mask);
    }


Segher

Reply via email to