diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-08-11 11:04:43 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2010-08-11 11:04:43 +0100 |
commit | 481e1176d7614dcd519e50c488a155312280913e (patch) | |
tree | 48318d1dff4b32ecb5516a974e71f0e815752ba3 /gcc/opts.h | |
parent | 3abeaf8f89f246f481c869a09d0715a2762bde28 (diff) | |
download | gcc-481e1176d7614dcd519e50c488a155312280913e.zip gcc-481e1176d7614dcd519e50c488a155312280913e.tar.gz gcc-481e1176d7614dcd519e50c488a155312280913e.tar.bz2 |
opts.h (struct cl_option_handler_func): Make handler take cl_decoded_option structure as parameter, not individual elements.
* opts.h (struct cl_option_handler_func): Make handler take
cl_decoded_option structure as parameter, not individual elements.
(struct cl_option_handlers): Make callbacks take cl_decoded_option
structure as parameter, not individual elements.
(handle_option): Take cl_decoded_option structure as parameter,
not individual elements.
(handle_generated_option): Declare.
* opts-common.c (handle_option): Take cl_decoded_option structure
as parameter, not individual elements. Update calls to callback
and handler functions.
(handle_generated_option): New.
(read_cmdline_option): Update calls to callback functions and
handle_option.
* opts.c (common_handle_option, complain_wrong_lang,
unknown_option_callback, post_handling_callback,
lang_handle_option, target_handle_option): Take cl_decoded_option
structure as parameter, not individual elements.
(lang_handle_option, target_handle_option, common_handle_option):
Assert option has at most one argument.
(enable_warning_as_error): Call handle_generated_option instead of
handle_option. Do not pass -Werror argument as argument of
generated option.
c-family:
* c-opts.c (c_common_handle_option): Call handle_generated_option
instead of handle_option.
From-SVN: r163095
Diffstat (limited to 'gcc/opts.h')
-rw-r--r-- | gcc/opts.h | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -142,7 +142,7 @@ struct cl_decoded_option struct cl_option_handler_func { /* The function called to handle the option. */ - bool (*handler) (size_t opt_index, const char *arg, int value, + bool (*handler) (const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, const struct cl_option_handlers *handlers); @@ -159,17 +159,16 @@ struct cl_option_handlers error for it, and possibly store information to diagnose the option at a later point. Return true if an error should be given, false otherwise. */ - bool (*unknown_option_callback) (const char *opt); + bool (*unknown_option_callback) (const struct cl_decoded_option *decoded); /* Callback to handle, and possibly diagnose, an option for another language. */ - void (*wrong_lang_callback) (const char *text, - const struct cl_option *option, + void (*wrong_lang_callback) (const struct cl_decoded_option *decoded, unsigned int lang_mask); /* Callback to call after the successful handling of any option. */ - void (*post_handling_callback) (size_t opt_index, const char *arg, - int value, unsigned int mask); + void (*post_handling_callback) (const struct cl_decoded_option *decoded, + unsigned int mask); /* The number of individual handlers. */ size_t num_handlers; @@ -200,9 +199,12 @@ extern void decode_options (unsigned int argc, const char **argv, extern int option_enabled (int opt_idx); extern bool get_option_state (int, struct cl_option_state *); extern void set_option (int opt_index, int value, const char *arg, int); -bool handle_option (size_t opt_index, const char *arg, int value, +bool handle_option (const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, const struct cl_option_handlers *handlers); +bool handle_generated_option (size_t opt_index, const char *arg, int value, + unsigned int lang_mask, int kind, + const struct cl_option_handlers *handlers); extern void read_cmdline_option (struct cl_decoded_option *decoded, unsigned int lang_mask, const struct cl_option_handlers *handlers); |