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 <jos...@codesourcery.com> > > * gcc_update (gcc/config/arm/arm-tables.opt): New dependencies. > > gcc: > 2011-04-07 Joseph Myers <jos...@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.