From 5f20c6574d02381a0d928beda3eff69dc00af1cb Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 27 Jul 2010 22:23:53 +0100 Subject: coretypes.h (struct cl_option_handlers): Declare. * coretypes.h (struct cl_option_handlers): Declare. * hooks.c (hook_int_size_t_constcharptr_int_0): Remove. * hooks.h (hook_int_size_t_constcharptr_int_0): Remove. * langhooks-def.h (lhd_handle_option): Declare. (LANG_HOOKS_HANDLE_OPTION): Use lhd_handle_option. * langhooks.c (lhd_handle_option): New. * langhooks.h (struct lang_hooks): Update prototype and return value type of handle_option hook. * optc-gen.awk: Generate target_flags_explicit definition for the driver. * opts-common.c: Include diagnostic.h. (handle_option): Move from opts.c. Update prototype and return value type. Use handlers structure. (read_cmdline_option): Move from opts.c. Update prototype. Use handlers structure. (set_option): Move from opts.c. * opts.c (common_handle_option): Update prototype and return value type. Update calls to handle_option and enable_warning_as_error. (unknown_option_callback, post_handling_callback, lang_handle_option, target_handle_option): New. (handle_option, read_cmdline_option): Move to opts-common.c. (read_cmdline_options): Update prototype. Update call to read_cmdline_option. (decode_options): Initialize and use handlers structure. (set_option): Move to opts-common.c. (enable_warning_as_error): Update prototype. Update call to handle_option. * opts.h (struct cl_option_handler_func, struct cl_option_handlers): New. (handle_option, enable_warning_as_error): Update prototypes. (read_cmdline_option): Declare. * Makefile.in (opts-common.o): Update dependencies. ada: * gcc-interface/misc.c (gnat_handle_option): Update prototype and return value type. Don't check for missing arguments here. c-family: * c-common.h (c_common_handle_option): Update prototype and return value type. * c-opts.c (c_common_handle_option): Update prototype and return value type. Update calls to handle_option and enable_warning_as_error. fortran: * gfortran.h (gfc_handle_option): Update prototype and return value type. * options.c (gfc_handle_option): Update prototype and return value type. java: * lang.c (java_handle_option): Update prototype and return value type. lto: * lto-lang.c (lto_handle_option): Update prototype and return value type. Remove duplicate assignment to result. From-SVN: r162601 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/gfortran.h | 3 ++- gcc/fortran/options.c | 11 ++++++----- 3 files changed, 15 insertions(+), 6 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index dcff2b2..fb49a8d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,12 @@ 2010-07-27 Joseph Myers + * gfortran.h (gfc_handle_option): Update prototype and return + value type. + * options.c (gfc_handle_option): Update prototype and return value + type. + +2010-07-27 Joseph Myers + * cpp.c (gfc_cpp_init_options): Update prototype. Use number of decoded options in allocating deferred_opt. * cpp.h (gfc_cpp_init_options): Update prototype. diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index f082d5e..15ae26f 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2358,7 +2358,8 @@ int get_c_kind (const char *, CInteropKind_t *); unsigned int gfc_option_lang_mask (void); void gfc_init_options (unsigned int, struct cl_decoded_option *); -int gfc_handle_option (size_t, const char *, int, int); +bool gfc_handle_option (size_t, const char *, int, int, + const struct cl_option_handlers *); bool gfc_post_options (const char **); /* f95-lang.c */ diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 337802e..c49620a 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -542,20 +542,21 @@ gfc_handle_runtime_check_option (const char *arg) /* Handle command-line options. Returns 0 if unrecognized, 1 if recognized and handled. */ -int +bool gfc_handle_option (size_t scode, const char *arg, int value, - int kind ATTRIBUTE_UNUSED) + int kind ATTRIBUTE_UNUSED, + const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED) { - int result = 1; + bool result = true; enum opt_code code = (enum opt_code) scode; if (gfc_cpp_handle_option (scode, arg, value) == 1) - return 1; + return true; switch (code) { default: - result = 0; + result = false; break; case OPT_Wall: -- cgit v1.1