From: Richard Earnshaw <rearnsha@arm.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, nickc@redhat.com, paul@codesourcery.com,
ramana.radhakrishnan@arm.com
Subject: Re: Avoid global state in arm_handle_option
Date: Mon, 11 Apr 2011 10:48:00 -0000 [thread overview]
Message-ID: <1302518887.21707.32.camel@e102346-lin.cambridge.arm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1104072204460.11415@digraph.polyomino.org.uk>
On Thu, 2011-04-07 at 22:06 +0000, Joseph S. Myers wrote:
> This patch stops the ARM handle_option hook from using global state -
> in fact removing the hook altogether by using .opt Enum facilities for
> what it did.
>
> The -march, -mcpu and -mtune option values are made to use Enum. The
> Enum definitions go in a new generated file arm-tables.opt; for
> -mcpu/-mtune these are generated from the existing arm-cores.def. For
> -march, since there was no enum for architecture values nor any
> apparent need for one, and given the .def arrangements already used
> for core names, I added a new arm-arches.def with the architecture
> table. In both cases, giving a help text on the Enum definitions
> meant that generic code could do what arm_target_help previously did,
> so that hook is also removed (the only implementation of the
> TARGET_HELP hook is now for AVR).
>
> arm_selected_* are now set at the start of arm_option_override. When
> I turn to dealing with global state in those hooks (and splitting the
> parts needing global state into a separate hook) I expect to make
> arm_selected_* purely local variables of arm_option_override, rather
> than moving them to the gcc_options structure. The only place they
> are used outside that function is arm_file_start, and const char *
> fields in the gcc_options structure can be added for those particular
> uses.
>
> Tested building cc1 and xgcc for cross to arm-eabi. Will commit to
> trunk in the absence of target maintainer objections.
>
> contrib:
> 2011-04-07 Joseph Myers <joseph@codesourcery.com>
>
> * gcc_update (gcc/config/arm/arm-tables.opt): New dependencies.
>
> gcc:
> 2011-04-07 Joseph Myers <joseph@codesourcery.com>
>
> * config.gcc (arm*-*-*): Add arm/arm-tables.opt to extra_options.
> * config/arm/arm-arches.def: New.
> * config/arm/arm-opts.h: New.
> * config/arm/genopt.sh: New.
> * config/arm/arm-tables.opt: New (generated).
> * config/arm/arm.c (arm_handle_option, arm_target_help,
> TARGET_HANDLE_OPTION, TARGET_HELP, arm_find_cpu): Remove.
> (all_architectures): Get most table contents from arm-arches.def.
> (arm_option_override): Set arm_selected_arch, arm_selected_cpu and
> arm_selected_tune here.
> * config/arm/arm.h (enum processor_type): Move to arm-opts.h.
> * config/arm/arm.opt (config/arm/arm-opts.h): New HeaderInclude.
> (march=, mcpu=, mtune=): Use Enum and Var.
> * config/arm/t-arm ($(srcdir)/config/arm/arm-tables.opt): New.
> (arm.o): Update dependencies.
OK.
R.
prev parent reply other threads:[~2011-04-11 10:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 22:06 Joseph S. Myers
2011-04-11 10:48 ` Richard Earnshaw [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302518887.21707.32.camel@e102346-lin.cambridge.arm.com \
--to=rearnsha@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=nickc@redhat.com \
--cc=paul@codesourcery.com \
--cc=ramana.radhakrishnan@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).