aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2011-06-28 17:00:59 +0000
committerJoseph Myers <joseph@codesourcery.com>2011-06-28 17:00:59 +0000
commit138a7080123e7290c7dc18e6123a2e73533fde2a (patch)
tree3699ee680927bcf6ec7563dbe63b342be826efac /gcc/opts.c
parent7c5cd3ce998b891fe98967dba6807b10998ffc73 (diff)
* 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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@175591 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index c3e7bc7e3e1..aa85ae59df3 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -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: