]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
target.def (handle_option): Take gcc_options and cl_decoded_option pointers and locat...
authorJoseph Myers <joseph@codesourcery.com>
Tue, 22 Mar 2011 22:23:02 +0000 (22:23 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 22 Mar 2011 22:23:02 +0000 (22:23 +0000)
* target.def (handle_option): Take gcc_options and
cl_decoded_option pointers and location_t.
* doc/tm.texi.in (TARGET_HANDLE_OPTION): Update documentation.
* doc/tm.texi: Regenerate.
* hooks.c (hook_bool_size_t_constcharptr_int_true): Remove.
* hooks.h (hook_bool_size_t_constcharptr_int_true): Don't declare.
* lto-opts.c (lto_reissue_options): Generate option structure for
targetm.handle_option call.
* opts.c (target_handle_option): Update call to
targetm.handle_option.  Remove assertions about values now passed
down to hook.
* targhooks.c (default_target_handle_option): New.
* targhooks.h (default_target_handle_option): Declare.
* config/alpha/alpha.c: Include opts.h.
(alpha_handle_option): Update to new hook interface.
* config/arm/arm.c: Include opts.h.
(arm_handle_option): Update to new hook interface.
* config/arm/t-arm (arm.o): Update dependencies.
* config/bfin/bfin.c: Include opts.h.
(bfin_handle_option): Update to new hook interface.
* config/cris/cris.c: Include opts.h.
(cris_handle_option): Update to new hook interface.
* config/frv/frv.c: Include opts.h.
(frv_handle_option): Update to new hook interface.
* config/i386/i386.c: Include opts.h.
(ix86_handle_option): Update to new hook interface.
(ix86_valid_target_attribute_inner_p): Generate option structure
for call to ix86_handle_option.
* config/i386/t-i386 (i386.o): Update dependencies.
* config/ia64/ia64.c: Include opts.h.
(ia64_handle_option): Update to new hook interface.
* config/ia64/t-ia64 (ia64.o): Update dependencies.
* config/iq2000/iq2000.c: Include opts.h.
(iq2000_handle_option): Update to new hook interface.
* config/m32c/m32c.c: Include opts.h.
(m32c_handle_option): Update to new hook interface.
* config/m32r/m32r.c: Include opts.h.
(m32r_handle_option): Update to new hook interface.
* config/m68k/m68k.c: Include opts.h.
(m68k_handle_option): Update to new hook interface.
* config/mep/mep.c: Include opts.h.
(mep_handle_option): Update to new hook interface.
* config/microblaze/microblaze.c: Include opts.h.
(microblaze_handle_option): Update to new hook interface.
* config/mips/mips.c: Include opts.h.
(mips_handle_option): Update to new hook interface.
* config/mn10300/mn10300.c: Include opts.h.
(mn10300_handle_option): Update to new hook interface.
* config/pa/pa.c: Include opts.h.
(pa_handle_option): Update to new hook interface.
* config/pdp11/pdp11.c: Include opts.h.
(pdp11_handle_option): Update to new hook interface.
* config/rs6000/rs6000.c: Include opts.h.
(rs6000_handle_option): Update to new hook interface.
* config/rs6000/t-rs6000 (rs6000.o): Update dependencies.
* config/rx/rx.c: Include opts.h.
(rx_handle_option): Update to new hook interface.
* config/s390/s390.c: Include opts.h.
(s390_handle_option): Update to new hook interface.
* config/score/score.c: Include opts.h.
(score_handle_option): Update to new hook interface.
* config/sh/sh.c: Include opts.h.
(sh_handle_option): Update to new hook interface.
* config/sparc/sparc.c: Include opts.h.
(sparc_handle_option): Update to new hook interface.
* config/v850/v850.c: Include opts.h.
(v850_handle_option): Update to new hook interface.

From-SVN: r171308

38 files changed:
gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/arm/arm.c
gcc/config/arm/t-arm
gcc/config/bfin/bfin.c
gcc/config/cris/cris.c
gcc/config/frv/frv.c
gcc/config/i386/i386.c
gcc/config/i386/t-i386
gcc/config/ia64/ia64.c
gcc/config/ia64/t-ia64
gcc/config/iq2000/iq2000.c
gcc/config/m32c/m32c.c
gcc/config/m32r/m32r.c
gcc/config/m68k/m68k.c
gcc/config/mep/mep.c
gcc/config/microblaze/microblaze.c
gcc/config/mips/mips.c
gcc/config/mn10300/mn10300.c
gcc/config/pa/pa.c
gcc/config/pdp11/pdp11.c
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/t-rs6000
gcc/config/rx/rx.c
gcc/config/s390/s390.c
gcc/config/score/score.c
gcc/config/sh/sh.c
gcc/config/sparc/sparc.c
gcc/config/v850/v850.c
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/hooks.c
gcc/hooks.h
gcc/lto-opts.c
gcc/opts.c
gcc/target.def
gcc/targhooks.c
gcc/targhooks.h

index 9503e8b822af63332e96fa28839447f231b26b26..97145c00652be426b5ceb9c92e2590d619cca624 100644 (file)
@@ -1,3 +1,73 @@
+2011-03-22  Joseph Myers  <joseph@codesourcery.com>
+
+       * target.def (handle_option): Take gcc_options and
+       cl_decoded_option pointers and location_t.
+       * doc/tm.texi.in (TARGET_HANDLE_OPTION): Update documentation.
+       * doc/tm.texi: Regenerate.
+       * hooks.c (hook_bool_size_t_constcharptr_int_true): Remove.
+       * hooks.h (hook_bool_size_t_constcharptr_int_true): Don't declare.
+       * lto-opts.c (lto_reissue_options): Generate option structure for
+       targetm.handle_option call.
+       * opts.c (target_handle_option): Update call to
+       targetm.handle_option.  Remove assertions about values now passed
+       down to hook.
+       * targhooks.c (default_target_handle_option): New.
+       * targhooks.h (default_target_handle_option): Declare.
+       * config/alpha/alpha.c: Include opts.h.
+       (alpha_handle_option): Update to new hook interface.
+       * config/arm/arm.c: Include opts.h.
+       (arm_handle_option): Update to new hook interface.
+       * config/arm/t-arm (arm.o): Update dependencies.
+       * config/bfin/bfin.c: Include opts.h.
+       (bfin_handle_option): Update to new hook interface.
+       * config/cris/cris.c: Include opts.h.
+       (cris_handle_option): Update to new hook interface.
+       * config/frv/frv.c: Include opts.h.
+       (frv_handle_option): Update to new hook interface.
+       * config/i386/i386.c: Include opts.h.
+       (ix86_handle_option): Update to new hook interface.
+       (ix86_valid_target_attribute_inner_p): Generate option structure
+       for call to ix86_handle_option.
+       * config/i386/t-i386 (i386.o): Update dependencies.
+       * config/ia64/ia64.c: Include opts.h.
+       (ia64_handle_option): Update to new hook interface.
+       * config/ia64/t-ia64 (ia64.o): Update dependencies.
+       * config/iq2000/iq2000.c: Include opts.h.
+       (iq2000_handle_option): Update to new hook interface.
+       * config/m32c/m32c.c: Include opts.h.
+       (m32c_handle_option): Update to new hook interface.
+       * config/m32r/m32r.c: Include opts.h.
+       (m32r_handle_option): Update to new hook interface.
+       * config/m68k/m68k.c: Include opts.h.
+       (m68k_handle_option): Update to new hook interface.
+       * config/mep/mep.c: Include opts.h.
+       (mep_handle_option): Update to new hook interface.
+       * config/microblaze/microblaze.c: Include opts.h.
+       (microblaze_handle_option): Update to new hook interface.
+       * config/mips/mips.c: Include opts.h.
+       (mips_handle_option): Update to new hook interface.
+       * config/mn10300/mn10300.c: Include opts.h.
+       (mn10300_handle_option): Update to new hook interface.
+       * config/pa/pa.c: Include opts.h.
+       (pa_handle_option): Update to new hook interface.
+       * config/pdp11/pdp11.c: Include opts.h.
+       (pdp11_handle_option): Update to new hook interface.
+       * config/rs6000/rs6000.c: Include opts.h.
+       (rs6000_handle_option): Update to new hook interface.
+       * config/rs6000/t-rs6000 (rs6000.o): Update dependencies.
+       * config/rx/rx.c: Include opts.h.
+       (rx_handle_option): Update to new hook interface.
+       * config/s390/s390.c: Include opts.h.
+       (s390_handle_option): Update to new hook interface.
+       * config/score/score.c: Include opts.h.
+       (score_handle_option): Update to new hook interface.
+       * config/sh/sh.c: Include opts.h.
+       (sh_handle_option): Update to new hook interface.
+       * config/sparc/sparc.c: Include opts.h.
+       (sparc_handle_option): Update to new hook interface.
+       * config/v850/v850.c: Include opts.h.
+       (v850_handle_option): Update to new hook interface.
+
 2011-03-22  Joseph Myers  <joseph@codesourcery.com>
 
        * gcc.c (driver_unknown_option_callback): Only permit and save
index c9bafeb29031929f351a5fcea76988fec47532de..ebdb37d861e26092876c81e3e3d5a8c596856bb4 100644 (file)
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm-constrs.h"
 #include "df.h"
 #include "libfuncs.h"
+#include "opts.h"
 
 /* Specify which cpu to schedule for.  */
 enum processor_type alpha_tune;
@@ -217,8 +218,17 @@ static const struct default_options alpha_option_optimization_table[] =
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-alpha_handle_option (size_t code, const char *arg, int value)
+alpha_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;
+  int value = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_mfp_regs:
index e863e8c19689882f303204d1e8ac3c3d680f598e..31a0726858e4368c6dff6ed81c2e3ba64e459e31 100644 (file)
@@ -56,6 +56,7 @@
 #include "intl.h"
 #include "libfuncs.h"
 #include "params.h"
+#include "opts.h"
 
 /* Forward definitions of types.  */
 typedef struct minipool_node    Mnode;
@@ -218,7 +219,8 @@ static tree arm_build_builtin_va_list (void);
 static void arm_expand_builtin_va_start (tree, rtx);
 static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
 static void arm_option_override (void);
-static bool arm_handle_option (size_t, const char *, int);
+static bool arm_handle_option (struct gcc_options *, struct gcc_options *,
+                              const struct cl_decoded_option *, location_t);
 static void arm_target_help (void);
 static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode);
 static bool arm_cannot_copy_insn_p (rtx);
@@ -1340,8 +1342,16 @@ arm_find_cpu (const char *name, const struct processors *sel, const char *desc)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-arm_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+arm_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);
+
   switch (code)
     {
     case OPT_march_:
index 33d7e19f79c3856e1c0ab4f1816d5b01e89345a5..993d3d20740a749590770d8afeba92824691d145 100644 (file)
@@ -1,6 +1,6 @@
 # Rules common to all arm targets
 #
-# Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010
+# Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
 # Free Software Foundation, Inc.
 #
 # This file is part of GCC.
@@ -58,7 +58,7 @@ arm.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   $(EXPR_H) $(OPTABS_H) $(RECOG_H) $(CGRAPH_H) \
   $(GGC_H) except.h $(C_PRAGMA_H) $(INTEGRATE_H) $(TM_P_H) \
   $(TARGET_H) $(TARGET_DEF_H) debug.h langhooks.h $(DF_H) \
-  intl.h libfuncs.h $(PARAMS_H)
+  intl.h libfuncs.h $(PARAMS_H) $(OPTS_H)
 
 arm-c.o: $(srcdir)/config/arm/arm-c.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H)
index 0e05e724788e76dd90a7d2e11d461c784c4bbe04..32f74cdb14e3715bcbffb14672ac350a63af3be1 100644 (file)
@@ -1,5 +1,5 @@
 /* The Blackfin code generation auxiliary output file.
-   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Analog Devices.
 
@@ -56,6 +56,7 @@
 #include "timevar.h"
 #include "df.h"
 #include "sel-sched.h"
+#include "opts.h"
 
 /* A C structure for machine-specific, per-function data.
    This is added to the cfun structure.  */
@@ -2558,8 +2559,17 @@ bfin_class_likely_spilled_p (reg_class_t rclass)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-bfin_handle_option (size_t code, const char *arg, int value)
+bfin_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;
+  int value = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_mshared_library_id_:
index aec7cba63bb137da06b8df8076b39b0b92eee93f..37ccde461a033a79955b31667ab7288eedea1f8f 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for GCC.  Part of the machine description for CRIS.
    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-   2008, 2009, 2010  Free Software Foundation, Inc.
+   2008, 2009, 2010, 2011  Free Software Foundation, Inc.
    Contributed by Axis Communications.  Written by Hans-Peter Nilsson.
 
 This file is part of GCC.
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "optabs.h"
 #include "df.h"
+#include "opts.h"
 
 /* Usable when we have an amount to add or subtract, and want the
    optimal size of the insn.  */
@@ -136,7 +137,8 @@ static void cris_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
                                       const_tree, bool);
 static tree cris_md_asm_clobbers (tree, tree, tree);
 
-static bool cris_handle_option (size_t, const char *, int);
+static bool cris_handle_option (struct gcc_options *, struct gcc_options *,
+                               const struct cl_decoded_option *, location_t);
 static void cris_option_override (void);
 
 static bool cris_frame_pointer_required (void);
@@ -2338,9 +2340,17 @@ cris_asm_output_case_end (FILE *stream, int num, rtx table)
    cris_option_override.  */
 
 static bool
-cris_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED,
-                   int value ATTRIBUTE_UNUSED)
+cris_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 ATTRIBUTE_UNUSED = decoded->arg;
+  int value ATTRIBUTE_UNUSED = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_metrax100:
index 229b9feb7354d80867286612cd56693542d0dd7d..dac5323f10eafaa24ad35aaf9e9760397d867320 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007,
-   2008, 2009, 2010  Free Software Foundation, Inc.
+   2008, 2009, 2010, 2011  Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
 This file is part of GCC.
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "integrate.h"
 #include "langhooks.h"
 #include "df.h"
+#include "opts.h"
 
 #ifndef FRV_INLINE
 #define FRV_INLINE inline
@@ -260,7 +261,10 @@ frv_cpu_t frv_cpu_type = CPU_TYPE; /* value of -mcpu= */
 
 /* Forward references */
 
-static bool frv_handle_option                  (size_t, const char *, int);
+static bool frv_handle_option                  (struct gcc_options *,
+                                                struct gcc_options *,
+                                                const struct cl_decoded_option *,
+                                                location_t);
 static void frv_option_override                        (void);
 static bool frv_legitimate_address_p           (enum machine_mode, rtx, bool);
 static int frv_default_flags_for_cpu           (void);
@@ -630,8 +634,16 @@ frv_cannot_force_const_mem (rtx x ATTRIBUTE_UNUSED)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-frv_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+frv_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);
+
   switch (code)
     {
     case OPT_mcpu_:
index d158969eef341290e74d4b7a526d2e9dcb56f3aa..a7f6fa3aa49851239e9fac3c4780bddd1ac8251f 100644 (file)
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "sched-int.h"
 #include "sbitmap.h"
 #include "fibheap.h"
+#include "opts.h"
 
 enum upper_128bits_state
 {
@@ -2683,8 +2684,16 @@ ix86_using_red_zone (void)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
+ix86_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;
+  int value = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_mmmx:
@@ -4670,7 +4679,13 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[])
        }
 
       else if (type == ix86_opt_isa)
-       ix86_handle_option (opt, p, opt_set_p);
+       {
+         struct cl_decoded_option decoded;
+
+         generate_option (opt, NULL, opt_set_p, CL_TARGET, &decoded);
+         ix86_handle_option (&global_options, &global_options_set,
+                             &decoded, input_location);
+       }
 
       else if (type == ix86_opt_yes || type == ix86_opt_no)
        {
index 1c658a149dfe616092d83f69f97f681395f2acae..e9fa3cd8d6f6d34ef60c3b664378675ce0eca7df 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -23,7 +23,8 @@ i386.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   $(RECOG_H) $(EXPR_H) $(OPTABS_H) toplev.h $(BASIC_BLOCK_H) \
   $(GGC_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h $(CGRAPH_H) \
   $(TREE_GIMPLE_H) $(DWARF2_H) $(DF_H) tm-constrs.h $(PARAMS_H) \
-  i386-builtin-types.inc debug.h dwarf2out.h sbitmap.h $(FIBHEAP_H)
+  i386-builtin-types.inc debug.h dwarf2out.h sbitmap.h $(FIBHEAP_H) \
+  $(OPTS_H)
 
 i386-c.o: $(srcdir)/config/i386/i386-c.c \
   $(srcdir)/config/i386/i386-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \
index 55a55e8a593d7b670b0f2d9735109b5dc43f5085..c3d6303665dfafab9a487fa71133467ac5a65435 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler.
    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010
+   2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by James E. Wilson <wilson@cygnus.com> and
                  David Mosberger <davidm@hpl.hp.com>.
@@ -61,6 +61,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "sel-sched.h"
 #include "reload.h"
 #include "dwarf2out.h"
+#include "opts.h"
 
 /* This is used for communication between ASM_OUTPUT_LABEL and
    ASM_OUTPUT_LABELREF.  */
@@ -231,7 +232,8 @@ static int ia64_memory_move_cost (enum machine_mode mode, reg_class_t,
 static bool ia64_rtx_costs (rtx, int, int, int *, bool);
 static int ia64_unspec_may_trap_p (const_rtx, unsigned);
 static void fix_range (const char *);
-static bool ia64_handle_option (size_t, const char *, int);
+static bool ia64_handle_option (struct gcc_options *, struct gcc_options *,
+                               const struct cl_decoded_option *, location_t);
 static struct machine_function * ia64_init_machine_status (void);
 static void emit_insn_group_barriers (FILE *);
 static void emit_all_insn_group_barriers (FILE *);
@@ -5655,8 +5657,17 @@ fix_range (const char *const_str)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-ia64_handle_option (size_t code, const char *arg, int value)
+ia64_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;
+  int value = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_mfixed_range_:
index 3e82d71e39daf33941e535f228bbeb5baef08a32..4f013e2d591ae0b2541b2989fbb95ee73c1ebddc 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-# 2010
+# 2010, 2011
 # Free Software Foundation, Inc.
 #
 # This file is part of GCC.
@@ -54,4 +54,4 @@ ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
 # genattrtab generates very long string literals.
 insn-attrtab.o-warn = -Wno-error
 
-ia64.o: debug.h $(PARAMS_H) sel-sched.h reload.h
+ia64.o: debug.h $(PARAMS_H) sel-sched.h reload.h $(OPTS_H)
index b838fecb9f1a7449744214a4638dc3b0b3637b28..ca949e23a13af1b932831d86fe78516a2eaabcd7 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines used for code generation on Vitesse IQ2000 processors
-   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target-def.h"
 #include "langhooks.h"
 #include "df.h"
+#include "opts.h"
 
 /* Enumeration for all of the relational tests, so that we can build
    arrays indexed by the test type, and not worry about the order
@@ -145,7 +146,10 @@ static enum machine_mode gpr_mode;
 \f
 /* Initialize the GCC target structure.  */
 static struct machine_function* iq2000_init_machine_status (void);
-static bool iq2000_handle_option      (size_t, const char *, int);
+static bool iq2000_handle_option      (struct gcc_options *,
+                                      struct gcc_options *,
+                                      const struct cl_decoded_option *,
+                                      location_t);
 static void iq2000_option_override    (void);
 static section *iq2000_select_rtx_section (enum machine_mode, rtx,
                                           unsigned HOST_WIDE_INT);
@@ -1437,8 +1441,16 @@ iq2000_init_machine_status (void)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-iq2000_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+iq2000_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);
+
   switch (code)
     {
     case OPT_mcpu_:
index 56f9cf5ccca01d8d2efb3013cff7839d54d09d00..16f635770e747510a804e17ad52d87d9bf688a2c 100644 (file)
@@ -1,5 +1,5 @@
 /* Target Code for R8C/M16C/M32C
-   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Red Hat.
 
@@ -48,6 +48,7 @@
 #include "langhooks.h"
 #include "gimple.h"
 #include "df.h"
+#include "opts.h"
 
 /* Prototypes */
 
@@ -414,10 +415,16 @@ int ok_to_change_target_memregs = TRUE;
 #undef  TARGET_HANDLE_OPTION
 #define TARGET_HANDLE_OPTION m32c_handle_option
 static bool
-m32c_handle_option (size_t code,
-                   const char *arg ATTRIBUTE_UNUSED,
-                   int value ATTRIBUTE_UNUSED)
+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;
index 820aa8de1a1c1c8acb07bc0cd52432875e9b2ecf..648afb97538619d565fd2bb0e94e20abff12fcba 100644 (file)
@@ -42,6 +42,7 @@
 #include "target.h"
 #include "target-def.h"
 #include "tm-constrs.h"
+#include "opts.h"
 
 /* Array of valid operand punctuation characters.  */
 static char m32r_punct_chars[256];
@@ -61,7 +62,8 @@ enum m32r_sdata m32r_sdata = M32R_SDATA_DEFAULT;
 #define LIT_NAME_P(NAME) ((NAME)[0] == '*' && (NAME)[1] == '.')
 
 /* Forward declaration.  */
-static bool  m32r_handle_option (size_t, const char *, int);
+static bool  m32r_handle_option (struct gcc_options *, struct gcc_options *,
+                                const struct cl_decoded_option *, location_t);
 static void  m32r_option_override (void);
 static void  init_reg_tables (void);
 static void  block_move_call (rtx, rtx, rtx);
@@ -223,8 +225,17 @@ struct gcc_target targetm = TARGET_INITIALIZER;
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-m32r_handle_option (size_t code, const char *arg, int value)
+m32r_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;
+  int value = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_m32r:
index 5810aa43228d9daa8c5aea99e4af06c13e23dbb7..3a753858626aa85676c62e5e1300ed03dc3d98ee 100644 (file)
@@ -1,6 +1,6 @@
 /* Subroutines for insn-output.c for Motorola 68000 family.
    Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "sched-int.h"
 #include "insn-codes.h"
 #include "ggc.h"
+#include "opts.h"
 
 enum reg_class regno_reg_class[] =
 {
@@ -134,7 +135,8 @@ static int m68k_sched_first_cycle_multipass_dfa_lookahead (void);
 static bool m68k_can_eliminate (const int, const int);
 static void m68k_conditional_register_usage (void);
 static bool m68k_legitimate_address_p (enum machine_mode, rtx, bool);
-static bool m68k_handle_option (size_t, const char *, int);
+static bool m68k_handle_option (struct gcc_options *, struct gcc_options *,
+                               const struct cl_decoded_option *, location_t);
 static void m68k_option_override (void);
 static rtx find_addr_reg (rtx);
 static const char *singlemove_string (rtx *);
@@ -475,8 +477,17 @@ m68k_find_selection (const struct m68k_target_selection **entry,
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-m68k_handle_option (size_t code, const char *arg, int value)
+m68k_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;
+  int value = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_march_:
index 73bb45d6c66b2920f7d042523d09657b7006d4d6..1d75777eb1850e2ba8e66908b3699256a1b98936 100644 (file)
@@ -1,5 +1,6 @@
 /* Definitions for Toshiba Media Processor
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
    Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
@@ -50,6 +51,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "df.h"
 #include "gimple.h"
+#include "opts.h"
 
 /* Structure of this file:
 
@@ -220,7 +222,8 @@ static rtx mep_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
 static void mep_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
                                      const_tree, bool);
 static bool mep_vector_mode_supported_p (enum machine_mode);
-static bool mep_handle_option (size_t, const char *, int);
+static bool mep_handle_option (struct gcc_options *, struct gcc_options *,
+                              const struct cl_decoded_option *, location_t);
 static rtx  mep_allocate_initial_value (rtx);
 static void mep_asm_init_sections (void);
 static int mep_comp_type_attributes (const_tree, const_tree);
@@ -7257,11 +7260,15 @@ mep_address_cost (rtx addr ATTRIBUTE_UNUSED, bool ATTRIBUTE_UNUSED speed_p)
 }
 
 static bool
-mep_handle_option (size_t code,
-                  const char *arg ATTRIBUTE_UNUSED,
-                  int value ATTRIBUTE_UNUSED)
+mep_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
+                  const struct cl_decoded_option *decoded,
+                  location_t loc ATTRIBUTE_UNUSED)
 {
   int i;
+  size_t code = decoded->opt_index;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
 
   switch (code)
     {
index a38545f4a1b54a2848f654c270148ad2dab3354c..85295ef8f3b4fc586abbc120516114944f540dcb 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines used for code generation on Xilinx MicroBlaze.
-   Copyright 2009, 2010 Free Software Foundation, Inc.
+   Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
 
    Contributed by Michael Eager <eager@eagercon.com>.
 
@@ -48,6 +48,7 @@
 #include "df.h"
 #include "optabs.h"
 #include "diagnostic-core.h"
+#include "opts.h"
 
 #define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB)
 
@@ -1276,10 +1277,16 @@ microblaze_version_to_int (const char *version)
 }
 
 static bool
-microblaze_handle_option (size_t code,
-                         const char *arg ATTRIBUTE_UNUSED,
-                         int value ATTRIBUTE_UNUSED)
+microblaze_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;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_mno_clearbss:
index 11d8ff0369a32a21a043baf0bb8894aa25538577..878d33e1fa6e1e0a91694aaa864aa3b5271965a1 100644 (file)
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "bitmap.h"
 #include "diagnostic.h"
 #include "target-globals.h"
+#include "opts.h"
 
 /* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF.  */
 #define UNSPEC_ADDRESS_P(X)                                    \
@@ -15459,8 +15460,16 @@ mips_set_tune (const struct mips_cpu_info *info)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-mips_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+mips_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);
+
   switch (code)
     {
     case OPT_mabi_:
index 0b68f2d3e858a4560cbb0af51cec4acf8a3ed06b..cae3ea1fb529ca44668e718394c73d885deb54c7 100644 (file)
@@ -44,6 +44,7 @@
 #include "target.h"
 #include "target-def.h"
 #include "df.h"
+#include "opts.h"
 
 /* This is used in the am33_2.0-linux-gnu port, in which global symbol
    names are not prefixed by underscores, to tell whether to prefix a
@@ -90,10 +91,17 @@ static int cc_flags_for_code(enum rtx_code);
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-mn10300_handle_option (size_t code,
-                      const char *arg ATTRIBUTE_UNUSED,
-                      int value)
+mn10300_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;
+  int value = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_mam33:
index 98267b0ca63e9a817e76f24d4c1c38580d3a41e2..c5cd8712c669796d98ed007482bd15700ea71565 100644 (file)
@@ -1,6 +1,6 @@
 /* Subroutines for insn-output.c for HPPA.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Tim Moore (moore@cs.utah.edu), based on sparc.c
 
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target-def.h"
 #include "langhooks.h"
 #include "df.h"
+#include "opts.h"
 
 /* Return nonzero if there is a bypass for the output of 
    OUT_INSN and the fp store IN_INSN.  */
@@ -87,7 +88,8 @@ hppa_fpstore_bypass_p (rtx out_insn, rtx in_insn)
 static void pa_option_override (void);
 static void copy_reg_pointer (rtx, rtx);
 static void fix_range (const char *);
-static bool pa_handle_option (size_t, const char *, int);
+static bool pa_handle_option (struct gcc_options *, struct gcc_options *,
+                             const struct cl_decoded_option *, location_t);
 static int hppa_register_move_cost (enum machine_mode mode, reg_class_t,
                                    reg_class_t);
 static int hppa_address_cost (rtx, bool);
@@ -478,8 +480,16 @@ fix_range (const char *const_str)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-pa_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+pa_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);
+
   switch (code)
     {
     case OPT_mnosnake:
index b6ed97989fcf5bba480f40fb1cca56402272fd81..a5f9c37ba6c499648787fdf781c7aac1a1414154 100644 (file)
@@ -1,6 +1,6 @@
 /* Subroutines for gcc2 for pdp11.
    Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2004, 2005,
-   2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
    Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
 
 This file is part of GCC.
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "target-def.h"
 #include "df.h"
+#include "opts.h"
 
 /* this is the current value returned by the macro FIRST_PARM_OFFSET 
    defined in tm.h */
@@ -138,7 +139,8 @@ decode_pdp11_d (const struct real_format *fmt ATTRIBUTE_UNUSED,
 /* This is where the condition code register lives.  */
 /* rtx cc0_reg_rtx; - no longer needed? */
 
-static bool pdp11_handle_option (size_t, const char *, int);
+static bool pdp11_handle_option (struct gcc_options *, struct gcc_options *,
+                                const struct cl_decoded_option *, location_t);
 static void pdp11_option_init_struct (struct gcc_options *);
 static const char *singlemove_string (rtx *);
 static bool pdp11_assemble_integer (rtx, unsigned int, int);
@@ -245,9 +247,15 @@ static const struct default_options pdp11_option_optimization_table[] =
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-pdp11_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED,
-                    int value ATTRIBUTE_UNUSED)
+pdp11_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;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_m10:
index eca1b44f4ec3a5b5cc18b369be924df6ba1fa13b..c3ca018d48452387dfa9db925a496105396832a0 100644 (file)
@@ -58,6 +58,7 @@
 #include "intl.h"
 #include "params.h"
 #include "tm-constrs.h"
+#include "opts.h"
 #if TARGET_XCOFF
 #include "xcoffout.h"  /* get declarations of xcoff_*_section_name */
 #endif
@@ -1077,7 +1078,9 @@ static int get_element_number (tree, tree);
 static void rs6000_option_override (void);
 static void rs6000_option_init_struct (struct gcc_options *);
 static void rs6000_option_default_params (void);
-static bool rs6000_handle_option (size_t, const char *, int);
+static bool rs6000_handle_option (struct gcc_options *, struct gcc_options *,
+                                 const struct cl_decoded_option *,
+                                 location_t);
 static int rs6000_loop_align_max_skip (rtx);
 static void rs6000_parse_yes_no_option (const char *, const char *, int *);
 static int first_altivec_reg_to_save (void);
@@ -4208,11 +4211,19 @@ rs6000_builtin_vectorized_function (tree fndecl, tree type_out,
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-rs6000_handle_option (size_t code, const char *arg, int value)
+rs6000_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
+                     const struct cl_decoded_option *decoded,
+                     location_t loc ATTRIBUTE_UNUSED)
 {
   enum fpu_type_t fpu_type = FPU_NONE;
   int isel;
   char *p, *q;
+  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)
     {
index 925870ee1c192203958ca137539976f174fa4f0a..bfc793f489eabd0b387bce8ca67b5f289dbb30b1 100644 (file)
@@ -1,7 +1,7 @@
 # General rules that all rs6000/ targets must have.
 #
 # Copyright (C) 1995, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2008, 2009,
-# 2010 Free Software Foundation, Inc.
+# 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -27,7 +27,7 @@ rs6000.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   $(OBSTACK_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) except.h function.h \
   output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) toplev.h $(GGC_H) $(HASHTAB_H) \
   $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h gt-rs6000.h \
-  cfglayout.h cfgloop.h
+  cfglayout.h cfgloop.h $(OPTS_H)
 
 rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c \
     $(srcdir)/config/rs6000/rs6000-protos.h \
index 592f3118ddf82b65669b2ad222b0773301508dd2..bec921b1effc8969f1424a07298d185752564971 100644 (file)
@@ -50,6 +50,7 @@
 #include "target.h"
 #include "target-def.h"
 #include "langhooks.h"
+#include "opts.h"
 \f
 static void rx_print_operand (FILE *, rtx, int);
 
@@ -2251,8 +2252,17 @@ const struct attribute_spec rx_attribute_table[] =
 /* Extra processing for target specific command line options.  */
 
 static bool
-rx_handle_option (size_t code, const char *  arg ATTRIBUTE_UNUSED, int value)
+rx_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;
+  int value = decoded->value;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_mint_register_:
index ab1005a6c8aa38819c2354af5acfe76bec4901b2..33518be41d30321d973d9a21ef884600bce5abe1 100644 (file)
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "df.h"
 #include "params.h"
 #include "cfgloop.h"
+#include "opts.h"
 
 
 /* Define the specific costs for a given cpu.  */
@@ -1588,8 +1589,16 @@ s390_handle_arch_option (const char *arg,
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-s390_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+s390_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);
+
   switch (code)
     {
     case OPT_march_:
index 99695bfc5cbddbd2e0baed02d9ec69f7a9bc89f5..ddb04cb1451df66d0b9259acbb3da03496a56d56 100644 (file)
@@ -1,5 +1,6 @@
 /* Output routines for Sunplus S+CORE processor
-   Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
    Contributed by Sunnorth.
 
    This file is part of GCC.
@@ -48,6 +49,7 @@
 #include "langhooks.h"
 #include "score7.h"
 #include "df.h"
+#include "opts.h"
 
 static void score_option_override (void);
 
@@ -281,8 +283,16 @@ score_asm_file_end (void)
 
 /* Implement TARGET_HANDLE_OPTION.  */
 static bool
-score_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+score_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);
+
   switch (code)
     {
     case OPT_mscore7d:
index 70bff999fc75e2f267cceda3390433cb672389da..bbeb7a258ddd38b0c0a8275317d8befbb6033c9b 100644 (file)
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfgloop.h"
 #include "alloc-pool.h"
 #include "tm-constrs.h"
+#include "opts.h"
 
 
 int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
@@ -167,7 +168,8 @@ int assembler_dialect;
 
 static bool shmedia_space_reserved_for_target_registers;
 
-static bool sh_handle_option (size_t, const char *, int);
+static bool sh_handle_option (struct gcc_options *, struct gcc_options *,
+                             const struct cl_decoded_option *, location_t);
 static void split_branches (rtx);
 static int branch_dest (rtx);
 static void force_into (rtx, rtx);
@@ -604,9 +606,15 @@ struct gcc_target targetm = TARGET_INITIALIZER;
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-sh_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED,
-                 int value ATTRIBUTE_UNUSED)
+sh_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;
+
+  gcc_assert (opts == &global_options);
+  gcc_assert (opts_set == &global_options_set);
+
   switch (code)
     {
     case OPT_m1:
index 03edae50adf70ae0c8a9dc69fab4d826c77b4fd0..149990d825b4ff00d60f6013b095747f545a2338 100644 (file)
@@ -1,6 +1,7 @@
 /* Subroutines for insn-output.c for SPARC.
    Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
    Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
    64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
@@ -54,6 +55,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "params.h"
 #include "df.h"
 #include "dwarf2out.h"
+#include "opts.h"
 
 /* Processor costs */
 static const
@@ -365,7 +367,8 @@ static HOST_WIDE_INT frame_base_offset;
 /* 1 if the next opcode is to be specially indented.  */
 int sparc_indent_opcode = 0;
 
-static bool sparc_handle_option (size_t, const char *, int);
+static bool sparc_handle_option (struct gcc_options *, struct gcc_options *,
+                                const struct cl_decoded_option *, location_t);
 static void sparc_option_override (void);
 static void sparc_init_modes (void);
 static void scan_record_type (const_tree, int *, int *, int *);
@@ -677,8 +680,16 @@ struct gcc_target targetm = TARGET_INITIALIZER;
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-sparc_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+sparc_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);
+
   switch (code)
     {
     case OPT_mfpu:
index e3a19ff5e58174102b4ddf33a58a603b3f345010..4a87bff10e76952f18f354112f64e95beb8a7621 100644 (file)
@@ -42,6 +42,7 @@
 #include "target.h"
 #include "target-def.h"
 #include "df.h"
+#include "opts.h"
 
 #ifndef streq
 #define streq(a,b) (strcmp (a, b) == 0)
@@ -109,8 +110,16 @@ v850_handle_memory_option (enum small_memory_type type, const char *value)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-v850_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+v850_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);
+
   switch (code)
     {
     case OPT_mspace:
index 85e1d88eec91ff97c0c36f261af14cf4c7ef65e4..2afb55b496f179508aa3269c7001428c4cb3fdc5 100644 (file)
@@ -664,21 +664,18 @@ Its default setting is 0.
 @cindex optional hardware or system features
 @cindex features, optional, in system conventions
 
-@deftypefn {Target Hook} bool TARGET_HANDLE_OPTION (size_t @var{code}, const char *@var{arg}, int @var{value})
+@deftypefn {Target Hook} bool TARGET_HANDLE_OPTION (struct gcc_options *@var{opts}, struct gcc_options *@var{opts_set}, const struct cl_decoded_option *@var{decoded}, unsigned int @var{loc})
 This hook is called whenever the user specifies one of the
 target-specific options described by the @file{.opt} definition files
 (@pxref{Options}).  It has the opportunity to do some option-specific
 processing and should return true if the option is valid.  The default
 definition does nothing but return true.
 
-@var{code} specifies the @code{OPT_@var{name}} enumeration value
-associated with the selected option; @var{name} is just a rendering of
-the option name in which non-alphanumeric characters are replaced by
-underscores.  @var{arg} specifies the string argument and is null if
-no argument was given.  If the option is flagged as a @code{UInteger}
-(@pxref{Option properties}), @var{value} is the numeric value of the
-argument.  Otherwise @var{value} is 1 if the positive form of the
-option was used and 0 if the ``no-'' form was.
+@var{decoded} specifies the option and its arguments.  @var{opts} and
+@var{opts_set} are the @code{gcc_options} structures to be used for
+storing option state, and @var{loc} is the location at which the
+option was passed (@code{UNKNOWN_LOCATION} except for options passed
+via attributes).
 @end deftypefn
 
 @deftypefn {Target Hook} bool TARGET_HANDLE_C_OPTION (size_t @var{code}, const char *@var{arg}, int @var{value})
index a799bc43564c8fc6a67d8cda2ecdb8d201276554..2ceefdc085c9a42f6ae5fd46599a9192438a2bc4 100644 (file)
@@ -671,14 +671,11 @@ target-specific options described by the @file{.opt} definition files
 processing and should return true if the option is valid.  The default
 definition does nothing but return true.
 
-@var{code} specifies the @code{OPT_@var{name}} enumeration value
-associated with the selected option; @var{name} is just a rendering of
-the option name in which non-alphanumeric characters are replaced by
-underscores.  @var{arg} specifies the string argument and is null if
-no argument was given.  If the option is flagged as a @code{UInteger}
-(@pxref{Option properties}), @var{value} is the numeric value of the
-argument.  Otherwise @var{value} is 1 if the positive form of the
-option was used and 0 if the ``no-'' form was.
+@var{decoded} specifies the option and its arguments.  @var{opts} and
+@var{opts_set} are the @code{gcc_options} structures to be used for
+storing option state, and @var{loc} is the location at which the
+option was passed (@code{UNKNOWN_LOCATION} except for options passed
+via attributes).
 @end deftypefn
 
 @hook TARGET_HANDLE_C_OPTION
index f859dd96507155f29ee0a0a16e5d89fd4eab15e4..594e34408bd72103efb9c5bd4690b198699912f5 100644 (file)
@@ -1,5 +1,5 @@
 /* General-purpose hooks.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -126,14 +126,6 @@ hook_bool_const_tree_hwi_hwi_const_tree_true (const_tree a ATTRIBUTE_UNUSED,
   return true;
 }
 
-bool
-hook_bool_size_t_constcharptr_int_true (size_t a ATTRIBUTE_UNUSED,
-                                       const char *b ATTRIBUTE_UNUSED,
-                                       int c ATTRIBUTE_UNUSED)
-{
-  return true;
-}
-
 bool
 default_can_output_mi_thunk_no_vcall (const_tree a ATTRIBUTE_UNUSED,
                                      HOST_WIDE_INT b ATTRIBUTE_UNUSED,
index 7962fe818ba028e02a49af1f8d979001b021ff76..90e3a14ae9a00781d51b8d2c96faabb78f54aa09 100644 (file)
@@ -1,5 +1,5 @@
 /* General-purpose hooks.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -50,7 +50,6 @@ extern bool hook_bool_rtx_false (rtx);
 extern bool hook_bool_rtx_int_false (rtx, int);
 extern bool hook_bool_uintp_uintp_false (unsigned int *, unsigned int *);
 extern bool hook_bool_rtx_int_int_intp_bool_false (rtx, int, int, int *, bool);
-extern bool hook_bool_size_t_constcharptr_int_true (size_t, const char *, int);
 extern bool hook_bool_tree_tree_false (tree, tree);
 extern bool hook_bool_tree_tree_true (tree, tree);
 extern bool hook_bool_tree_bool_false (tree, bool);
index 3f80e91b5b13238d117b33f154ef6afcf94675ab..ec4e78daf39b3a15b817ed4a67ccf5e946a686d2 100644 (file)
@@ -1,6 +1,6 @@
 /* LTO IL options.
 
-   Copyright 2009, 2010 Free Software Foundation, Inc.
+   Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
    Contributed by Simon Baldwin <simonb@google.com>
 
 This file is part of GCC.
@@ -413,7 +413,12 @@ lto_reissue_options (void)
                    DK_UNSPECIFIED, UNKNOWN_LOCATION, global_dc);
 
       if (o->type == CL_TARGET)
-       targetm.handle_option (o->code, o->arg, o->value);
+       {
+         struct cl_decoded_option decoded;
+         generate_option (o->code, o->arg, o->value, CL_TARGET, &decoded);
+         targetm.handle_option (&global_options, &global_options_set,
+                                &decoded, UNKNOWN_LOCATION);
+       }
       else if (o->type == CL_COMMON)
        gcc_assert (flag_var);
       else
index 9f93356539f5f37d07874f5326cc882e8b65f9ae..5ea5fac4794421ef8121fd6fa84c943c37f5b578 100644 (file)
@@ -225,21 +225,13 @@ target_handle_option (struct gcc_options *opts,
                      struct gcc_options *opts_set,
                      const struct cl_decoded_option *decoded,
                      unsigned int lang_mask ATTRIBUTE_UNUSED, int kind,
-                     location_t loc ATTRIBUTE_UNUSED,
+                     location_t loc,
                      const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED,
                      diagnostic_context *dc)
 {
-  gcc_assert (opts == &global_options);
-  gcc_assert (opts_set == &global_options_set);
   gcc_assert (dc == global_dc);
-  gcc_assert (decoded->canonical_option_num_elements <= 2);
   gcc_assert (kind == DK_UNSPECIFIED);
-  /* Although the location is not passed down to
-     targetm.handle_option, do not make assertions about its value;
-     options may come from optimize attributes and having the correct
-     location in the handler is not generally important.  */
-  return targetm.handle_option (decoded->opt_index, decoded->arg,
-                               decoded->value);
+  return targetm.handle_option (opts, opts_set, decoded, loc);
 }
 
 /* Add comma-separated strings to a char_p vector.  */
index 57134cbc61155424e454b642dfb14937cdd8fd23..75c821f2327636549c3205ec67475dd6cc14e549 100644 (file)
@@ -1,5 +1,6 @@
 /* Target hook definitions.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -1072,16 +1073,15 @@ DEFHOOK
  void, (void),
  hook_void_void)
 
-/* Handle target switch CODE (an OPT_* value).  ARG is the argument
-   passed to the switch; it is NULL if no argument was.  VALUE is the
-   value of ARG if CODE specifies a UInteger option, otherwise it is
-   1 if the positive form of the switch was used and 0 if the negative
-   form was.  Return true if the switch was valid.  */
+/* Handle target switch DECODED for options structures OPTS and
+   OPTS_SET, at location LOC.  Return true if the switch was valid.  */
 DEFHOOK
 (handle_option,
  "",
- bool, (size_t code, const char *arg, int value),
- hook_bool_size_t_constcharptr_int_true)
+ bool, (struct gcc_options *opts, struct gcc_options *opts_set,
+       const struct cl_decoded_option *decoded,
+       unsigned int /*location_t*/ loc),
+ default_target_handle_option)
 
 /* Display extra, target specific information in response to a
    --target-help switch.  */
index 6411973b8b98944f5def60ae9372c9e7e1c2d139..7de00134429cca421205b2ea6565edb10097dc69 100644 (file)
@@ -1,5 +1,5 @@
 /* Default target hook functions.
-   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -1513,6 +1513,17 @@ default_pch_valid_p (const void *data_p, size_t len)
   return NULL;
 }
 
+/* Default version of TARGET_HANDLE_OPTION.  */
+
+bool
+default_target_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
+                             struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                             const struct cl_decoded_option *decoded ATTRIBUTE_UNUSED,
+                             location_t loc ATTRIBUTE_UNUSED)
+{
+  return true;
+}
+
 const struct default_options empty_optimization_table[] =
   {
     { OPT_LEVELS_NONE, 0, NULL, 0 }
index a8dbb11e716e2dcafaf8ec8ae49221ac41f809d9..a2d2075ea35a5b93ba7a22f87e9314ce07328c0a 100644 (file)
@@ -1,5 +1,5 @@
 /* Default target hook functions.
-   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -181,5 +181,10 @@ extern enum machine_mode default_get_reg_raw_mode(int);
 
 extern const struct default_options empty_optimization_table[];
 
+extern bool default_target_handle_option (struct gcc_options *,
+                                         struct gcc_options *,
+                                         const struct cl_decoded_option *,
+                                         location_t);
+
 extern void *default_get_pch_validity (size_t *);
 extern const char *default_pch_valid_p (const void *, size_t);