+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
#include "tm-constrs.h"
#include "df.h"
#include "libfuncs.h"
+#include "opts.h"
/* Specify which cpu to schedule for. */
enum processor_type alpha_tune;
/* 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:
#include "intl.h"
#include "libfuncs.h"
#include "params.h"
+#include "opts.h"
/* Forward definitions of types. */
typedef struct minipool_node Mnode;
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);
/* 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_:
# 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.
$(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)
/* 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.
#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. */
/* 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_:
/* 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.
#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. */
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);
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:
/* 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.
#include "integrate.h"
#include "langhooks.h"
#include "df.h"
+#include "opts.h"
#ifndef FRV_INLINE
#define FRV_INLINE inline
/* 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);
/* 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_:
#include "sched-int.h"
#include "sbitmap.h"
#include "fibheap.h"
+#include "opts.h"
enum upper_128bits_state
{
/* 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:
}
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)
{
-# 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.
#
$(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 \
/* 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>.
#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. */
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 *);
/* 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_:
# 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.
# 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)
/* 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.
#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
\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);
/* 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_:
/* 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.
#include "langhooks.h"
#include "gimple.h"
#include "df.h"
+#include "opts.h"
/* Prototypes */
#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;
#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];
#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);
/* 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:
/* 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.
#include "sched-int.h"
#include "insn-codes.h"
#include "ggc.h"
+#include "opts.h"
enum reg_class regno_reg_class[] =
{
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 *);
/* 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_:
/* 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.
#include "langhooks.h"
#include "df.h"
#include "gimple.h"
+#include "opts.h"
/* Structure of this file:
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);
}
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)
{
/* 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>.
#include "df.h"
#include "optabs.h"
#include "diagnostic-core.h"
+#include "opts.h"
#define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB)
}
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:
#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) \
/* 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_:
#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
/* 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:
/* 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
#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. */
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);
/* 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:
/* 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.
#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 */
/* 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);
/* 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:
#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
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);
/* 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)
{
# 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.
#
$(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 \
#include "target.h"
#include "target-def.h"
#include "langhooks.h"
+#include "opts.h"
\f
static void rx_print_operand (FILE *, rtx, int);
/* 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_:
#include "df.h"
#include "params.h"
#include "cfgloop.h"
+#include "opts.h"
/* Define the specific costs for a given cpu. */
/* 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_:
/* 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.
#include "langhooks.h"
#include "score7.h"
#include "df.h"
+#include "opts.h"
static void score_option_override (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:
#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;
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);
/* 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:
/* 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,
#include "params.h"
#include "df.h"
#include "dwarf2out.h"
+#include "opts.h"
/* Processor costs */
static const
/* 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 *);
/* 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:
#include "target.h"
#include "target-def.h"
#include "df.h"
+#include "opts.h"
#ifndef streq
#define streq(a,b) (strcmp (a, b) == 0)
/* 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:
@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})
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
/* 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
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,
/* 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
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);
/* 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.
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
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. */
/* 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
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. */
/* 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.
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 }
/* 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.
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);