* 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
+2011-06-28 Joseph Myers <joseph@codesourcery.com>
+
+ * 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.
+
2011-06-28 Kai Tietz <ktietz@redhat.com>
* tree-ssa-forwprop.c (simplify_bitwise_binary): Improve
optabs.o \
options-save.o \
opts-global.o \
- opts.o \
passes.o \
plugin.o \
pointer-set.o \
# Objects in libcommon-target.a, used by drivers and by the core
# compiler and containing target-dependent code.
OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
- opts-common.o options.o vec.o hooks.o common/common-targhooks.o
+ opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o
# This lists all host objects for the front ends.
ALL_HOST_FRONTEND_OBJS = $(C_OBJS) \
gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \
Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) $(FLAGS_H) \
- configargs.h $(OBSTACK_H) $(OPTS_H) $(DIAGNOSTIC_H) $(VEC_H)
+ configargs.h $(OBSTACK_H) $(OPTS_H) $(DIAGNOSTIC_H) $(VEC_H) $(PARAMS_H)
(SHLIB_LINK='$(SHLIB_LINK)'; \
$(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
$(DRIVER_DEFINES) \
Variable
int optimize_fast
+; True if this is the lto front end. This is used to disable gimple
+; generation and lowering passes that are normally run on the output
+; of a front end. These passes must be bypassed for lto since they
+; have already been done before the gimple was written.
+Variable
+bool in_lto_p = false
+
; 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.
/* Compilation switch flag definitions for GCC.
Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
extern void strip_off_ending (char *, int);
extern int base_of_path (const char *path, const char **base_out);
-/* True if this is the LTO front end (lto1). This is used to disable
- gimple generation and lowering passes that are normally run on the
- output of a front end. These passes must be bypassed for lto since
- they have already been done before the gimple was written. */
-
-extern bool in_lto_p;
-
/* Return true iff flags are set as if -ffast-math. */
extern bool fast_math_flags_set_p (const struct gcc_options *);
extern bool fast_math_flags_struct_set_p (struct cl_optimization *);
#include "diagnostic.h"
#include "flags.h"
#include "opts.h"
+#include "params.h"
#include "vec.h"
#include "filenames.h"
handlers->unknown_option_callback = driver_unknown_option_callback;
handlers->wrong_lang_callback = driver_wrong_lang_callback;
handlers->post_handling_callback = driver_post_handling_callback;
- handlers->num_handlers = 1;
+ handlers->num_handlers = 3;
handlers->handlers[0].handler = driver_handle_option;
handlers->handlers[0].mask = CL_DRIVER;
+ handlers->handlers[1].handler = common_handle_option;
+ handlers->handlers[1].mask = CL_COMMON;
+ handlers->handlers[2].handler = target_handle_option;
+ handlers->handlers[2].mask = CL_TARGET;
}
/* Create the vector `switches' and its contents.
if (argv != old_argv)
at_file_supplied = true;
- global_options = global_options_init;
+ /* Register the language-independent parameters. */
+ global_init_params ();
+ finish_params ();
+
+ init_options_struct (&global_options, &global_options_set);
decode_cmdline_options_to_array (argc, CONST_CAST2 (const char **, char **,
argv),
#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. */
/* 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);
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);
}
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;
--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}]
}
case OPT__version:
+ if (lang_mask == CL_DRIVER)
+ break;
+
opts->x_exit_after_options = true;
break;
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;
/* 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;
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;
case OPT_Wuninitialized:
/* Also turn on maybe uninitialized warning. */
- warn_maybe_uninitialized = value;
+ opts->x_warn_maybe_uninitialized = value;
break;
default:
const struct gcc_debug_hooks *debug_hooks;
-/* True if this is the lto front end. This is used to disable
- gimple generation and lowering passes that are normally run on the
- output of a front end. These passes must be bypassed for lto since
- they have already been done before the gimple was written. */
-
-bool in_lto_p = false;
-
/* The FUNCTION_DECL for the function currently being compiled,
or 0 if between functions. */
tree current_function_decl;
timevar_stop (TV_PHASE_GENERATE);
}
-/* Indexed by enum debug_info_type. */
-const char *const debug_type_names[] =
-{
- "none", "stabs", "coff", "dwarf-2", "xcoff", "vms"
-};
-
/* Print version information to FILE.
Each line begins with INDENT (for the case where FILE is the
assembler output file). */