diff options
author | Joseph Myers <joseph@codesourcery.com> | 2011-06-28 18:00:59 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2011-06-28 18:00:59 +0100 |
commit | a7d0d30f0b0257d66c13ea9bdd2418acc0e07830 (patch) | |
tree | 3699ee680927bcf6ec7563dbe63b342be826efac /gcc/opts.c | |
parent | cc6aa1000fd895cf12b9c5e7882dd46d34a44270 (diff) | |
download | gcc-a7d0d30f0b0257d66c13ea9bdd2418acc0e07830.zip gcc-a7d0d30f0b0257d66c13ea9bdd2418acc0e07830.tar.gz gcc-a7d0d30f0b0257d66c13ea9bdd2418acc0e07830.tar.bz2 |
common.opt (in_lto_p): New Variable entry.
* common.opt (in_lto_p): New Variable entry.
* flags.h (in_lto_p): Move to common.opt.
* gcc.c: Include params.h.
(set_option_handlers): Also use common_handle_option and
target_handle_option.
(main): Call global_init_params, finish_params and
init_options_struct.
* opts.c (debug_type_names): Move from toplev.c.
(print_filtered_help): Access quiet_flag through opts pointer.
(common_handle_option): Return early in the driver for some
options. Access in_lto_p, dwarf_version and
warn_maybe_uninitialized through opts pointer.
* toplev.c (in_lto_p): Move to common.opt.
(debug_type_names): Move to opts.c.
* Makefile.in (OBJS): Remove opts.o.
(OBJS-libcommon-target): Add opts.o.
(gcc.o): Update dependencies.
From-SVN: r175591
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -35,6 +35,12 @@ along with GCC; see the file COPYING3. If not see #include "insn-attr-common.h" #include "common/common-target.h" +/* Indexed by enum debug_info_type. */ +const char *const debug_type_names[] = +{ + "none", "stabs", "coff", "dwarf-2", "xcoff", "vms" +}; + /* Parse the -femit-struct-debug-detailed option value and set the flag variables. */ @@ -986,7 +992,7 @@ print_filtered_help (unsigned int include_flags, /* With the -Q option enabled we change the descriptive text associated with an option to be an indication of its current setting. */ - if (!quiet_flag) + if (!opts->x_quiet_flag) { void *flag_var = option_flag_var (i, opts); @@ -1246,6 +1252,9 @@ common_handle_option (struct gcc_options *opts, unsigned int undoc_mask; unsigned int i; + if (lang_mask == CL_DRIVER) + break;; + undoc_mask = ((opts->x_verbose_flag | opts->x_extra_warnings) ? 0 : CL_UNDOCUMENTED); @@ -1265,6 +1274,9 @@ common_handle_option (struct gcc_options *opts, } case OPT__target_help: + if (lang_mask == CL_DRIVER) + break; + print_specific_help (CL_TARGET, CL_UNDOCUMENTED, 0, opts, lang_mask); opts->x_exit_after_options = true; break; @@ -1280,6 +1292,9 @@ common_handle_option (struct gcc_options *opts, --help=target,^undocumented */ unsigned int exclude_flags = 0; + if (lang_mask == CL_DRIVER) + break; + /* Walk along the argument string, parsing each word in turn. The format is: arg = [^]{word}[,{arg}] @@ -1390,6 +1405,9 @@ common_handle_option (struct gcc_options *opts, } case OPT__version: + if (lang_mask == CL_DRIVER) + break; + opts->x_exit_after_options = true; break; @@ -1400,6 +1418,9 @@ common_handle_option (struct gcc_options *opts, break; case OPT_Werror_: + if (lang_mask == CL_DRIVER) + break; + enable_warning_as_error (arg, value, lang_mask, handlers, opts, opts_set, loc, dc); break; @@ -1576,7 +1597,7 @@ common_handle_option (struct gcc_options *opts, /* FIXME: Instrumentation we insert makes ipa-reference bitmaps quadratic. Disable the pass until better memory representation is done. */ - if (!opts_set->x_flag_ipa_reference && in_lto_p) + if (!opts_set->x_flag_ipa_reference && opts->x_in_lto_p) opts->x_flag_ipa_reference = false; break; @@ -1666,7 +1687,7 @@ common_handle_option (struct gcc_options *opts, if (value < 2 || value > 4) error_at (loc, "dwarf version %d is not supported", value); else - dwarf_version = value; + opts->x_dwarf_version = value; set_debug_level (DWARF2_DEBUG, false, "", opts, opts_set, loc); break; @@ -1713,7 +1734,7 @@ common_handle_option (struct gcc_options *opts, case OPT_Wuninitialized: /* Also turn on maybe uninitialized warning. */ - warn_maybe_uninitialized = value; + opts->x_warn_maybe_uninitialized = value; break; default: |