From a75bfaa6cdea2dd7c2e8ac2aa4f52267b3213362 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 8 Oct 2010 16:17:32 +0100 Subject: Makefile.in (TM_H): Include $(FLAGS_H) instead of options.h. * Makefile.in (TM_H): Include $(FLAGS_H) instead of options.h. (TREE_H): Include $(FLAGS_H) instead of options.h. (opts-common.o): Depend on $(FLAGS_H) instead of options.h. * c-objc-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. * common.opt (flag_complex_method, flag_evaluation_order, flag_ira_algorithm, flag_ira_region, flag_warn_unused_result): New Variable declarations. * configure.ac (tm_include_list): Include flags.h instead of options.h. * configure: Regenerate. * flags.h: Condition out contents for target libraries. Include options.h at end of file. (flag_complex_method, flag_ira_algorithm, flag_ira_region, flag_evaluation_order, flag_warn_unused_result): Remove. * gcc.c (main): Intialize global_options with global_options_init. * langhooks-def.h (lhd_init_options_struct): Declare. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. (LANG_HOOKS_INITIALIZER): Include LANG_HOOKS_INIT_OPTIONS_STRUCT. * langhooks.c (lhd_init_options_struct): New. * langhooks.h (struct lang_hooks): Add init_options_struct. Update comment on init_options. * optc-gen.awk: Generate initializer for global_options_init, not global_options. * opth-gen.awk: Condition out structure declarations for target libraries. Declare global_options_init. * opts-common.c: Include flags.h instead of options.h. * opts.c (flag_warn_unused_result): Remove. (read_cmdline_options): Take gcc_options parameters. Pass them to read_cmdline_option. (initial_lang_mask, initial_min_crossjump_insns, initial_max_fields_for_field_sensitive, initial_loop_invariant_max_bbs_in_loop): Define at file scope. (init_options_once): New. Split out of decode_options. (init_options_struct): New. Split out of decode_options. (decode_cmdline_options_to_array_default_mask): New. (default_options_optimization): New. Split out of decode_options. (decode_options): Move most code to other functions. Update call to read_cmdline_options. (finish_options): New. Split out of decode_options. * opts.h (decode_options): Add gcc_options parameters. (init_options_once, init_options_struct, decode_cmdline_options_to_array_default_mask): New. * toplev.c (flag_complex_method, flag_ira_algorithm, flag_ira_region, flag_evaluation_order): Remove. (general_init): Use global_options_init for initial flag values for global_dc. (toplev_main): Call init_options_once, init_options_struct, lang_hooks.init_options_struct, decode_cmdline_options_to_array_default_mask and lang_hooks.init_option before decode_options. Update arguments to decode_options. * tree.h: Include flags.h instead of options.h. ada: * gcc-interface/misc.c (gnat_init_options_struct): New. Split out from gnat_init_options. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. c-family: * c-common.c (parse_optimize_options): Call decode_cmdline_options_to_array_default_mask before decode_options. Update arguments to decode_options. * c-common.h (c_common_init_options_struct): Declare. * c-opts.c (c_common_init_options_struct): New. Split out from c_common_init_options. cp: * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. fortran: * f95-lang.c (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. * gfortran.h (gfc_init_options_struct): Declare. * options.c (gfc_init_options_struct): New. Split out from gfc_init_options. java: * lang.c (java_init_options_struct): New. Split out from java_init_options. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. lto: * lto-lang.c (lto_init_options): Change to lto_init_options_struct. Update parameters. (LANG_HOOKS_INIT_OPTIONS): Don't define. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. From-SVN: r165189 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/f95-lang.c | 2 ++ gcc/fortran/gfortran.h | 1 + gcc/fortran/options.c | 14 ++++++++------ 4 files changed, 18 insertions(+), 6 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 641807f..3a2af67 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2010-10-08 Joseph Myers + + * f95-lang.c (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. + * gfortran.h (gfc_init_options_struct): Declare. + * options.c (gfc_init_options_struct): New. Split out from + gfc_init_options. + 2010-10-07 Janus Weil PR fortran/45933 diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index f20e422..57696e5 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -102,6 +102,7 @@ static void gfc_init_ts (void); #undef LANG_HOOKS_FINISH #undef LANG_HOOKS_WRITE_GLOBALS #undef LANG_HOOKS_OPTION_LANG_MASK +#undef LANG_HOOKS_INIT_OPTIONS_STRUCT #undef LANG_HOOKS_INIT_OPTIONS #undef LANG_HOOKS_HANDLE_OPTION #undef LANG_HOOKS_POST_OPTIONS @@ -132,6 +133,7 @@ static void gfc_init_ts (void); #define LANG_HOOKS_FINISH gfc_finish #define LANG_HOOKS_WRITE_GLOBALS gfc_write_global_declarations #define LANG_HOOKS_OPTION_LANG_MASK gfc_option_lang_mask +#define LANG_HOOKS_INIT_OPTIONS_STRUCT gfc_init_options_struct #define LANG_HOOKS_INIT_OPTIONS gfc_init_options #define LANG_HOOKS_HANDLE_OPTION gfc_handle_option #define LANG_HOOKS_POST_OPTIONS gfc_post_options diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index a2287a5..8a415f4 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2398,6 +2398,7 @@ int get_c_kind (const char *, CInteropKind_t *); /* options.c */ unsigned int gfc_option_lang_mask (void); +void gfc_init_options_struct (struct gcc_options *); void gfc_init_options (unsigned int, struct cl_decoded_option *); bool gfc_handle_option (size_t, const char *, int, int, diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index b36dd72..a65a63a 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -62,6 +62,14 @@ gfc_option_lang_mask (void) return CL_Fortran; } +/* Initialize options structure OPTS. */ + +void +gfc_init_options_struct (struct gcc_options *opts) +{ + opts->x_flag_errno_math = 0; + opts->x_flag_associative_math = -1; +} /* Get ready for options handling. Keep in sync with libgfortran/runtime/compile_options.c (init_compile_options). */ @@ -145,14 +153,8 @@ gfc_init_options (unsigned int decoded_options_count, gfc_option.rtcheck = 0; gfc_option.coarray = GFC_FCOARRAY_NONE; - flag_errno_math = 0; - flag_associative_math = -1; - set_default_std_flags (); - /* -fshort-enums can be default on some targets. */ - flag_short_enums = targetm.default_short_enums (); - /* Initialize cpp-related options. */ gfc_cpp_init_options (decoded_options_count, decoded_options); } -- cgit v1.1