This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Pre-Patch RFC: proposed changes to option-lookup
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: David Malcolm <dmalcolm at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 4 Nov 2013 14:23:39 +0100
- Subject: Re: Pre-Patch RFC: proposed changes to option-lookup
- Authentication-results: sourceware.org; auth=none
- References: <1383165583 dot 29677 dot 97 dot camel at surprise> <Pine dot LNX dot 4 dot 64 dot 1310302254070 dot 29408 at digraph dot polyomino dot org dot uk>
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