This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pre-Patch RFC: proposed changes to option-lookup


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]