* 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
+2011-03-22 Joseph Myers <joseph@codesourcery.com>
+
+ * 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 <joseph@codesourcery.com>
* config/microblaze/microblaze.c: Don't include opts.h.
--- /dev/null
+/* 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
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef MN10300_OPTS_H
+#define MN10300_OPTS_H
+
+enum processor_type
+{
+ PROCESSOR_MN10300,
+ PROCESSOR_AM33,
+ PROCESSOR_AM33_2,
+ PROCESSOR_AM34
+};
+
+#endif
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;
/* 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:
/* 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.
} \
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)
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
+HeaderInclude
+config/mn10300/mn10300-opts.h
+
+; The selected processor.
+Variable
+enum processor_type mn10300_processor = PROCESSOR_DEFAULT
+
mam33
Target
Target the AM33 processor
Target the AM34 processor
mtune=
-Target RejectNegative Joined
+Target RejectNegative Joined Var(mn10300_tune_string)
Tune code for the given processor
mmult-bug