Commit 87d7d780 by Devang Patel Committed by Devang Patel

gcc.c (DEFAULT_SWITCH_TAKES_ARG): Remove.


PR/9394
        * gcc.c (DEFAULT_SWITCH_TAKES_ARG): Remove.
        (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove.
        * gcc.h (DEFAULT_SWITCH_TAKES_ARG): Add.
        (DEFAULT_WORD_SWITCH_TAKES_ARG): Add.
        * cppspec.c (DEFAULT_SWTICH_TAKES_ARG): Remove.
        (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove.

cp
        * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWITCH_TAKES_ARG.

testsuite

        * g++.dg/cpp/c++_cmd_1.C: New test.
        * g++.dg/cpp/c++_cmd_1.h: New file.

From-SVN: r64144
parent 6b856d15
2003-03-10 Devang Patel <dpatel@apple.com>
PR c++/9394
* gcc.c (DEFAULT_SWITCH_TAKES_ARG): Remove.
(DEFAULT_WORD_SWITCH_TAKES_ARG): Remove.
* gcc.h (DEFAULT_SWITCH_TAKES_ARG): Add.
(DEFAULT_WORD_SWITCH_TAKES_ARG): Add.
* cppspec.c (DEFAULT_SWITCH_TAKES_ARG): Remove.
(DEFAULT_WORD_SWITCH_TAKES_ARG): Remove.
2003-03-10 Steven Bosscher <s.bosscher@student.tudelft.nl>
PR optimization/7189
......@@ -5,6 +16,7 @@
check_function_return_warnings up to just after
delete_unreachable_blocks.
2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
* config/m68hc11/m68hc11.h (HARD_REGNO_RENAME_OK): Define.
......
2003-03-10 Devang Patel <dpatel@apple.com>
PR c++/9394
* g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG.
2003-03-10 Jason Merrill <jason@redhat.com>
PR c++/9798
......
......@@ -189,6 +189,8 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
else if (strcmp (argv[i], "-static-libgcc") == 0
|| strcmp (argv[i], "-static") == 0)
shared_libgcc = 0;
else if (DEFAULT_WORD_SWITCH_TAKES_ARG (&argv[i][1]))
i++;
else
/* Pass other options through. */
continue;
......
......@@ -31,32 +31,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
assume the user knows what they're doing. If no explicit input is
mentioned, it will read stdin. */
/* Snarfed from gcc.c: */
/* 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) == 'm' || (CHAR) == 'x' \
|| (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
|| (CHAR) == 'B' || (CHAR) == 'b')
#ifndef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR)
#endif
/* 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, "isystem") || !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
#ifndef WORD_SWITCH_TAKES_ARG
#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
#endif
......
......@@ -819,30 +819,10 @@ struct user_specs
static struct user_specs *user_specs_head, *user_specs_tail;
/* 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) == 'm' || (CHAR) == 'x' \
|| (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'B' || (CHAR) == 'b')
#ifndef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR)
#endif
/* 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, "isystem") || !strcmp (STR, "-param") \
|| !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
#ifndef WORD_SWITCH_TAKES_ARG
#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
#endif
......@@ -3162,8 +3142,11 @@ process_command (argc, argv)
/* If there is a -V or -b option (or both), process it now, before
trying to interpret the rest of the command line. */
/* Use heuristic that all configuration names must have at least one dash '-'.
This allows to pass options that start with -b. */
if (argc > 1 && argv[1][0] == '-'
&& (argv[1][1] == 'V' || argv[1][1] == 'b'))
&& (argv[1][1] == 'V'
|| (argv[1][1] == 'b' && strchr (argv[1] + 2, '-') != NULL)))
{
const char *new_version = DEFAULT_TARGET_VERSION;
const char *new_machine = DEFAULT_TARGET_MACHINE;
......
......@@ -31,6 +31,28 @@ struct spec_function
const char *(*func) PARAMS ((int, const char **));
};
/* 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) == 'm' || (CHAR) == 'x' \
|| (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
|| (CHAR) == 'B' || (CHAR) == 'b')
/* 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, "isystem") || !strcmp (STR, "-param") \
|| !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
/* These are exported by gcc.c. */
extern int do_spec PARAMS ((const char *));
extern void record_temp_file PARAMS ((const char *, int, int));
......
2003-03-10 Devang Patel <dpatel@apple.com>
* g++.dg/cpp/c++_cmd_1.C: New test.
* g++.dg/cpp/c++_cmd_1.h: New file.
2003-03-10 Segher Boessenkool <segher@koffie.nl>
* gcc.dg/altivec-9.c: New file.
......
/* Copyright (C) 2003 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
/* { dg-options "-c -include ${srcdir}/g++.dg/cpp/c++_cmd_1.h" } */
/* Contributed by Devang Patel <dpatel@apple.com> */
int main ()
{
return 0;
}
/* Copyright (C) 2003 Free Software Foundation, Inc. */
/* Contributed by Devang Patel <dpatel@apple.com> */
/* Header file for c++_cmd_1.C */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment