diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-25 20:43:11 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-25 20:43:11 +0000 |
commit | 9cf6679e085217d7889ecb74decc28b6c05dcc61 (patch) | |
tree | 25f8abe318d6c95cb74e8c8f0c6880e9b296e4bf /gcc/toplev.c | |
parent | 2bb16ec5e3ee9fa83b52b54860a8f3930c707b75 (diff) | |
download | gcc-9cf6679e085217d7889ecb74decc28b6c05dcc61.tar.gz |
* c-opts.c (complain_wrong_lang, write_langs): Remove.
(c_common_handle_option): Complaints about wrong language are
handled in opts.c now.
* opts.c (complain_wrong_lang, write_langs, handle_options): New.
(find_opt): Fix thinko.
(handle_option): Update prototype. Complain about switches for
a different front end.
* opts.h (lang_names, handle_options): New.
(handle_option): Remove.
* opts.sh: Write out language names array.
* toplev.c (parse_options_and_default_flags): Use handle_options.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68495 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index c36bb6b45f6..68fbb29f20d 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4735,58 +4735,7 @@ parse_options_and_default_flags (int argc, char **argv) OPTIMIZATION_OPTIONS (optimize, optimize_size); #endif - /* Perform normal command line switch decoding. */ - for (i = 1; i < argc;) - { - int processed; - - /* Give the language a chance to decode the option for itself. */ - processed = handle_option (argc - i, argv + i, lang_mask); - - if (processed) - i += processed; - else - { - const char *option = NULL; - const char *lang = NULL; - unsigned int j; - - /* It is possible that the command line switch is not valid for the - current language, but it is valid for another language. In order - to be compatible with previous versions of the compiler (which - did not issue an error message in this case) we check for this - possibility here. If we do find a match, then if extra_warnings - is set we generate a warning message, otherwise we will just - ignore the option. */ - for (j = 0; j < ARRAY_SIZE (documented_lang_options); j++) - { - option = documented_lang_options[j].option; - - if (option == NULL) - lang = documented_lang_options[j].description; - else if (! strncmp (argv[i], option, strlen (option))) - break; - } - - if (j != ARRAY_SIZE (documented_lang_options)) - { - if (extra_warnings) - { - warning ("ignoring command line option '%s'", argv[i]); - if (lang) - warning - ("(it is valid for %s but not the selected language)", - lang); - } - } - else if (argv[i][0] == '-' && argv[i][1] == 'g') - warning ("`%s': unknown or unsupported -g option", &argv[i][2]); - else - error ("unrecognized option `%s'", argv[i]); - - i++; - } - } + handle_options (argc, argv, lang_mask); if (flag_pie) flag_pic = flag_pie; |