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/c-opts.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/c-opts.c')
-rw-r--r-- | gcc/c-opts.c | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 3de89e488f6..7febbf315a1 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -102,8 +102,6 @@ static size_t include_cursor; static void missing_arg (enum opt_code); static void set_Wimplicit (int); -static void complain_wrong_lang (size_t, int); -static void write_langs (char *, int); static void print_help (void); static void handle_OPT_d (const char *); static void set_std_cxx98 (int); @@ -245,7 +243,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) { const struct cl_option *option = &cl_options[scode]; enum opt_code code = (enum opt_code) scode; - int result = 1, lang_mask; + int result = 1; if (code == N_OPTS) { @@ -259,13 +257,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) return 1; } - lang_mask = lang_flags[(c_language << 1) + flag_objc]; - if (!(option->flags & lang_mask)) - { - complain_wrong_lang (code, value); - return 1; - } - if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE))) { missing_arg (code); @@ -1511,42 +1502,6 @@ handle_OPT_d (const char *arg) } } -/* Write a slash-separated list of languages in FLAGS to BUF. */ -static void -write_langs (char *buf, int flags) -{ - *buf = '\0'; - if (flags & CL_C) - strcat (buf, "C"); - if (flags & CL_ObjC) - { - if (*buf) - strcat (buf, "/"); - strcat (buf, "ObjC"); - } - if (flags & CL_CXX) - { - if (*buf) - strcat (buf, "/"); - strcat (buf, "C++"); - } -} - -/* Complain that switch OPT_INDEX does not apply to this front end. */ -static void -complain_wrong_lang (size_t opt_index, int on) -{ - char ok_langs[60], bad_langs[60]; - int ok_flags = cl_options[opt_index].flags; - - write_langs (ok_langs, ok_flags); - write_langs (bad_langs, ~ok_flags); - /* Eventually this should become a hard error. */ - warning ("\"-%c%s%s\" is valid for %s but not for %s", - cl_options[opt_index].opt_text[0], on ? "" : "no-", - cl_options[opt_index].opt_text + 1, ok_langs, bad_langs); -} - /* Handle --help output. */ static void print_help (void) |