Commit afd85c1a by Roger Sayle Committed by Roger Sayle

re PR other/17361 (gcc driver complains about C++ options when assembling)


	PR other/17361
	* c-opts.c (permit_fortran_options): Delete/obsolete global variable.
	(c_common_init_options): Remove #ifdef CL_F77 code.  Scan command
	line options for "-lang-asm" and if found allow any of the C-family
	front-end options.
	(c_common_handle_option): Remove last use of permit_fortran_options.

From-SVN: r88906
parent 1ca939e5
2004-10-11 Roger Sayle <roger@eyesopen.com>
PR other/17361
* c-opts.c (permit_fortran_options): Delete/obsolete global variable.
(c_common_init_options): Remove #ifdef CL_F77 code. Scan command
line options for "-lang-asm" and if found allow any of the C-family
front-end options.
(c_common_handle_option): Remove last use of permit_fortran_options.
2004-10-11 Ulrich Weigand <uweigand@de.ibm.com> 2004-10-11 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.c (print_operand): Support 'S' format flag. * config/s390/s390.c (print_operand): Support 'S' format flag.
......
...@@ -100,9 +100,6 @@ static size_t deferred_count; ...@@ -100,9 +100,6 @@ static size_t deferred_count;
/* Number of deferred options scanned for -include. */ /* Number of deferred options scanned for -include. */
static size_t include_cursor; static size_t include_cursor;
/* Permit Fortran front-end options. */
static bool permit_fortran_options;
static void set_Wimplicit (int); static void set_Wimplicit (int);
static void handle_OPT_d (const char *); static void handle_OPT_d (const char *);
static void set_std_cxx98 (int); static void set_std_cxx98 (int);
...@@ -194,10 +191,10 @@ defer_opt (enum opt_code code, const char *arg) ...@@ -194,10 +191,10 @@ defer_opt (enum opt_code code, const char *arg)
/* Common initialization before parsing options. */ /* Common initialization before parsing options. */
unsigned int unsigned int
c_common_init_options (unsigned int argc, const char ** ARG_UNUSED (argv)) c_common_init_options (unsigned int argc, const char **argv)
{ {
static const unsigned int lang_flags[] = {CL_C, CL_ObjC, CL_CXX, CL_ObjCXX}; static const unsigned int lang_flags[] = {CL_C, CL_ObjC, CL_CXX, CL_ObjCXX};
unsigned int result; unsigned int i, result;
/* This is conditionalized only because that is the way the front /* This is conditionalized only because that is the way the front
ends used to do it. Maybe this should be unconditional? */ ends used to do it. Maybe this should be unconditional? */
...@@ -230,16 +227,17 @@ c_common_init_options (unsigned int argc, const char ** ARG_UNUSED (argv)) ...@@ -230,16 +227,17 @@ c_common_init_options (unsigned int argc, const char ** ARG_UNUSED (argv))
result = lang_flags[c_language]; result = lang_flags[c_language];
/* If potentially preprocessing Fortran we have to accept its front if (c_language == clk_c)
end options since the driver passes most of them through. */
#ifdef CL_F77
if (c_language == clk_c && argc > 2
&& !strcmp (argv[2], "-traditional-cpp" ))
{ {
permit_fortran_options = true; /* If preprocessing assembly language, accept any of the C-family
result |= CL_F77; front end options since the driver may pass them through. */
for (i = 1; i < argc; i++)
if (! strcmp (argv[i], "-lang-asm"))
{
result |= CL_C | CL_ObjC | CL_CXX | CL_ObjCXX;
break;
}
} }
#endif
return result; return result;
} }
...@@ -260,7 +258,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -260,7 +258,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
default: default:
if (cl_options[code].flags & (CL_C | CL_CXX | CL_ObjC | CL_ObjCXX)) if (cl_options[code].flags & (CL_C | CL_CXX | CL_ObjC | CL_ObjCXX))
break; break;
result = permit_fortran_options; result = 0;
break; break;
case OPT__output_pch_: case OPT__output_pch_:
......
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