Pre-Patch RFC: proposed changes to option-lookup
Richard Biener
richard.guenther@gmail.com
Mon Nov 4 13:27:00 GMT 2013
On Wed, Oct 30, 2013 at 11:56 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Wed, 30 Oct 2013, David Malcolm wrote:
>
>> My idea is to introduce a GCC_OPTION macro, and replace the above with:
>>
>> static bool
>> gate_vrp (void)
>> {
>> return GCC_OPTION (flag_tree_vrp) != 0;
>> }
>
> That's only slightly shorter than the full expansion using global_options;
> I'd prefer using the full expansion.
>
> (Of course the ideal is to use explicit options pointers instead of
> global_options. For example, if such a pointer were associated with the
> current function, it might make function-specific options handling a bit
> less fragile.)
Seconded - ideally the 'struct function' a pass is supposed to work
on would be passed as argument here and the options in effect
should be able to be extracted from it. [that is, we shouldn't have
push/pop_cfun or cfun or current_function_decl at all]
Note that I think expanding this to global_options.x_flag_tree_vrp
wouldn't be a step forward.
Richard.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
More information about the Gcc-patches
mailing list