From cd8d8754d58202ee4a9e909baa3a15cbe1d0c79c Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 22 Mar 2011 22:41:52 +0000 Subject: [PATCH] mn10300-opts.h: New. * config/mn10300/mn10300-opts.h: New. * config/mn10300/mn10300.c (mn10300_processor, mn10300_tune_string): Remove. (mn10300_handle_option): Don't assert that global structures are in use. Access mn10300_processor via opts pointer. Don't handle OPT_mtune_ here. * config/mn10300/mn10300.h (enum processor_type): Move to mn10300-opts.h. (mn10300_processor): Remove. * config/mn10300/mn10300.opt (config/mn10300/mn10300-opts.h): New HeaderInclude entry. (mn10300_processor): New Variable entry. (mtune=): Use Var. From-SVN: r171323 --- gcc/ChangeLog | 16 ++++++++++++++++ gcc/config/mn10300/mn10300-opts.h | 32 +++++++++++++++++++++++++++++++ gcc/config/mn10300/mn10300.c | 27 +++++++------------------- gcc/config/mn10300/mn10300.h | 13 ++++--------- gcc/config/mn10300/mn10300.opt | 9 ++++++++- 5 files changed, 67 insertions(+), 30 deletions(-) create mode 100644 gcc/config/mn10300/mn10300-opts.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 21dee109a16..0e9d61dd2f6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2011-03-22 Joseph Myers + + * config/mn10300/mn10300-opts.h: New. + * config/mn10300/mn10300.c (mn10300_processor, + mn10300_tune_string): Remove. + (mn10300_handle_option): Don't assert that global structures are + in use. Access mn10300_processor via opts pointer. Don't handle + OPT_mtune_ here. + * config/mn10300/mn10300.h (enum processor_type): Move to + mn10300-opts.h. + (mn10300_processor): Remove. + * config/mn10300/mn10300.opt (config/mn10300/mn10300-opts.h): New + HeaderInclude entry. + (mn10300_processor): New Variable entry. + (mtune=): Use Var. + 2011-03-22 Joseph Myers * config/microblaze/microblaze.c: Don't include opts.h. diff --git a/gcc/config/mn10300/mn10300-opts.h b/gcc/config/mn10300/mn10300-opts.h new file mode 100644 index 00000000000..888fd20bd65 --- /dev/null +++ b/gcc/config/mn10300/mn10300-opts.h @@ -0,0 +1,32 @@ +/* Definitions for option handling for Matsushita MN10300 series. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#ifndef MN10300_OPTS_H +#define MN10300_OPTS_H + +enum processor_type +{ + PROCESSOR_MN10300, + PROCESSOR_AM33, + PROCESSOR_AM33_2, + PROCESSOR_AM34 +}; + +#endif diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index cae3ea1fb52..cad6a0dbbb4 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -52,12 +52,6 @@ symbol names from register names. */ int mn10300_protect_label; -/* The selected processor. */ -enum processor_type mn10300_processor = PROCESSOR_DEFAULT; - -/* Processor type to select for tuning. */ -static const char * mn10300_tune_string = NULL; - /* Selected processor type for tuning. */ enum processor_type mn10300_tune_cpu = PROCESSOR_DEFAULT; @@ -91,35 +85,28 @@ static int cc_flags_for_code(enum rtx_code); /* Implement TARGET_HANDLE_OPTION. */ static bool -mn10300_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, +mn10300_handle_option (struct gcc_options *opts, + struct gcc_options *opts_set ATTRIBUTE_UNUSED, const struct cl_decoded_option *decoded, location_t loc ATTRIBUTE_UNUSED) { size_t code = decoded->opt_index; - const char *arg = decoded->arg; int value = decoded->value; - gcc_assert (opts == &global_options); - gcc_assert (opts_set == &global_options_set); - switch (code) { case OPT_mam33: - mn10300_processor = value ? PROCESSOR_AM33 : PROCESSOR_MN10300; + opts->x_mn10300_processor = value ? PROCESSOR_AM33 : PROCESSOR_MN10300; return true; case OPT_mam33_2: - mn10300_processor = (value - ? PROCESSOR_AM33_2 - : MIN (PROCESSOR_AM33, PROCESSOR_DEFAULT)); + opts->x_mn10300_processor = (value + ? PROCESSOR_AM33_2 + : MIN (PROCESSOR_AM33, PROCESSOR_DEFAULT)); return true; case OPT_mam34: - mn10300_processor = (value ? PROCESSOR_AM34 : PROCESSOR_DEFAULT); - return true; - - case OPT_mtune_: - mn10300_tune_string = arg; + opts->x_mn10300_processor = (value ? PROCESSOR_AM34 : PROCESSOR_DEFAULT); return true; default: diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 2e97ca4ff4c..ac23f585861 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler. Matsushita MN10300 series Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). This file is part of GCC. @@ -57,15 +57,10 @@ } \ while (0) -enum processor_type -{ - PROCESSOR_MN10300, - PROCESSOR_AM33, - PROCESSOR_AM33_2, - PROCESSOR_AM34 -}; +#ifndef MN10300_OPTS_H +#include "config/mn10300/mn10300-opts.h" +#endif -extern enum processor_type mn10300_processor; extern enum processor_type mn10300_tune_cpu; #define TARGET_AM33 (mn10300_processor >= PROCESSOR_AM33) diff --git a/gcc/config/mn10300/mn10300.opt b/gcc/config/mn10300/mn10300.opt index 8909d8bd1f3..676e434e0ef 100644 --- a/gcc/config/mn10300/mn10300.opt +++ b/gcc/config/mn10300/mn10300.opt @@ -18,6 +18,13 @@ ; along with GCC; see the file COPYING3. If not see ; . +HeaderInclude +config/mn10300/mn10300-opts.h + +; The selected processor. +Variable +enum processor_type mn10300_processor = PROCESSOR_DEFAULT + mam33 Target Target the AM33 processor @@ -31,7 +38,7 @@ Target Report Target the AM34 processor mtune= -Target RejectNegative Joined +Target RejectNegative Joined Var(mn10300_tune_string) Tune code for the given processor mmult-bug -- 2.30.2