From 2be55a2540b291312898ad5500d20b7b64ba012c Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 10 Nov 2010 12:40:51 +0000 Subject: [PATCH] tm.texi.in (TARGET_OPTION_TRANSLATE_TABLE): Remove. * doc/tm.texi.in (TARGET_OPTION_TRANSLATE_TABLE): Remove. * doc/tm.texi: Regenerate. * opts-common.c (tm.h): Don't include. (target_option_translations): Remove. (decode_cmdline_options_to_array): Don't handle translating options. * system.h (TARGET_OPTION_TRANSLATE_TABLE): Poison. * config/darwin-driver.c: Don't condition includes on CROSS_DIRECTORY_STRUCTURE. (darwin_default_min_version): Make static. (darwin_driver_init): New. Call darwin_default_min_version if not CROSS_DIRECTORY_STRUCTURE. * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Remove. (DRIVER_SELF_SPECS, DARWIN_CC1_SPEC): Define. (ASM_SPEC): Add %{static}. (darwin_default_min_version): Don't declare. (darwin_driver_init): Declare. (GCC_DRIVER_HOST_INITIALIZATION): Define to call darwin_driver_init, independent of CROSS_DIRECTORY_STRUCTURE. * config/darwin.opt (all_load, allowable_client, arch_errors_fatal, bind_at_load, bundle, bundle_loader, dead_strip, dependency-file, dylib_file, dynamic, dynamiclib, exported_symbols_list, filelist, findirect-virtual-calls, flat_namespace, force_cpusubtype_ALL, force_flat_namespace, framework, fterminated-vtables, gfull, gused, image_base, init, install_name, multi_module, multiply_defined, multiply_defined_unused, no_dead_strip_inits_and_terms, seg_addr_table, seg_addr_table_filename, segaddr, segs_read_only_addr, segs_read_write_addr, single_module, umbrella, unexported_symbols_list, weak_reference_mismatches, Zall_load, Zarch_errors_fatal, Zbind_at_load, Zbundle, Zdead_strip, Zdynamic, Zdynamiclib, Zflat_namespace, Zforce_cpusubtype_ALL, Zforce_flat_namespace, Zmulti_module, Zno_dead_strip_inits_and_terms, Zsingle_module): New. * config/i386/darwin.h (CC1_SPEC): Add DARWIN_CC1_SPEC. (ASM_SPEC): Add %{static}. (SUBTARGET_OPTION_TRANSLATE_TABLE): Remove. * config/mep/mep.h (TARGET_OPTION_TRANSLATE_TABLE): Remove. (DRIVER_SELF_SPECS): Handle options formerly in TARGET_OPTION_TRANSLATE_TABLE. * config/mep/mep.opt (mfar): New. * config/picochip/picochip.h (TARGET_OPTION_TRANSLATE_TABLE): Remove. (DRIVER_SELF_SPECS): Define. Handle options formerly in TARGET_OPTION_TRANSLATE_TABLE. * config/rs6000/darwin.h (CC1_SPEC): Handle -faltivec and -fno-altivec. (SUBTARGET_OPTION_TRANSLATE_TABLE): Remove. * config/rs6000/darwin.opt (Waltivec-long-deprecated, faltivec, ffix-and-continue, findirect-data): New. * config/rx/rx.h (TARGET_OPTION_TRANSLATE_TABLE): Remove. * config/rx/rx.opt (nofpu): Make into alias of mnofpu. (mnofpu): Define mask and use Report here. From-SVN: r166534 --- gcc/ChangeLog | 56 ++++++++++++ gcc/config/darwin-driver.c | 53 ++++++++++- gcc/config/darwin.h | 84 +++--------------- gcc/config/darwin.opt | 157 +++++++++++++++++++++++++++++++++ gcc/config/i386/darwin.h | 11 +-- gcc/config/mep/mep.h | 19 ++-- gcc/config/mep/mep.opt | 3 + gcc/config/picochip/picochip.h | 26 +++--- gcc/config/rs6000/darwin.h | 20 ++--- gcc/config/rs6000/darwin.opt | 14 +++ gcc/config/rx/rx.h | 4 - gcc/config/rx/rx.opt | 4 +- gcc/doc/tm.texi | 20 ----- gcc/doc/tm.texi.in | 20 ----- gcc/opts-common.c | 90 +------------------ gcc/system.h | 3 +- 16 files changed, 330 insertions(+), 254 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 984adac43507..91b407c382af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,59 @@ +2010-11-10 Joseph Myers + + * doc/tm.texi.in (TARGET_OPTION_TRANSLATE_TABLE): Remove. + * doc/tm.texi: Regenerate. + * opts-common.c (tm.h): Don't include. + (target_option_translations): Remove. + (decode_cmdline_options_to_array): Don't handle translating + options. + * system.h (TARGET_OPTION_TRANSLATE_TABLE): Poison. + * config/darwin-driver.c: Don't condition includes on + CROSS_DIRECTORY_STRUCTURE. + (darwin_default_min_version): Make static. + (darwin_driver_init): New. Call darwin_default_min_version if not + CROSS_DIRECTORY_STRUCTURE. + * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Remove. + (DRIVER_SELF_SPECS, DARWIN_CC1_SPEC): Define. + (ASM_SPEC): Add %{static}. + (darwin_default_min_version): Don't declare. + (darwin_driver_init): Declare. + (GCC_DRIVER_HOST_INITIALIZATION): Define to call + darwin_driver_init, independent of CROSS_DIRECTORY_STRUCTURE. + * config/darwin.opt (all_load, allowable_client, + arch_errors_fatal, bind_at_load, bundle, bundle_loader, + dead_strip, dependency-file, dylib_file, dynamic, dynamiclib, + exported_symbols_list, filelist, findirect-virtual-calls, + flat_namespace, force_cpusubtype_ALL, force_flat_namespace, + framework, fterminated-vtables, gfull, gused, image_base, init, + install_name, multi_module, multiply_defined, + multiply_defined_unused, no_dead_strip_inits_and_terms, + seg_addr_table, seg_addr_table_filename, segaddr, + segs_read_only_addr, segs_read_write_addr, single_module, + umbrella, unexported_symbols_list, weak_reference_mismatches, + Zall_load, Zarch_errors_fatal, Zbind_at_load, Zbundle, + Zdead_strip, Zdynamic, Zdynamiclib, Zflat_namespace, + Zforce_cpusubtype_ALL, Zforce_flat_namespace, Zmulti_module, + Zno_dead_strip_inits_and_terms, Zsingle_module): New. + * config/i386/darwin.h (CC1_SPEC): Add DARWIN_CC1_SPEC. + (ASM_SPEC): Add %{static}. + (SUBTARGET_OPTION_TRANSLATE_TABLE): Remove. + * config/mep/mep.h (TARGET_OPTION_TRANSLATE_TABLE): Remove. + (DRIVER_SELF_SPECS): Handle options formerly in + TARGET_OPTION_TRANSLATE_TABLE. + * config/mep/mep.opt (mfar): New. + * config/picochip/picochip.h (TARGET_OPTION_TRANSLATE_TABLE): + Remove. + (DRIVER_SELF_SPECS): Define. Handle options formerly in + TARGET_OPTION_TRANSLATE_TABLE. + * config/rs6000/darwin.h (CC1_SPEC): Handle -faltivec and + -fno-altivec. + (SUBTARGET_OPTION_TRANSLATE_TABLE): Remove. + * config/rs6000/darwin.opt (Waltivec-long-deprecated, faltivec, + ffix-and-continue, findirect-data): New. + * config/rx/rx.h (TARGET_OPTION_TRANSLATE_TABLE): Remove. + * config/rx/rx.opt (nofpu): Make into alias of mnofpu. + (mnofpu): Define mask and use Report here. + 2010-11-10 Andreas Krebbel * gcc/config/s390/s390.c (s390_emit_prologue): Report the stack diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c index 1123aa37c438..bf27336ce296 100644 --- a/gcc/config/darwin-driver.c +++ b/gcc/config/darwin-driver.c @@ -18,13 +18,14 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -#ifndef CROSS_DIRECTORY_STRUCTURE #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "gcc.h" #include "opts.h" + +#ifndef CROSS_DIRECTORY_STRUCTURE #include #include "xregex.h" @@ -32,7 +33,7 @@ along with GCC; see the file COPYING3. If not see libraries, default the -mmacosx-version-min flag to be the version of the system on which the compiler is running. */ -void +static void darwin_default_min_version (unsigned int *decoded_options_count, struct cl_decoded_option **decoded_options) { @@ -138,3 +139,51 @@ darwin_default_min_version (unsigned int *decoded_options_count, } #endif /* CROSS_DIRECTORY_STRUCTURE */ + +/* Translate -filelist and -framework options in *DECODED_OPTIONS + (size *DECODED_OPTIONS_COUNT) to use -Xlinker so that they are + considered to be linker inputs in the case that no other inputs are + specified. Handling these options in DRIVER_SELF_SPECS does not + suffice because specs are too late to add linker inputs, and + handling them in LINK_SPEC does not suffice because the linker will + not be called if there are no other inputs. When native, also + default the -mmacosx-version-min flag. */ + +void +darwin_driver_init (unsigned int *decoded_options_count, + struct cl_decoded_option **decoded_options) +{ + unsigned int i; + + for (i = 1; i < *decoded_options_count; i++) + { + if ((*decoded_options)[i].errors & CL_ERR_MISSING_ARG) + continue; + switch ((*decoded_options)[i].opt_index) + { + case OPT_filelist: + case OPT_framework: + ++*decoded_options_count; + *decoded_options = XRESIZEVEC (struct cl_decoded_option, + *decoded_options, + *decoded_options_count); + memmove (*decoded_options + i + 2, + *decoded_options + i + 1, + ((*decoded_options_count - i - 2) + * sizeof (struct cl_decoded_option))); + generate_option (OPT_Xlinker, (*decoded_options)[i].arg, 1, + CL_DRIVER, &(*decoded_options)[i + 1]); + generate_option (OPT_Xlinker, + (*decoded_options)[i].canonical_option[0], 1, + CL_DRIVER, &(*decoded_options)[i]); + break; + + default: + break; + } + } + +#ifndef CROSS_DIRECTORY_STRUCTURE + darwin_default_min_version (decoded_options_count, decoded_options); +#endif +} diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index ffed58a1300e..5a4be8a1a4fa 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -123,71 +123,16 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* True if pragma ms_struct is in effect. */ extern GTY(()) int darwin_ms_struct; -/* This table intercepts weirdo options whose names would interfere - with normal driver conventions, and either translates them into - standardly-named options, or adds a 'Z' so that they can get to - specs processing without interference. +#define DRIVER_SELF_SPECS \ + "%{gfull:-g -fno-eliminate-unused-debug-symbols} %", since that - forfeits the ability to control via spec strings later. However, - as a special exception, do this translation with -filelist, because - otherwise the driver will think there are no input files and quit. - (The alternative would be to hack the driver to recognize -filelist - specially, but it's simpler to use the translation table.) - - Note that an option name with a prefix that matches another option - name, that also takes an argument, needs to be modified so the - prefix is different, otherwise a '*' after the shorter option will - match with the longer one. - - The SUBTARGET_OPTION_TRANSLATE_TABLE macro, which _must_ be defined - in gcc/config/{i386,rs6000}/darwin.h, should contain any additional - command-line option translations specific to the particular target - architecture. */ - -#define TARGET_OPTION_TRANSLATE_TABLE \ - { "-all_load", "-Zall_load" }, \ - { "-allowable_client", "-Zallowable_client" }, \ - { "-arch_errors_fatal", "-Zarch_errors_fatal" }, \ - { "-bind_at_load", "-Zbind_at_load" }, \ - { "-bundle", "-Zbundle" }, \ - { "-bundle_loader", "-Zbundle_loader" }, \ - { "-weak_reference_mismatches", "-Zweak_reference_mismatches" }, \ - { "-dead_strip", "-Zdead_strip" }, \ - { "-no_dead_strip_inits_and_terms", "-Zno_dead_strip_inits_and_terms" }, \ - { "-dependency-file", "-MF" }, \ - { "-dylib_file", "-Zdylib_file" }, \ - { "-dynamic", "-Zdynamic" }, \ - { "-dynamiclib", "-Zdynamiclib" }, \ - { "-exported_symbols_list", "-Zexported_symbols_list" }, \ - { "-gfull", "-g -fno-eliminate-unused-debug-symbols" }, \ - { "-gused", "-g -feliminate-unused-debug-symbols" }, \ - { "-segaddr", "-Zsegaddr" }, \ - { "-segs_read_only_addr", "-Zsegs_read_only_addr" }, \ - { "-segs_read_write_addr", "-Zsegs_read_write_addr" }, \ - { "-seg_addr_table", "-Zseg_addr_table" }, \ - { "-seg_addr_table_filename", "-Zfn_seg_addr_table_filename" }, \ - { "-umbrella", "-Zumbrella" }, \ - { "-fapple-kext", "-fapple-kext -static -Wa,-static" }, \ - { "-filelist", "-Xlinker -filelist -Xlinker" }, \ - { "-findirect-virtual-calls", "-fapple-kext" }, \ - { "-flat_namespace", "-Zflat_namespace" }, \ - { "-force_cpusubtype_ALL", "-Zforce_cpusubtype_ALL" }, \ - { "-force_flat_namespace", "-Zforce_flat_namespace" }, \ - { "-framework", "-Xlinker -framework -Xlinker" }, \ - { "-fterminated-vtables", "-fapple-kext" }, \ - { "-image_base", "-Zimage_base" }, \ - { "-init", "-Zinit" }, \ - { "-install_name", "-Zinstall_name" }, \ - { "-mkernel", "-mkernel -static -Wa,-static" }, \ - { "-multiply_defined_unused", "-Zmultiplydefinedunused" }, \ - { "-multiply_defined", "-Zmultiply_defined" }, \ - { "-multi_module", "-Zmulti_module" }, \ - { "-static", "-static -Wa,-static" }, \ - { "-shared", "-Zdynamiclib" }, \ - { "-single_module", "-Zsingle_module" }, \ - { "-unexported_symbols_list", "-Zunexported_symbols_list" }, \ - SUBTARGET_OPTION_TRANSLATE_TABLE +#define DARWIN_CC1_SPEC \ + "%{findirect-virtual-calls: -fapple-kext} %. +; Various linker options have a -Z added so that they can get to specs +; processing without interference. Note that an option name with a +; prefix that matches another option name, that also takes an +; argument, being mapped to a -Z linker option, needs to be modified +; so the prefix is different, otherwise a '*' after the shorter option +; will match with the longer one. + +all_load +Driver Alias(Zall_load) + +allowable_client +Driver Separate Alias(Zallowable_client) + +arch_errors_fatal +Driver Alias(Zarch_errors_fatal) + +bind_at_load +Driver Alias(Zbind_at_load) + +bundle +Driver Alias(Zbundle) + +bundle_loader +Driver Separate Alias(Zbundle_loader) + +dead_strip +Driver Alias(Zdead_strip) + +dependency-file +C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs) + +dylib_file +Driver Separate Alias(Zdylib_file) + +dynamic +Driver Alias(Zdynamic) + +dynamiclib +Driver Alias(Zdynamiclib) + +exported_symbols_list +Driver Separate Alias(Zexported_symbols_list) + +filelist +Driver RejectNegative Separate + +findirect-virtual-calls +Driver RejectNegative + +flat_namespace +Driver RejectNegative Alias(Zflat_namespace) + +force_cpusubtype_ALL +Driver RejectNegative Alias(Zforce_cpusubtype_ALL) + +force_flat_namespace +Driver RejectNegative Alias(Zforce_flat_namespace) + +framework +Driver RejectNegative Separate + +fterminated-vtables +Driver RejectNegative + +gfull +Driver + +gused +Driver + +image_base +Driver Separate Alias(Zimage_base) + +init +Driver Separate Alias(Zinit) + +install_name +Driver Separate Alias(Zinstall_name) + mconstant-cfstrings Target Report Var(darwin_constant_cfstrings) Init(1) Generate compile-time CFString objects +multi_module +Driver RejectNegative Alias(Zmulti_module) + +multiply_defined +Driver RejectNegative Separate Alias(Zmultiply_defined) + +multiply_defined_unused +Driver RejectNegative Separate Alias(Zmultiplydefinedunused) + +no_dead_strip_inits_and_terms +Driver Alias(Zno_dead_strip_inits_and_terms) + +seg_addr_table +Driver Separate Alias(Zseg_addr_table) + +seg_addr_table_filename +Driver Separate Alias(Zfn_seg_addr_table_filename) + +segaddr +Driver Separate Args(2) Alias(Zsegaddr) + +segs_read_only_addr +Driver Separate Alias(Zsegs_read_only_addr) + +segs_read_write_addr +Driver Separate Alias(Zsegs_read_write_addr) + +single_module +Driver Alias(Zsingle_module) + +umbrella +Driver Separate Alias(Zumbrella) + +unexported_symbols_list +Driver Separate Alias(Zunexported_symbols_list) + +weak_reference_mismatches +Driver Separate Alias(Zweak_reference_mismatches) + Wnonportable-cfstrings Target Report Var(darwin_warn_nonportable_cfstrings) Init(1) Warning Warn if constant CFString objects contain non-portable characters @@ -63,21 +181,51 @@ iframework Target RejectNegative C ObjC C++ ObjC++ Joined Separate -iframework Add to the end of the system framework include path +Zall_load +Driver + Zallowable_client Driver Separate +Zarch_errors_fatal +Driver + +Zbind_at_load +Driver + +Zbundle +Driver + Zbundle_loader Driver Separate +Zdead_strip +Driver + Zdylib_file Driver Separate +Zdynamic +Driver + +Zdynamiclib +Driver + Zexported_symbols_list Driver Separate Zfn_seg_addr_table_filename Driver Separate +Zflat_namespace +Driver + +Zforce_cpusubtype_ALL +Driver + +Zforce_flat_namespace +Driver + Zimage_base Driver Separate @@ -87,12 +235,18 @@ Driver Separate Zinstall_name Driver Separate +Zmulti_module +Driver + Zmultiply_defined Driver Separate Zmultiplydefinedunused Driver Separate +Zno_dead_strip_inits_and_terms +Driver + Zseg_addr_table Driver Separate @@ -105,6 +259,9 @@ Driver Separate Zsegs_read_write_addr Driver Separate +Zsingle_module +Driver + Zumbrella Driver Separate diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index 7c4ed633b181..1f2c2e4bb699 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -110,10 +110,12 @@ extern int darwin_emit_branch_islands; #define CC1_SPEC "%(cc1_cpu) \ %{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \ %{!mmacosx-version-min=*:-mmacosx-version-min=%(darwin_minversion)} \ - %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}" + %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} " \ + DARWIN_CC1_SPEC #undef ASM_SPEC -#define ASM_SPEC "-arch %(darwin_arch) -force_cpusubtype_ALL" +#define ASM_SPEC "-arch %(darwin_arch) -force_cpusubtype_ALL \ + %{static}" #define DARWIN_ARCH_SPEC "%{m64:x86_64;:i386}" #define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC @@ -141,11 +143,6 @@ extern int darwin_emit_branch_islands; { "darwin_crt2", "" }, \ { "darwin_subarch", DARWIN_SUBARCH_SPEC }, -/* Use the following macro for any Darwin/x86-specific command-line option - translation. */ -#define SUBTARGET_OPTION_TRANSLATE_TABLE \ - { "", "" } - /* The Darwin assembler mostly follows AT&T syntax. */ #undef ASSEMBLER_DIALECT #define ASSEMBLER_DIALECT ASM_ATT diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h index fa00098d7c40..49b7f38b7d09 100644 --- a/gcc/config/mep/mep.h +++ b/gcc/config/mep/mep.h @@ -132,17 +132,6 @@ crtbegin.o%s" #define TARGET_VERSION fprintf (stderr, " (Toshiba Media Processor (MeP))"); -/* The MeP config tool will add TARGET_OPTION_TRANSLATE_TABLE here. */ -#define TARGET_OPTION_TRANSLATE_TABLE \ - {"-mall-opts", "-maverage -mmult -mdiv -mbitops -mleadz \ - -mabsdiff -mminmax -mclip -msatur -mdebug" }, \ - {"-mno-opts", "-mno-average -mno-mult -mno-div -mno-bitops -mno-leadz \ - -mno-absdiff -mno-minmax -mno-clip -mno-satur -mno-debug" }, \ - {"-mfar", "-ml -mtf -mc=far" } \ -/* start-target-option-table */ \ -, {"-mconfig=default", "-mconfig=default -mmult -mdiv -D__MEP_CONFIG_ISA=1" } \ -/* end-target-option-table */ - /* The MeP config tool will replace this as appropriate. */ #define DEFAULT_ENDIAN_SPEC "%{!meb: -mel}" @@ -152,7 +141,13 @@ crtbegin.o%s" /* Don't add an endian option when building the libraries. */ #define DRIVER_SELF_SPECS \ "%{!mlibrary:" DEFAULT_ENDIAN_SPEC "}", \ - "%{mlibrary: " LIBRARY_CONFIG_SPEC " %{!mel:-meb}}" + "%{mlibrary: " LIBRARY_CONFIG_SPEC " %{!mel:-meb}}", \ + "%{mall-opts:-maverage -mmult -mdiv -mbitops -mleadz \ + -mabsdiff -mminmax -mclip -msatur -mdebug} %. +Waltivec-long-deprecated +Driver Alias(mwarn-altivec-long) + +faltivec +Driver + +; -ffix-and-continue and -findirect-data are for compatibility for old +; compilers. +ffix-and-continue +Driver RejectNegative Alias(mfix-and-continue) + +findirect-data +Driver RejectNegative Alias(mfix-and-continue) + m64 Target RejectNegative Negative(m32) Mask(64BIT) Generate 64-bit code diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h index bec7249d0874..8262f0b87a6d 100644 --- a/gcc/config/rx/rx.h +++ b/gcc/config/rx/rx.h @@ -619,10 +619,6 @@ extern int rx_float_compare_mode; #define ARG_POINTER_CFA_OFFSET(FNDECL) 4 #define FRAME_POINTER_CFA_OFFSET(FNDECL) 4 -/* Translate -nofpu into -mnofpu so that it gets passed from gcc to cc1. */ -#define TARGET_OPTION_TRANSLATE_TABLE \ - {"-nofpu", "-mnofpu" } - #define TARGET_USE_FPU (! TARGET_NO_USE_FPU) /* This macro is used to decide when RX FPU instructions can be used. */ diff --git a/gcc/config/rx/rx.opt b/gcc/config/rx/rx.opt index adc7000d9d33..35143dd0f557 100644 --- a/gcc/config/rx/rx.opt +++ b/gcc/config/rx/rx.opt @@ -30,11 +30,11 @@ Target RejectNegative InverseMask(64BIT_DOUBLES) Report Stores doubles in 32 bits. This is the default. nofpu -Target RejectNegative Mask(NO_USE_FPU) Report +Target RejectNegative Alias(mnofpu) Disable the use of RX FPU instructions. mnofpu -Target RejectNegative Mask(NO_USE_FPU) MaskExists Undocumented +Target RejectNegative Mask(NO_USE_FPU) Report Undocumented fpu Target RejectNegative InverseMask(NO_USE_FPU) Report diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 7666fcfd401d..c9bba978f4a4 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -99,26 +99,6 @@ 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 TARGET_OPTION_TRANSLATE_TABLE -If defined, a list of pairs of strings, the first of which is a -potential command line target to the @file{gcc} driver program, and the -second of which is a space-separated (tabs and other whitespace are not -supported) list of options with which to replace the first option. The -target defining this list is responsible for assuring that the results -are valid. Replacement options may not be the @code{--opt} style, they -must be the @code{-opt} style. It is the intention of this macro to -provide a mechanism for substitution that affects the multilibs chosen, -such as one option that enables many options, some of which select -multilibs. Example nonsensical definition, where @option{-malt-abi}, -@option{-EB}, and @option{-mspoo} cause different multilibs to be chosen: - -@smallexample -#define TARGET_OPTION_TRANSLATE_TABLE \ -@{ "-fast", "-march=fast-foo -malt-abi -I/usr/fast-foo" @}, \ -@{ "-compat", "-EB -malign=4 -mspoo" @} -@end smallexample -@end defmac - @defmac DRIVER_SELF_SPECS A list of specs for the driver itself. It should be a suitable initializer for an array of strings, with no surrounding braces. diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index b0c4bccc7042..a28850f664a5 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -99,26 +99,6 @@ 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 TARGET_OPTION_TRANSLATE_TABLE -If defined, a list of pairs of strings, the first of which is a -potential command line target to the @file{gcc} driver program, and the -second of which is a space-separated (tabs and other whitespace are not -supported) list of options with which to replace the first option. The -target defining this list is responsible for assuring that the results -are valid. Replacement options may not be the @code{--opt} style, they -must be the @code{-opt} style. It is the intention of this macro to -provide a mechanism for substitution that affects the multilibs chosen, -such as one option that enables many options, some of which select -multilibs. Example nonsensical definition, where @option{-malt-abi}, -@option{-EB}, and @option{-mspoo} cause different multilibs to be chosen: - -@smallexample -#define TARGET_OPTION_TRANSLATE_TABLE \ -@{ "-fast", "-march=fast-foo -malt-abi -I/usr/fast-foo" @}, \ -@{ "-compat", "-EB -malign=4 -mspoo" @} -@end smallexample -@end defmac - @defmac DRIVER_SELF_SPECS A list of specs for the driver itself. It should be a suitable initializer for an array of strings, with no surrounding braces. diff --git a/gcc/opts-common.c b/gcc/opts-common.c index 9239a5aaa13f..94fa8299f6e8 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see #include "opts.h" #include "flags.h" #include "diagnostic.h" -#include "tm.h" /* For TARGET_OPTION_TRANSLATE_TABLE. */ static void prune_options (struct cl_decoded_option **, unsigned int *); @@ -567,17 +566,6 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, return result; } -#ifdef TARGET_OPTION_TRANSLATE_TABLE -static const struct { - const char *const option_found; - const char *const replacements; -} target_option_translations[] = -{ - TARGET_OPTION_TRANSLATE_TABLE, - { 0, 0 } -}; -#endif - /* Decode command-line options (ARGC and ARGV being the arguments of main) into an array, setting *DECODED_OPTIONS to a pointer to that array and *DECODED_OPTIONS_COUNT to the number of entries in the @@ -593,7 +581,7 @@ decode_cmdline_options_to_array (unsigned int argc, const char **argv, struct cl_decoded_option **decoded_options, unsigned int *decoded_options_count) { - unsigned int n, i, target_translate_from; + unsigned int n, i; struct cl_decoded_option *opt_array; unsigned int num_decoded_options; bool argv_copied = false; @@ -613,7 +601,6 @@ decode_cmdline_options_to_array (unsigned int argc, const char **argv, opt_array[0].errors = 0; num_decoded_options = 1; - target_translate_from = 1; for (i = 1; i < argc; i += n) { const char *opt = argv[i]; @@ -627,81 +614,6 @@ decode_cmdline_options_to_array (unsigned int argc, const char **argv, continue; } - if (i >= target_translate_from && (lang_mask & CL_DRIVER)) - { -#ifdef TARGET_OPTION_TRANSLATE_TABLE - int tott_idx; - - for (tott_idx = 0; - target_option_translations[tott_idx].option_found; - tott_idx++) - { - if (strcmp (target_option_translations[tott_idx].option_found, - argv[i]) == 0) - { - unsigned int spaces = 0; - unsigned int m = 0; - const char *sp; - char *np; - - for (sp = target_option_translations[tott_idx].replacements; - *sp; sp++) - { - if (*sp == ' ') - { - spaces++; - while (*sp == ' ') - sp++; - sp--; - } - } - - if (spaces) - { - int new_argc = argc + spaces; - if (argv_copied) - argv = XRESIZEVEC (const char *, argv, new_argc + 1); - else - { - const char **new_argv = XNEWVEC (const char *, - new_argc + 1); - memcpy (new_argv, argv, - (argc + 1) * sizeof (const char *)); - argv = new_argv; - argv_copied = true; - } - memmove (&argv[i] + spaces, &argv[i], - (argc + 1 - i) * sizeof (const char *)); - argc = new_argc; - opt_array = XRESIZEVEC (struct cl_decoded_option, - opt_array, argc); - } - - sp = target_option_translations[tott_idx].replacements; - np = xstrdup (sp); - - while (1) - { - while (*np == ' ') - np++; - if (*np == 0) - break; - argv[i + m++] = np; - while (*np != ' ' && *np) - np++; - if (*np == 0) - break; - *np++ = 0; - } - - target_translate_from = i + m; - gcc_assert (m == spaces + 1); - break; - } - } -#endif - } - n = decode_cmdline_option (argv + i, lang_mask, &opt_array[num_decoded_options]); num_decoded_options++; diff --git a/gcc/system.h b/gcc/system.h index afe015a4a318..a4f1da6c1704 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -776,7 +776,8 @@ 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_TAKES_ARG WORD_SWITCH_TAKES_ARG + SWITCH_CURTAILS_COMPILATION SWITCH_TAKES_ARG WORD_SWITCH_TAKES_ARG \ + TARGET_OPTION_TRANSLATE_TABLE /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \