diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-10-08 16:17:32 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2010-10-08 16:17:32 +0100 |
commit | a75bfaa6cdea2dd7c2e8ac2aa4f52267b3213362 (patch) | |
tree | d7c6e9b6d0c3fea0b0d512fb08735055168c35e6 /gcc/toplev.c | |
parent | e899aa1613680d530fad1848a13ff91236b91b44 (diff) | |
download | gcc-a75bfaa6cdea2dd7c2e8ac2aa4f52267b3213362.zip gcc-a75bfaa6cdea2dd7c2e8ac2aa4f52267b3213362.tar.gz gcc-a75bfaa6cdea2dd7c2e8ac2aa4f52267b3213362.tar.bz2 |
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
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 80487f6..a6c13f1 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -198,12 +198,6 @@ unsigned local_tick; /* -f flags. */ -/* 0 means straightforward implementation of complex divide acceptable. - 1 means wide ranges of inputs must work for complex divide. - 2 means C99-like requirements for complex multiply and divide. */ - -int flag_complex_method = 1; - /* Nonzero means we should be saving declaration info into a .X file. */ int flag_gen_aux_info = 0; @@ -229,12 +223,6 @@ int flag_next_runtime = 0; enum tls_model flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC; -/* Set the default region and algorithm for the integrated register - allocator. */ - -enum ira_algorithm flag_ira_algorithm = IRA_ALGORITHM_CB; -enum ira_region flag_ira_region = IRA_REGION_MIXED; - /* Set the default for excess precision. */ enum excess_precision flag_excess_precision_cmdline = EXCESS_PRECISION_DEFAULT; @@ -293,9 +281,6 @@ typedef struct } lang_independent_options; -/* Nonzero if subexpressions must be evaluated from left-to-right. */ -int flag_evaluation_order = 0; - /* The user symbol prefix after having resolved same. */ const char *user_label_prefix; @@ -1661,8 +1646,10 @@ general_init (const char *argv0) /* Set a default printer. Language specific initializations will override it later. */ pp_format_decoder (global_dc->printer) = &default_tree_printer; - global_dc->show_option_requested = flag_diagnostics_show_option; - global_dc->show_column = flag_show_column; + global_dc->show_option_requested + = global_options_init.x_flag_diagnostics_show_option; + global_dc->show_column + = global_options_init.x_flag_show_column; global_dc->internal_error = plugins_internal_error_function; global_dc->option_enabled = option_enabled; global_dc->option_state = &global_options; @@ -2395,10 +2382,29 @@ toplev_main (int argc, char **argv) /* Initialization of GCC's environment, and diagnostics. */ general_init (argv[0]); + /* One-off initialization of options that does not need to be + repeated when options are added for particular functions. */ + init_options_once (); + + /* Initialize global options structures; this must be repeated for + each structure used for parsing options. */ + init_options_struct (&global_options, &global_options_set); + lang_hooks.init_options_struct (&global_options); + + /* Convert the options to an array. */ + decode_cmdline_options_to_array_default_mask (argc, + CONST_CAST2 (const char **, + char **, argv), + &save_decoded_options, + &save_decoded_options_count); + + /* Perform language-specific options initialization. */ + lang_hooks.init_options (save_decoded_options_count, save_decoded_options); + /* Parse the options and do minimal processing; basically just enough to default flags appropriately. */ - decode_options (argc, CONST_CAST2 (const char **, char **, argv), - &save_decoded_options, &save_decoded_options_count); + decode_options (&global_options, &global_options_set, + save_decoded_options, save_decoded_options_count); init_local_tick (); |