Commit 69ca7658 by Mark Mitchell Committed by Mark Mitchell

decl2.c (lang_decode_option): Adjust, in the wake of recent changes to option processing.

	* decl2.c (lang_decode_option): Adjust, in the wake of recent
	changes to option processing.

From-SVN: r29562
parent 54965141
1999-09-21 Mark Mitchell <mark@codesourcery.com>
* decl2.c (lang_decode_option): Adjust, in the wake of recent
changes to option processing.
1999-09-21 Martin v. Lwis <loewis@informatik.hu-berlin.de> 1999-09-21 Martin v. Lwis <loewis@informatik.hu-berlin.de>
* typeck.c (get_member_function_from_ptrfunc): Allow extraction of * typeck.c (get_member_function_from_ptrfunc): Allow extraction of
......
...@@ -559,7 +559,6 @@ lang_decode_option (argc, argv) ...@@ -559,7 +559,6 @@ lang_decode_option (argc, argv)
/* Some kind of -f option. /* Some kind of -f option.
P's value is the option sans `-f'. P's value is the option sans `-f'.
Search for it in the table of options. */ Search for it in the table of options. */
int found = 0;
size_t j; size_t j;
p += 2; p += 2;
...@@ -577,51 +576,36 @@ lang_decode_option (argc, argv) ...@@ -577,51 +576,36 @@ lang_decode_option (argc, argv)
|| !strcmp (p, "no-enum-int-equiv") || !strcmp (p, "no-enum-int-equiv")
|| !strcmp (p, "nonnull-objects") || !strcmp (p, "nonnull-objects")
|| !strcmp (p, "ansi-overloading")) || !strcmp (p, "ansi-overloading"))
{ /* ignore */
/* ignore */ ;
found = 1;
}
else if (!strcmp (p, "all-virtual") else if (!strcmp (p, "all-virtual")
|| !strcmp (p, "enum-int-equiv") || !strcmp (p, "enum-int-equiv")
|| !strcmp (p, "no-nonnull-objects") || !strcmp (p, "no-nonnull-objects")
|| !strcmp (p, "no-ansi-overloading")) || !strcmp (p, "no-ansi-overloading"))
{ warning ("-f%s is no longer supported", p);
warning ("-f%s is no longer supported", p);
found = 1;
}
else if (! strcmp (p, "alt-external-templates")) else if (! strcmp (p, "alt-external-templates"))
{ {
flag_external_templates = 1; flag_external_templates = 1;
flag_alt_external_templates = 1; flag_alt_external_templates = 1;
found = 1;
cp_deprecated ("-falt-external-templates"); cp_deprecated ("-falt-external-templates");
} }
else if (! strcmp (p, "no-alt-external-templates")) else if (! strcmp (p, "no-alt-external-templates"))
{ flag_alt_external_templates = 0;
flag_alt_external_templates = 0;
found = 1;
}
else if (!strcmp (p, "repo")) else if (!strcmp (p, "repo"))
{ {
flag_use_repository = 1; flag_use_repository = 1;
flag_implicit_templates = 0; flag_implicit_templates = 0;
found = 1;
} }
else if (!strcmp (p, "guiding-decls")) else if (!strcmp (p, "guiding-decls"))
{ {
flag_guiding_decls = 1; flag_guiding_decls = 1;
name_mangling_version = 0; name_mangling_version = 0;
found = 1;
} }
else if (!strcmp (p, "no-guiding-decls")) else if (!strcmp (p, "no-guiding-decls"))
{ flag_guiding_decls = 0;
flag_guiding_decls = 0;
found = 1;
}
else if (!strcmp (p, "external-templates")) else if (!strcmp (p, "external-templates"))
{ {
flag_external_templates = 1; flag_external_templates = 1;
found = 1;
cp_deprecated ("-fexternal-templates"); cp_deprecated ("-fexternal-templates");
} }
else if (!strcmp (p, "new-abi")) else if (!strcmp (p, "new-abi"))
...@@ -638,15 +622,11 @@ lang_decode_option (argc, argv) ...@@ -638,15 +622,11 @@ lang_decode_option (argc, argv)
flag_honor_std = 0; flag_honor_std = 0;
} }
else if (!strncmp (p, "template-depth-", 15)) else if (!strncmp (p, "template-depth-", 15))
{ max_tinst_depth
max_tinst_depth = = read_integral_parameter (p + 15, p - 2, max_tinst_depth);
read_integral_parameter (p + 15, p - 2, max_tinst_depth);
}
else if (!strncmp (p, "name-mangling-version-", 22)) else if (!strncmp (p, "name-mangling-version-", 22))
{ name_mangling_version
name_mangling_version = = read_integral_parameter (p + 22, p - 2, name_mangling_version);
read_integral_parameter (p + 22, p - 2, name_mangling_version);
}
else if (!strncmp (p, "dump-translation-unit-", 22)) else if (!strncmp (p, "dump-translation-unit-", 22))
{ {
if (p[22] == '\0') if (p[22] == '\0')
...@@ -654,25 +634,32 @@ lang_decode_option (argc, argv) ...@@ -654,25 +634,32 @@ lang_decode_option (argc, argv)
else else
flag_dump_translation_unit = p + 22; flag_dump_translation_unit = p + 22;
} }
else for (j = 0; else
!found && j < sizeof (lang_f_options) / sizeof (lang_f_options[0]);
j++)
{ {
if (!strcmp (p, lang_f_options[j].string)) int found = 0;
{
*lang_f_options[j].variable = lang_f_options[j].on_value; for (j = 0;
/* A goto here would be cleaner, !found && j < (sizeof (lang_f_options)
but breaks the vax pcc. */ / sizeof (lang_f_options[0]));
found = 1; j++)
}
if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
&& ! strcmp (p+3, lang_f_options[j].string))
{ {
*lang_f_options[j].variable = ! lang_f_options[j].on_value; if (!strcmp (p, lang_f_options[j].string))
found = 1; {
*lang_f_options[j].variable = lang_f_options[j].on_value;
/* A goto here would be cleaner,
but breaks the vax pcc. */
found = 1;
}
if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
&& ! strcmp (p+3, lang_f_options[j].string))
{
*lang_f_options[j].variable = ! lang_f_options[j].on_value;
found = 1;
}
} }
return found;
} }
return found;
} }
else if (p[0] == '-' && p[1] == 'W') else if (p[0] == '-' && p[1] == 'W')
{ {
......
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