diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-11-01 23:40:53 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2010-11-01 23:40:53 +0000 |
commit | 6d721f6786362871895a36e4f26f09ded82d55ec (patch) | |
tree | be84a860792ba431691dc4ae4d157c559eb86a4a /gcc | |
parent | 2debdb4fcd1064967709bd839e4b751f480f7fbd (diff) | |
download | gcc-6d721f6786362871895a36e4f26f09ded82d55ec.zip gcc-6d721f6786362871895a36e4f26f09ded82d55ec.tar.gz gcc-6d721f6786362871895a36e4f26f09ded82d55ec.tar.bz2 |
common.opt (R, [...]): New.
* common.opt (R, T, Tbss, Tdata, Ttext, h, z): New.
* defaults.h (DEFAULT_SWITCH_TAKES_ARG, SWITCH_TAKES_ARG): Remove.
(DEFAULT_WORD_SWITCH_TAKES_ARG): Define to 0.
* doc/tm.texi.in (SWITCH_TAKES_ARG): Remove.
(WORD_SWITCH_TAKES_ARG): Don't refer to SWITCH_TAKES_ARG.
Document that options in .opt files do not need to be included.
* doc/tm.texi: Regenerate.
* gcc.c (LINK_COMMAND_SPEC): Don't include %{x}.
* opts-common.c: Update comment on tm.h include.
(decode_cmdline_option): Don't use SWITCH_TAKES_ARG.
* system.h (SWITCH_TAKES_ARG): Poison.
* config/alpha/alpha.h (SWITCH_TAKES_ARG): Remove.
* config/darwin.h (WORD_SWITCH_TAKES_ARG): Remove options included
in darwin.opt.
(LINK_COMMAND_SPEC_A): Don't include %{x}.
* config/fr30/fr30.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG):
Remove.
* config/freebsd-spec.h (FBSD_SWITCH_TAKES_ARG): Remove.
* config/freebsd.h (SWITCH_TAKES_ARG): Remove.
* config/frv/frv.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG):
Remove.
* config/i386/djgpp.h (LINK_COMMAND_SPEC): Don't include %{x}.
* config/ia64/ia64.h (SWITCH_TAKES_ARG): Remove.
* config/interix.h (WORD_SWITCH_TAKES_ARG): Don't handle -T
options.
* config/lm32/lm32.h (SWITCH_TAKES_ARG): Remove.
* config/m32r/m32r.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG):
Remove.
* config/microblaze/microblaze.h (SWITCH_TAKES_ARG): Remove.
* config/mips/mips.h (SWITCH_TAKES_ARG): Remove.
* config/mips/netbsd.h (SWITCH_TAKES_ARG): Remove.
* config/mips/vxworks.h (SWITCH_TAKES_ARG): Remove.
* config/netbsd-aout.h (SWITCH_TAKES_ARG): Remove.
* config/netbsd-elf.h (SWITCH_TAKES_ARG): Remove.
* config/openbsd.h (SWITCH_TAKES_ARG): Remove.
* config/rs6000/sysv4.h (SWITCH_TAKES_ARG): Remove.
* config/score/score.h (SWITCH_TAKES_ARG): Remove.
* config/sol2.h (SWITCH_TAKES_ARG): Remove.
* config/sparc/sp-elf.h (SWITCH_TAKES_ARG): Remove.
* config/sparc/sp64-elf.h (SWITCH_TAKES_ARG): Remove.
* config/sparc/sparc.h (ASM_SPEC): Don't include %{R}.
* config/svr4.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove.
From-SVN: r166155
Diffstat (limited to 'gcc')
33 files changed, 99 insertions, 271 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed19253..0c2f666 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,48 @@ +2010-11-01 Joseph Myers <joseph@codesourcery.com> + + * common.opt (R, T, Tbss, Tdata, Ttext, h, z): New. + * defaults.h (DEFAULT_SWITCH_TAKES_ARG, SWITCH_TAKES_ARG): Remove. + (DEFAULT_WORD_SWITCH_TAKES_ARG): Define to 0. + * doc/tm.texi.in (SWITCH_TAKES_ARG): Remove. + (WORD_SWITCH_TAKES_ARG): Don't refer to SWITCH_TAKES_ARG. + Document that options in .opt files do not need to be included. + * doc/tm.texi: Regenerate. + * gcc.c (LINK_COMMAND_SPEC): Don't include %{x}. + * opts-common.c: Update comment on tm.h include. + (decode_cmdline_option): Don't use SWITCH_TAKES_ARG. + * system.h (SWITCH_TAKES_ARG): Poison. + * config/alpha/alpha.h (SWITCH_TAKES_ARG): Remove. + * config/darwin.h (WORD_SWITCH_TAKES_ARG): Remove options included + in darwin.opt. + (LINK_COMMAND_SPEC_A): Don't include %{x}. + * config/fr30/fr30.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): + Remove. + * config/freebsd-spec.h (FBSD_SWITCH_TAKES_ARG): Remove. + * config/freebsd.h (SWITCH_TAKES_ARG): Remove. + * config/frv/frv.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): + Remove. + * config/i386/djgpp.h (LINK_COMMAND_SPEC): Don't include %{x}. + * config/ia64/ia64.h (SWITCH_TAKES_ARG): Remove. + * config/interix.h (WORD_SWITCH_TAKES_ARG): Don't handle -T + options. + * config/lm32/lm32.h (SWITCH_TAKES_ARG): Remove. + * config/m32r/m32r.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): + Remove. + * config/microblaze/microblaze.h (SWITCH_TAKES_ARG): Remove. + * config/mips/mips.h (SWITCH_TAKES_ARG): Remove. + * config/mips/netbsd.h (SWITCH_TAKES_ARG): Remove. + * config/mips/vxworks.h (SWITCH_TAKES_ARG): Remove. + * config/netbsd-aout.h (SWITCH_TAKES_ARG): Remove. + * config/netbsd-elf.h (SWITCH_TAKES_ARG): Remove. + * config/openbsd.h (SWITCH_TAKES_ARG): Remove. + * config/rs6000/sysv4.h (SWITCH_TAKES_ARG): Remove. + * config/score/score.h (SWITCH_TAKES_ARG): Remove. + * config/sol2.h (SWITCH_TAKES_ARG): Remove. + * config/sparc/sp-elf.h (SWITCH_TAKES_ARG): Remove. + * config/sparc/sp64-elf.h (SWITCH_TAKES_ARG): Remove. + * config/sparc/sparc.h (ASM_SPEC): Don't include %{R}. + * config/svr4.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. + 2010-11-01 Paul Koning <ni1d@arrl.net> * config/pdp11/pdp11.md: Use iterators. diff --git a/gcc/common.opt b/gcc/common.opt index a74d60d..cd8b0ad 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -290,9 +290,24 @@ Ofast Common Optimization Optimize for speed disregarding exact standards compliance +R +Driver Joined Separate + S Driver +T +Driver Joined Separate + +Tbss +Driver Separate + +Tdata +Driver Separate + +Ttext +Driver Separate + W Common RejectNegative Warning Alias(Wextra) This switch is deprecated; use -Wextra instead @@ -1885,6 +1900,9 @@ gxcoff+ Common JoinedOrMissing Negative(gcoff) Generate debug information in extended XCOFF format +h +Driver Joined Separate + iplugindir= Common Joined Var(plugindir_string) Init(0) -iplugindir=<dir> Set <dir> to be the default plugin directory @@ -2026,4 +2044,7 @@ pie Common RejectNegative Negative(shared) Create a position independent executable +z +Driver Joined Separate + ; This comment is to ensure we retain the blank line above. diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 21db01c..7681b4b 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -96,9 +96,6 @@ along with GCC; see the file COPYING3. If not see while (0) #endif -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - #define WORD_SWITCH_TAKES_ARG(STR) \ (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR)) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index f6b88f9..cd938cf 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -226,7 +226,6 @@ extern GTY(()) int darwin_ms_struct; !strcmp (STR, "sub_library") ? 1 : \ !strcmp (STR, "sub_umbrella") ? 1 : \ !strcmp (STR, "Zumbrella") ? 1 : \ - !strcmp (STR, "undefined") ? 1 : \ !strcmp (STR, "Zunexported_symbols_list") ? 1 : \ !strcmp (STR, "Zweak_reference_mismatches") ? 1 : \ !strcmp (STR, "pagezero_size") ? 1 : \ @@ -236,7 +235,6 @@ extern GTY(()) int darwin_ms_struct; !strcmp (STR, "sectobjectsymbols") ? 2 : \ !strcmp (STR, "segcreate") ? 3 : \ !strcmp (STR, "dylinker_install_name") ? 1 : \ - !strcmp (STR, "iframework") ? 1 : \ 0) #define SUBTARGET_C_COMMON_OVERRIDE_OPTIONS do { \ @@ -271,7 +269,7 @@ extern GTY(()) int darwin_ms_struct; #define LINK_COMMAND_SPEC_A \ "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %(linker) %l %X %{d} %{s} %{t} %{Z} %{u*} \ - %{A} %{e*} %{m} %{r} %{x} \ + %{A} %{e*} %{m} %{r} \ %{o*}%{!o:-o a.out} \ %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \ %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \ diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h index 0ea72fd..ac42145 100644 --- a/gcc/config/fr30/fr30.h +++ b/gcc/config/fr30/fr30.h @@ -22,15 +22,6 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ /*}}}*/ -/*{{{ Driver configuration. */ - -/* Defined in svr4.h. */ -#undef SWITCH_TAKES_ARG - -/* Defined in svr4.h. */ -#undef WORD_SWITCH_TAKES_ARG - -/*}}}*/ /*{{{ Run-time target specifications. */ #undef ASM_SPEC diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h index 84d8127..7e08e78 100644 --- a/gcc/config/freebsd-spec.h +++ b/gcc/config/freebsd-spec.h @@ -1,5 +1,6 @@ /* Base configuration file for all FreeBSD targets. - Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009, 2010 + Free Software Foundation, Inc. This file is part of GCC. @@ -33,17 +34,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* In case we need to know. */ #define USING_CONFIG_FREEBSD_SPEC 1 -/* This defines which switch letters take arguments. On FreeBSD, most of - the normal cases (defined in gcc.c) apply, and we also have -h* and - -z* options (for the linker) (coming from SVR4). - We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ - -#define FBSD_SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ - || (CHAR) == 'h' \ - || (CHAR) == 'z' /* ignored by ld */ \ - || (CHAR) == 'R') - /* This defines which multi-letter switches take arguments. */ #define FBSD_WORD_SWITCH_TAKES_ARG(STR) \ diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h index 591ce1a..8381189 100644 --- a/gcc/config/freebsd.h +++ b/gcc/config/freebsd.h @@ -30,13 +30,8 @@ along with GCC; see the file COPYING3. If not see /* In case we need to know. */ #define USING_CONFIG_FREEBSD 1 -/* This defines which switch letters take arguments. On FreeBSD, most of - the normal cases (defined in gcc.c) apply, and we also have -h* and - -z* options (for the linker) (coming from SVR4). - We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR)) +/* This defines which switch words take arguments. + We have --assert etc. */ #undef WORD_SWITCH_TAKES_ARG #define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR)) diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index fc0f293..8a2907d 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -35,33 +35,6 @@ /* Driver configuration. */ -/* A C expression which determines whether the option `-CHAR' takes arguments. - The value should be the number of arguments that option takes-zero, for many - options. - - By default, this macro is defined to handle the standard options properly. - You need not define it unless you wish to add additional options which take - arguments. - - Defined in svr4.h. */ -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - -/* A C expression which determines whether the option `-NAME' takes arguments. - The value should be the number of arguments that option takes-zero, for many - options. This macro rather than `SWITCH_TAKES_ARG' is used for - multi-character option names. - - By default, this macro is defined as `DEFAULT_WORD_SWITCH_TAKES_ARG', which - handles the standard options properly. You need not define - `WORD_SWITCH_TAKES_ARG' unless you wish to add additional options which take - arguments. Any redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and - then check for additional options. - - Defined in svr4.h. */ -#undef WORD_SWITCH_TAKES_ARG - /* -fpic and -fPIC used to imply the -mlibrary-pic multilib, but with FDPIC which multilib to use depends on whether FDPIC is in use or not. The trick we use is to introduce -multilib-library-pic as a diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h index e95ee49..2a8cef6 100644 --- a/gcc/config/i386/djgpp.h +++ b/gcc/config/i386/djgpp.h @@ -102,7 +102,7 @@ along with GCC; see the file COPYING3. If not see #define LINK_COMMAND_SPEC \ "%{!fsyntax-only: \ %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \ -\t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\ +\t%{r} %{s} %{t} %{u*} %{z} %{Z}\ \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ \t%{static:} %{L*} %D %o\ \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\ diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index fbee1e71..fdac455 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -53,9 +53,6 @@ do { \ #define ASM_EXTRA_SPEC "" -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - /* Variables which are this size or smaller are put in the sdata/sbss sections. */ extern unsigned int ia64_section_threshold; diff --git a/gcc/config/interix.h b/gcc/config/interix.h index b94f357..67698a9 100644 --- a/gcc/config/interix.h +++ b/gcc/config/interix.h @@ -1,6 +1,6 @@ /* Operating system specific defines to be used when targeting GCC for Interix - Copyright (C) 1994, 1995, 1999, 2002, 2004, 2007 + Copyright (C) 1994, 1995, 1999, 2002, 2004, 2007, 2010 Free Software Foundation, Inc. Donn Terry, Softway Systems, Inc. (donn@softway.com) Modified from code @@ -59,11 +59,9 @@ for windows/multi thread */ "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}} %{shared:crti%O%s}" #undef WORD_SWITCH_TAKES_ARG -#define WORD_SWITCH_TAKES_ARG(STR) \ - ((DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ - || !strcmp(STR, "rpath")) \ - && strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \ - && strcmp (STR, "Tbss")) +#define WORD_SWITCH_TAKES_ARG(STR) \ + (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ + || !strcmp(STR, "rpath")) #define STDC_0_IN_SYSTEM_HEADERS 1 diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h index bcea41a..c87c3bb 100644 --- a/gcc/config/lm32/lm32.h +++ b/gcc/config/lm32/lm32.h @@ -68,12 +68,6 @@ #undef LIB_SPEC #define LIB_SPEC "%{!T*:-T sim.ld}" -/* Add -G xx support. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ -(DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - #undef CC1_SPEC #define CC1_SPEC "%{G*}" diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index a645518..785d85b 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -22,8 +22,6 @@ - longlong.h? */ -#undef SWITCH_TAKES_ARG -#undef WORD_SWITCH_TAKES_ARG #undef HANDLE_SYSV_PRAGMA #undef SIZE_TYPE #undef PTRDIFF_TYPE @@ -94,12 +92,6 @@ #define TARGET_VERSION fprintf (stderr, " (m32r)") #endif -/* Switch Recognition by gcc.c. Add -G xx support. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ -(DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - /* Names to predefine in the preprocessor for this target machine. */ /* __M32R__ is defined by the existing compiler so we use that. */ #define TARGET_CPU_CPP_BUILTINS() \ diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h index 0145cb3..2ce22f1 100644 --- a/gcc/config/microblaze/microblaze.h +++ b/gcc/config/microblaze/microblaze.h @@ -57,10 +57,6 @@ extern enum pipeline_type microblaze_pipe; /* Macros to decide whether certain features are available or not, depending on the instruction set architecture level. */ -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - #define DRIVER_SELF_SPECS \ "%{mxl-soft-mul:%<mno-xl-soft-mul}", \ "%{mno-xl-barrel-shift:%<mxl-barrel-shift}", \ diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index d6d909b..a367503 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -1075,12 +1075,6 @@ enum mips_code_readable_setting { /* The CACHE instruction is available. */ #define ISA_HAS_CACHE (TARGET_CACHE_BUILTIN && !TARGET_MIPS16) -/* Add -G xx support. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - #define CONDITIONAL_REGISTER_USAGE mips_conditional_register_usage () /* Tell collect what flags to pass to nm. */ diff --git a/gcc/config/mips/netbsd.h b/gcc/config/mips/netbsd.h index 636e3ad..ff32858 100644 --- a/gcc/config/mips/netbsd.h +++ b/gcc/config/mips/netbsd.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for MIPS NetBSD systems. Copyright (C) 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, - 2007 Free Software Foundation, Inc. + 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -170,16 +170,6 @@ along with GCC; see the file COPYING3. If not see #define MIPS_DEFAULT_GVALUE 0 -/* This defines which switch letters take arguments. -G is a MIPS - special. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ - || (CHAR) == 'R' \ - || (CHAR) == 'G') - - #undef ASM_FINAL_SPEC #undef SET_ASM_OP diff --git a/gcc/config/mips/vxworks.h b/gcc/config/mips/vxworks.h index f77d62b..3c2d94f 100644 --- a/gcc/config/mips/vxworks.h +++ b/gcc/config/mips/vxworks.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1999, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2003, 2004, 2007, 2008, 2010 + Free Software Foundation, Inc. This file is part of GCC. @@ -19,15 +20,6 @@ along with GCC; see the file COPYING3. If not see #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (MIPS, VxWorks syntax)"); -/* Combination of mips.h and svr4.h. */ -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ - || (CHAR) == 'G' \ - || (CHAR) == 'h' \ - || (CHAR) == 'x' \ - || (CHAR) == 'z') - #undef ASM_SPEC #define ASM_SPEC "\ %{!G:-G 0} %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \ diff --git a/gcc/config/netbsd-aout.h b/gcc/config/netbsd-aout.h index 914212b..bf2bb9e 100644 --- a/gcc/config/netbsd-aout.h +++ b/gcc/config/netbsd-aout.h @@ -1,5 +1,5 @@ /* Common configuration file for NetBSD a.out targets. - Copyright (C) 2002, 2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GCC. @@ -26,13 +26,6 @@ along with GCC; see the file COPYING3. If not see } \ while (0) -/* This defines which switch letters take arguments. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ - || (CHAR) == 'R') - /* Provide an ASM_SPEC appropriate for NetBSD. Currently we only deal with the options for generating PIC code. */ diff --git a/gcc/config/netbsd-elf.h b/gcc/config/netbsd-elf.h index 37f504b..f98cbe8 100644 --- a/gcc/config/netbsd-elf.h +++ b/gcc/config/netbsd-elf.h @@ -1,5 +1,5 @@ /* Common configuration file for NetBSD ELF targets. - Copyright (C) 2002, 2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GCC. @@ -26,18 +26,6 @@ along with GCC; see the file COPYING3. If not see } \ while (0) -/* This defines which switch letters take arguments. On NetBSD, most - of the normal cases (defined by gcc.c) apply, and we also have -h* - and -z* options (for the linker) (coming from SVR4). */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ - || (CHAR) == 'h' \ - || (CHAR) == 'z' \ - || (CHAR) == 'R') - - /* Provide a STARTFILE_SPEC appropriate for NetBSD ELF. Here we provide support for the special GCC option -static. On ELF targets, we also add the crtbegin.o file, which provides part diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h index 30e1c25..d15dff1 100644 --- a/gcc/config/openbsd.h +++ b/gcc/config/openbsd.h @@ -1,5 +1,6 @@ /* Base configuration file for all OpenBSD targets. - Copyright (C) 1999, 2000, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2004, 2005, 2007, 2009, 2010 + Free Software Foundation, Inc. This file is part of GCC. @@ -118,13 +119,6 @@ while (0) #ifndef OBSD_HAS_CORRECT_SPECS -#ifndef OBSD_NO_DYNAMIC_LIBRARIES -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ - || (CHAR) == 'R') -#endif - #undef CPP_SPEC #define CPP_SPEC OBSD_CPP_SPEC diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index 6d88e32..04cc70e 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -502,13 +502,6 @@ do { \ reg_names[1]); \ } while (0) -/* Switch Recognition by gcc.c. Add -G xx support. */ - -/* Override svr4.h definition. */ -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - extern int fixuplabelno; /* Handle constructors specially for -mrelocatable. */ diff --git a/gcc/config/score/score.h b/gcc/config/score/score.h index 4988704..1309a40 100644 --- a/gcc/config/score/score.h +++ b/gcc/config/score/score.h @@ -20,11 +20,6 @@ #include "score-conv.h" -/* Controlling the Compilation Driver. */ -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - #undef CPP_SPEC #define CPP_SPEC "%{mscore3:-D__score3__} %{G*}" diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index 805b32f..72efdbd 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -192,15 +192,6 @@ along with GCC; see the file COPYING3. If not see #undef SUPPORTS_INIT_PRIORITY #define SUPPORTS_INIT_PRIORITY 0 -/* This defines which switch letters take arguments. - It is as in svr4.h but with -R added. */ -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ - || (CHAR) == 'R' \ - || (CHAR) == 'h' \ - || (CHAR) == 'z') - #define STDC_0_IN_SYSTEM_HEADERS 1 /* diff --git a/gcc/config/sparc/sp-elf.h b/gcc/config/sparc/sp-elf.h index 3c50f71..8f0e892 100644 --- a/gcc/config/sparc/sp-elf.h +++ b/gcc/config/sparc/sp-elf.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for SPARC running in an embedded environment using the ELF file format. - Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -45,15 +45,6 @@ along with GCC; see the file COPYING3. If not see /* Don't set the target flags, this is done by the linker script */ #undef LIB_SPEC #define LIB_SPEC "" - -/* This defines which switch letters take arguments. - It is as in svr4.h but with -R added. */ -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ - || (CHAR) == 'R' \ - || (CHAR) == 'h' \ - || (CHAR) == 'z') #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h index a6ae027..e1820e0 100644 --- a/gcc/config/sparc/sp64-elf.h +++ b/gcc/config/sparc/sp64-elf.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GCC, for SPARC64, ELF. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2004, 2005, 2007 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2004, 2005, 2007, 2010 Free Software Foundation, Inc. Contributed by Doug Evans, dje@cygnus.com. @@ -71,15 +71,6 @@ crtbegin.o%s \ /* Use the default (for now). */ #undef LIB_SPEC -/* This defines which switch letters take arguments. - It is as in svr4.h but with -R added. */ -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ - || (CHAR) == 'R' \ - || (CHAR) == 'h' \ - || (CHAR) == 'z') - #undef BYTES_BIG_ENDIAN #define BYTES_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 3df1472..b7f0bd3 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -450,7 +450,7 @@ extern enum cmodel sparc_cmodel; /* Special flags to the Sun-4 assembler when using pipe for input. */ #define ASM_SPEC "\ -%{R} %{!pg:%{!p:%{fpic|fPIC|fpie|fPIE:-k}}} %{keep-local-as-symbols:-L} \ +%{!pg:%{!p:%{fpic|fPIC|fpie|fPIE:-k}}} %{keep-local-as-symbols:-L} \ %(asm_cpu) %(asm_relax)" #define AS_NEEDS_DASH_FOR_PIPED_INPUT diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h index 1a48130..f45706b 100644 --- a/gcc/config/svr4.h +++ b/gcc/config/svr4.h @@ -1,7 +1,7 @@ /* Operating system specific defines to be used when targeting GCC for some generic System V Release 4 system. Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2007, 2008, 2009 Free Software Foundation, Inc. + 2000, 2001, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@monkeys.com). This file is part of GCC. @@ -41,26 +41,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* Cpp, assembler, linker, library, and startfile spec's. */ -/* This defines which switch letters take arguments. On svr4, most of - the normal cases (defined in gcc.c) apply, and we also have -h* and - -z* options (for the linker). Note however that there is no such - thing as a -T option for svr4. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ - || (CHAR) == 'h' \ - || (CHAR) == 'x' \ - || (CHAR) == 'z') - -/* This defines which multi-letter switches take arguments. On svr4, - there are no such switches except those implemented by GCC itself. */ - -#define WORD_SWITCH_TAKES_ARG(STR) \ - (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ - && strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \ - && strcmp (STR, "Tbss")) - /* Provide an ASM_SPEC appropriate for svr4. If we're not using GAS, we try to support as many of the specialized svr4 assembler options as seems reasonable, diff --git a/gcc/defaults.h b/gcc/defaults.h index 1736013..b03abfb 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -32,33 +32,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0) #endif -/* This defines which switch letters take arguments. */ - -#define DEFAULT_SWITCH_TAKES_ARG(CHAR) \ - ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \ - || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \ - || (CHAR) == 'I' || (CHAR) == 'J' || (CHAR) == 'm' \ - || (CHAR) == 'x' || (CHAR) == 'L' || (CHAR) == 'A' \ - || (CHAR) == 'B' || (CHAR) == 'd') - /* This defines which multi-letter switches take arguments. */ -#define DEFAULT_WORD_SWITCH_TAKES_ARG(STR) \ - (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \ - || !strcmp (STR, "Tbss") || !strcmp (STR, "include") \ - || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \ - || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \ - || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ - || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \ - || !strcmp (STR, "isysroot") || !strcmp (STR, "imultilib") \ - || !strcmp (STR, "-param") || !strcmp (STR, "specs") \ - || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ") \ - || !strcmp (STR, "fintrinsic-modules-path") \ - || !strcmp (STR, "dumpbase") || !strcmp (STR, "dumpdir")) - -#ifndef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG (CHAR) -#endif +#define DEFAULT_WORD_SWITCH_TAKES_ARG(STR) 0 #ifndef WORD_SWITCH_TAKES_ARG #define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR) diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 0c2db47..9126d43 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -99,24 +99,12 @@ from being defined in the @file{.h} file to being part of the @c prevent bad page break with this line You can control the compilation driver. -@defmac SWITCH_TAKES_ARG (@var{char}) -A C expression which determines whether the option @option{-@var{char}} -takes arguments. The value should be the number of arguments that -option takes--zero, for many options. - -By default, this macro is defined as -@code{DEFAULT_SWITCH_TAKES_ARG}, which handles the standard options -properly. You need not define @code{SWITCH_TAKES_ARG} unless you -wish to add additional options which take arguments. Any redefinition -should call @code{DEFAULT_SWITCH_TAKES_ARG} and then check for -additional options. -@end defmac - @defmac WORD_SWITCH_TAKES_ARG (@var{name}) A C expression which determines whether the option @option{-@var{name}} takes arguments. The value should be the number of arguments that -option takes--zero, for many options. This macro rather than -@code{SWITCH_TAKES_ARG} is used for multi-character option names. +option takes--zero, for many options. +This macro does not need to handle options defined in @file{.opt} +files, only those that are handled purely through specs. By default, this macro is defined as @code{DEFAULT_WORD_SWITCH_TAKES_ARG}, which handles the standard options diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index c4d5e8a..2c36a76 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -99,24 +99,12 @@ from being defined in the @file{.h} file to being part of the @c prevent bad page break with this line You can control the compilation driver. -@defmac SWITCH_TAKES_ARG (@var{char}) -A C expression which determines whether the option @option{-@var{char}} -takes arguments. The value should be the number of arguments that -option takes--zero, for many options. - -By default, this macro is defined as -@code{DEFAULT_SWITCH_TAKES_ARG}, which handles the standard options -properly. You need not define @code{SWITCH_TAKES_ARG} unless you -wish to add additional options which take arguments. Any redefinition -should call @code{DEFAULT_SWITCH_TAKES_ARG} and then check for -additional options. -@end defmac - @defmac WORD_SWITCH_TAKES_ARG (@var{name}) A C expression which determines whether the option @option{-@var{name}} takes arguments. The value should be the number of arguments that -option takes--zero, for many options. This macro rather than -@code{SWITCH_TAKES_ARG} is used for multi-character option names. +option takes--zero, for many options. +This macro does not need to handle options defined in @file{.opt} +files, only those that are handled purely through specs. By default, this macro is defined as @code{DEFAULT_WORD_SWITCH_TAKES_ARG}, which handles the standard options @@ -665,7 +665,7 @@ proper position among the other output files. */ %{flto:%<fcompare-debug*} %{fwhopr*:%<fcompare-debug*} \ %{flto} %{fwhopr*} %l " LINK_PIE_SPEC \ "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ - %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ + %{s} %{t} %{u*} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\ %(mflib) " STACK_SPLIT_SPEC "\ diff --git a/gcc/opts-common.c b/gcc/opts-common.c index 553e8b1..ab4b1b2 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see #include "opts.h" #include "flags.h" #include "diagnostic.h" -#include "tm.h" /* For SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG and +#include "tm.h" /* For WORD_SWITCH_TAKES_ARG and TARGET_OPTION_TRANSLATE_TABLE. */ static void prune_options (struct cl_decoded_option **, unsigned int *); @@ -507,13 +507,10 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, { /* Skip the correct number of arguments for options handled through specs. */ - const char *popt = argv[0] + 1; - int c = *popt; + const char *popt ATTRIBUTE_UNUSED = argv[0] + 1; gcc_assert (result == 1); - if (SWITCH_TAKES_ARG (c) > (popt[1] != 0)) - result += SWITCH_TAKES_ARG (c) - (popt[1] != 0); - else if (WORD_SWITCH_TAKES_ARG (popt)) + if (WORD_SWITCH_TAKES_ARG (popt)) result += WORD_SWITCH_TAKES_ARG (popt); if (result > 1) for (i = 1; i < result; i++) diff --git a/gcc/system.h b/gcc/system.h index ef0c462..65b5236 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -776,7 +776,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; STACK_CHECK_PROBE_INTERVAL STACK_CHECK_PROBE_LOAD \ ORDER_REGS_FOR_LOCAL_ALLOC FUNCTION_OUTGOING_VALUE \ ASM_DECLARE_CONSTANT_NAME MODIFY_TARGET_NAME SWITCHES_NEED_SPACES \ - SWITCH_CURTAILS_COMPILATION + SWITCH_CURTAILS_COMPILATION SWITCH_TAKES_ARG /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ |