diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-11 10:04:43 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-11 10:04:43 +0000 |
commit | 666f4bf028657b6b4d9f0e773d7ed1dff78a7e7f (patch) | |
tree | 48318d1dff4b32ecb5516a974e71f0e815752ba3 /gcc/opts.h | |
parent | e191401831ed71bd52c5b36c551cc4d60a337e62 (diff) | |
download | gcc-666f4bf028657b6b4d9f0e773d7ed1dff78a7e7f.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163095 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.h')
-rw-r--r-- | gcc/opts.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/opts.h b/gcc/opts.h index 005a846f12a..d6412c3035d 100644 --- a/gcc/opts.h +++ b/gcc/opts.h @@ -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); |