summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-22 22:38:56 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-22 22:38:56 +0000
commiteea6e787a8ad8139edc71b3d6ec1b439386d62d5 (patch)
tree0f92dfe67df8f5f0e951dcad65707d9bd2060d81
parent3263bbb3371f90ad5ec5050933b86d563e086c49 (diff)
downloadgcc-eea6e787a8ad8139edc71b3d6ec1b439386d62d5.tar.gz
* config/m32c/m32c.c: Don't include opts.h.
(target_memregs, target_memregs_set, TARGET_HANDLE_OPTION, m32c_handle_option): Remove. (m32c_option_override): Check global_options_set.x_target_memregs instead of target_memregs_set. * config/m32c/m32c.h (target_memregs): Remove. * config/m32c/m32c.opt (memregs=): Use UInteger with integer variable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171320 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/m32c/m32c.c26
-rw-r--r--gcc/config/m32c/m32c.h1
-rw-r--r--gcc/config/m32c/m32c.opt4
4 files changed, 14 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ad50dd2914c..b5936dd2601 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2011-03-22 Joseph Myers <joseph@codesourcery.com>
+ * config/m32c/m32c.c: Don't include opts.h.
+ (target_memregs, target_memregs_set, TARGET_HANDLE_OPTION,
+ m32c_handle_option): Remove.
+ (m32c_option_override): Check global_options_set.x_target_memregs
+ instead of target_memregs_set.
+ * config/m32c/m32c.h (target_memregs): Remove.
+ * config/m32c/m32c.opt (memregs=): Use UInteger with integer
+ variable.
+
+2011-03-22 Joseph Myers <joseph@codesourcery.com>
+
* config/iq2000/iq2000-opts.h: New.
* config/iq2000/iq2000.c: Don't include opts.h.
(iq2000_tune, iq2000_handle_option, TARGET_HANDLE_OPTION): Remove.
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 16f635770e7..055f34e9320 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -48,7 +48,6 @@
#include "langhooks.h"
#include "gimple.h"
#include "df.h"
-#include "opts.h"
/* Prototypes */
@@ -408,31 +407,8 @@ class_can_hold_mode (reg_class_t rclass, enum machine_mode mode)
Memregs are provided by m32c-lib1.S.
*/
-int target_memregs = 16;
-static bool target_memregs_set = FALSE;
int ok_to_change_target_memregs = TRUE;
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION m32c_handle_option
-static bool
-m32c_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
- const struct cl_decoded_option *decoded,
- location_t loc ATTRIBUTE_UNUSED)
-{
- size_t code = decoded->opt_index;
- const char *arg = decoded->arg;
-
- gcc_assert (opts == &global_options);
- gcc_assert (opts_set == &global_options_set);
-
- if (code == OPT_memregs_)
- {
- target_memregs_set = TRUE;
- target_memregs = atoi (arg);
- }
- return TRUE;
-}
-
/* Implements TARGET_OPTION_OVERRIDE. */
#undef TARGET_OPTION_OVERRIDE
@@ -442,7 +418,7 @@ static void
m32c_option_override (void)
{
/* We limit memregs to 0..16, and provide a default. */
- if (target_memregs_set)
+ if (global_options_set.x_target_memregs)
{
if (target_memregs < 0 || target_memregs > 16)
error ("invalid target memregs value '%d'", target_memregs);
diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h
index 9cabeedb846..28072abc2ba 100644
--- a/gcc/config/m32c/m32c.h
+++ b/gcc/config/m32c/m32c.h
@@ -86,7 +86,6 @@
beginning of the file. This variable starts off TRUE and later
becomes FALSE. */
extern int ok_to_change_target_memregs;
-extern int target_memregs;
/* TARGET_CPU is a multi-way option set in m32c.opt. While we could
use enums or defines for this, this and m32c.opt are the only
diff --git a/gcc/config/m32c/m32c.opt b/gcc/config/m32c/m32c.opt
index d19153bbefc..b3029b0e4d1 100644
--- a/gcc/config/m32c/m32c.opt
+++ b/gcc/config/m32c/m32c.opt
@@ -1,5 +1,5 @@
; Target Options for R8C/M16C/M32C
-; Copyright (C) 2005 2007
+; Copyright (C) 2005, 2007, 2011
; Free Software Foundation, Inc.
; Contributed by Red Hat.
;
@@ -40,5 +40,5 @@ Target RejectNegative Var(target_cpu,'3')
-mcpu=m32c Compile code for M32C variants
memregs=
-Target RejectNegative Joined Var(target_memregs_string)
+Target RejectNegative Joined UInteger Var(target_memregs) Init(16)
-memregs= Number of memreg bytes (default: 16, range: 0..16)