Commit 21bf1558 by Joseph Myers Committed by Joseph Myers

options.texi (Var): Document effects of Defer.

	* doc/options.texi (Var): Document effects of Defer.
	(Defer): Document.
	* opt-functions.awk (var_type, var_set): Handle deferred options.
	* opts-common.c (set_option): Handle CLVC_DEFER.
	* common.opt (fcall-saved-, fcall-used-, fdump-, ffixed-,
	fplugin=, fplugin-arg-, fstack-limit, fstack-limit-register=,
	fstack-limit-symbol=): Mark as deferred.
	* opts.c: Don't include rtl.h, ggc.h, output.h, tree-pass.h or
	plugin.h.
	(print_filtered_help): Don't report state of CLVC_DEFER options.
	(common_handle_option): Move code for OPT_fcall_used_,
	OPT_fcall_saved_, OPT_fdump_, OPT_ffixed_, OPT_fplugin_,
	OPT_fplugin_arg_, OPT_fstack_limit, OPT_fstack_limit_register_ and
	OPT_fstack_limit_symbol_ to opts-global.c.
	(option_enabled, get_option_state): Handle CLVC_DEFER.
	* opts.h: Include vec.h.
	(enum cl_var_type): Add CLVC_DEFER.
	(cl_deferred_option): Define type and vectors.
	(handle_common_deferred_options): Declare.
	* opts-global.c: New.
	* toplev.c (toplev_main): Call handle_common_deferred_options
	* Makefile.in (OPTS_H): Include $(VEC_H).
	(OBJS-common): Include opts-global.o.
	(opts.o): Update dependencies.
	(opts-global.o): Add dependencies.

From-SVN: r166942
parent 3be0ac86
2010-11-19 Joseph Myers <joseph@codesourcery.com>
* doc/options.texi (Var): Document effects of Defer.
(Defer): Document.
* opt-functions.awk (var_type, var_set): Handle deferred options.
* opts-common.c (set_option): Handle CLVC_DEFER.
* common.opt (fcall-saved-, fcall-used-, fdump-, ffixed-,
fplugin=, fplugin-arg-, fstack-limit, fstack-limit-register=,
fstack-limit-symbol=): Mark as deferred.
* opts.c: Don't include rtl.h, ggc.h, output.h, tree-pass.h or
plugin.h.
(print_filtered_help): Don't report state of CLVC_DEFER options.
(common_handle_option): Move code for OPT_fcall_used_,
OPT_fcall_saved_, OPT_fdump_, OPT_ffixed_, OPT_fplugin_,
OPT_fplugin_arg_, OPT_fstack_limit, OPT_fstack_limit_register_ and
OPT_fstack_limit_symbol_ to opts-global.c.
(option_enabled, get_option_state): Handle CLVC_DEFER.
* opts.h: Include vec.h.
(enum cl_var_type): Add CLVC_DEFER.
(cl_deferred_option): Define type and vectors.
(handle_common_deferred_options): Declare.
* opts-global.c: New.
* toplev.c (toplev_main): Call handle_common_deferred_options
* Makefile.in (OPTS_H): Include $(VEC_H).
(OBJS-common): Include opts-global.o.
(opts.o): Update dependencies.
(opts-global.o): Add dependencies.
2010-11-19 Nicola Pero <nicola.pero@meta-innovation.com> 2010-11-19 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_protocol_definition): Pass attributes * c-parser.c (c_parser_objc_protocol_definition): Pass attributes
...@@ -932,7 +932,7 @@ PREDICT_H = predict.h predict.def ...@@ -932,7 +932,7 @@ PREDICT_H = predict.h predict.def
CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \ CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
$(srcdir)/../libcpp/include/cpplib.h $(srcdir)/../libcpp/include/cpplib.h
INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h
OPTS_H = $(INPUT_H) opts.h OPTS_H = $(INPUT_H) $(VEC_H) opts.h
DECNUM_H = $(DECNUM)/decContext.h $(DECNUM)/decDPD.h $(DECNUM)/decNumber.h \ DECNUM_H = $(DECNUM)/decContext.h $(DECNUM)/decDPD.h $(DECNUM)/decNumber.h \
$(DECNUMFMT)/decimal32.h $(DECNUMFMT)/decimal64.h \ $(DECNUMFMT)/decimal32.h $(DECNUMFMT)/decimal64.h \
$(DECNUMFMT)/decimal128.h $(DECNUMFMT)/decimal128Local.h $(DECNUMFMT)/decimal128.h $(DECNUMFMT)/decimal128Local.h
...@@ -1295,6 +1295,7 @@ OBJS-common = \ ...@@ -1295,6 +1295,7 @@ OBJS-common = \
optabs.o \ optabs.o \
options.o \ options.o \
opts-common.o \ opts-common.o \
opts-global.o \
opts.o \ opts.o \
params.o \ params.o \
passes.o \ passes.o \
...@@ -2809,10 +2810,13 @@ fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ ...@@ -2809,10 +2810,13 @@ fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
version.h $(INPUT_H) intl.h $(DIAGNOSTIC_H) diagnostic.def version.h $(INPUT_H) intl.h $(DIAGNOSTIC_H) diagnostic.def
opts.o : opts.c $(OPTS_H) $(OPTIONS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(CONFIG_H) $(SYSTEM_H) \ opts.o : opts.c $(OPTS_H) $(OPTIONS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(EXPR_H) $(RTL_H) \ coretypes.h $(TREE_H) $(TM_H) langhooks.h $(EXPR_H) \
output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \ $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \
$(FLAGS_H) $(PARAMS_H) $(TREE_PASS_H) $(DBGCNT_H) debug.h \ $(FLAGS_H) $(PARAMS_H) $(DBGCNT_H) debug.h \
$(PLUGIN_H) $(EXCEPT_H) $(LTO_STREAMER_H) opts-diagnostic.h $(EXCEPT_H) $(LTO_STREAMER_H) opts-diagnostic.h
opts-global.o : opts-global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(DIAGNOSTIC_CORE_H) $(OPTS_H) $(FLAGS_H) $(GGC_H) $(TM_H) $(RTL_H) \
output.h $(PLUGIN_H) $(TREE_PASS_H)
opts-common.o : opts-common.c $(OPTS_H) $(FLAGS_H) $(CONFIG_H) $(SYSTEM_H) \ opts-common.o : opts-common.c $(OPTS_H) $(FLAGS_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h intl.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h intl.h $(DIAGNOSTIC_H) $(TM_H)
targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
......
...@@ -710,11 +710,11 @@ Common Report Var(flag_btr_bb_exclusive) Optimization ...@@ -710,11 +710,11 @@ Common Report Var(flag_btr_bb_exclusive) Optimization
Restrict target load migration not to re-use registers in any basic block Restrict target load migration not to re-use registers in any basic block
fcall-saved- fcall-saved-
Common Joined RejectNegative Common Joined RejectNegative Var(common_deferred_options) Defer
-fcall-saved-<register> Mark <register> as being preserved across functions -fcall-saved-<register> Mark <register> as being preserved across functions
fcall-used- fcall-used-
Common Joined RejectNegative Common Joined RejectNegative Var(common_deferred_options) Defer
-fcall-used-<register> Mark <register> as being corrupted by function calls -fcall-used-<register> Mark <register> as being corrupted by function calls
; Nonzero for -fcaller-saves: allocate values in regs that need to ; Nonzero for -fcaller-saves: allocate values in regs that need to
...@@ -815,7 +815,7 @@ Common Var(flag_diagnostics_show_option) Init(1) ...@@ -815,7 +815,7 @@ Common Var(flag_diagnostics_show_option) Init(1)
Amend appropriate diagnostic messages with the command line option that controls them Amend appropriate diagnostic messages with the command line option that controls them
fdump- fdump-
Common Joined RejectNegative Common Joined RejectNegative Var(common_deferred_options) Defer
-fdump-<type> Dump various compiler internals to a file -fdump-<type> Dump various compiler internals to a file
fdump-final-insns fdump-final-insns
...@@ -893,7 +893,7 @@ Common Report Var(flag_finite_math_only) Optimization ...@@ -893,7 +893,7 @@ Common Report Var(flag_finite_math_only) Optimization
Assume no NaNs or infinities are generated Assume no NaNs or infinities are generated
ffixed- ffixed-
Common Joined RejectNegative Common Joined RejectNegative Var(common_deferred_options) Defer
-ffixed-<register> Mark <register> as being unavailable to the compiler -ffixed-<register> Mark <register> as being unavailable to the compiler
ffloat-store ffloat-store
...@@ -1306,11 +1306,11 @@ Common Report Var(flag_pie,1) ...@@ -1306,11 +1306,11 @@ Common Report Var(flag_pie,1)
Generate position-independent code for executables if possible (small mode) Generate position-independent code for executables if possible (small mode)
fplugin= fplugin=
Common Joined RejectNegative Common Joined RejectNegative Var(common_deferred_options) Defer
Specify a plugin to load Specify a plugin to load
fplugin-arg- fplugin-arg-
Common Joined RejectNegative Common Joined RejectNegative Var(common_deferred_options) Defer
-fplugin-arg-<name>-<key>[=<value>] Specify argument <key>=<value> for plugin <name> -fplugin-arg-<name>-<key>[=<value>] Specify argument <key>=<value> for plugin <name>
fpredictive-commoning fpredictive-commoning
...@@ -1573,14 +1573,14 @@ Common Alias(fstack-check=, specific, no) ...@@ -1573,14 +1573,14 @@ Common Alias(fstack-check=, specific, no)
Insert stack checking code into the program. Same as -fstack-check=specific Insert stack checking code into the program. Same as -fstack-check=specific
fstack-limit fstack-limit
Common Common Var(common_deferred_options) Defer
fstack-limit-register= fstack-limit-register=
Common RejectNegative Joined Common RejectNegative Joined Var(common_deferred_options) Defer
-fstack-limit-register=<register> Trap if the stack goes past <register> -fstack-limit-register=<register> Trap if the stack goes past <register>
fstack-limit-symbol= fstack-limit-symbol=
Common RejectNegative Joined Common RejectNegative Joined Var(common_deferred_options) Defer
-fstack-limit-symbol=<name> Trap if the stack goes past symbol <name> -fstack-limit-symbol=<name> Trap if the stack goes past symbol <name>
fstack-protector fstack-protector
......
...@@ -201,6 +201,12 @@ If the option takes an argument and has the @code{UInteger} property, ...@@ -201,6 +201,12 @@ If the option takes an argument and has the @code{UInteger} property,
@var{var} is an integer variable that stores the value of the argument. @var{var} is an integer variable that stores the value of the argument.
@item @item
If the option has the @code{Defer} property, @var{var} is a pointer to
a @code{VEC(cl_deferred_option,heap)} that stores the option for later
processing. (@var{var} is declared with type @code{void *} and needs
to be cast to @code{VEC(cl_deferred_option,heap)} before use.)
@item
Otherwise, if the option takes an argument, @var{var} is a pointer to Otherwise, if the option takes an argument, @var{var} is a pointer to
the argument string. The pointer will be null if the argument is optional the argument string. The pointer will be null if the argument is optional
and wasn't given. and wasn't given.
...@@ -255,6 +261,10 @@ The main purpose of this property is to support synonymous options. ...@@ -255,6 +261,10 @@ The main purpose of this property is to support synonymous options.
The first option should use @samp{Mask(@var{name})} and the others The first option should use @samp{Mask(@var{name})} and the others
should use @samp{Mask(@var{name}) MaskExists}. should use @samp{Mask(@var{name}) MaskExists}.
@item Defer
The option should be stored in a vector, specified with @code{Var},
for later processing.
@item Alias(@var{opt}) @item Alias(@var{opt})
@itemx Alias(@var{opt}, @var{arg}) @itemx Alias(@var{opt}, @var{arg})
@itemx Alias(@var{opt}, @var{posarg}, @var{negarg}) @itemx Alias(@var{opt}, @var{posarg}, @var{negarg})
......
...@@ -148,7 +148,9 @@ function static_var(name, flags) ...@@ -148,7 +148,9 @@ function static_var(name, flags)
# Return the type of variable that should be associated with the given flags. # Return the type of variable that should be associated with the given flags.
function var_type(flags) function var_type(flags)
{ {
if (!flag_set_p("Joined.*", flags) && !flag_set_p("Separate", flags)) if (flag_set_p("Defer", flags))
return "void *"
else if (!flag_set_p("Joined.*", flags) && !flag_set_p("Separate", flags))
return "int " return "int "
else if (flag_set_p("UInteger", flags)) else if (flag_set_p("UInteger", flags))
return "int " return "int "
...@@ -177,6 +179,8 @@ function var_type_struct(flags) ...@@ -177,6 +179,8 @@ function var_type_struct(flags)
# "var_cond" and "var_value" fields of its cl_options[] entry. # "var_cond" and "var_value" fields of its cl_options[] entry.
function var_set(flags) function var_set(flags)
{ {
if (flag_set_p("Defer", flags))
return "CLVC_DEFER, 0"
s = nth_arg(1, opt_args("Var", flags)) s = nth_arg(1, opt_args("Var", flags))
if (s != "") if (s != "")
return "CLVC_EQUAL, " s return "CLVC_EQUAL, " s
......
...@@ -958,6 +958,22 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set, ...@@ -958,6 +958,22 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set,
if (set_flag_var) if (set_flag_var)
*(const char **) set_flag_var = ""; *(const char **) set_flag_var = "";
break; break;
case CLVC_DEFER:
{
VEC(cl_deferred_option,heap) *vec
= (VEC(cl_deferred_option,heap) *) *(void **) flag_var;
cl_deferred_option *p;
p = VEC_safe_push (cl_deferred_option, heap, vec, NULL);
p->opt_index = opt_index;
p->arg = arg;
p->value = value;
*(void **) flag_var = vec;
if (set_flag_var)
*(void **) set_flag_var = vec;
}
break;
} }
if ((diagnostic_t) kind != DK_UNSPECIFIED if ((diagnostic_t) kind != DK_UNSPECIFIED
......
/* Command line option handling. Code involving global state that
should not be shared with the driver.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "diagnostic-core.h"
#include "opts.h"
#include "flags.h"
#include "ggc.h"
#include "tm.h" /* Required by rtl.h. */
#include "rtl.h"
#include "output.h"
#include "plugin.h"
#include "tree-pass.h"
void
handle_common_deferred_options (void)
{
unsigned int i;
cl_deferred_option *opt;
VEC(cl_deferred_option,heap) *vec
= (VEC(cl_deferred_option,heap) *) common_deferred_options;
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
{
switch (opt->opt_index)
{
case OPT_fcall_used_:
fix_register (opt->arg, 0, 1);
break;
case OPT_fcall_saved_:
fix_register (opt->arg, 0, 0);
break;
case OPT_fdump_:
if (!dump_switch_p (opt->arg))
error ("unrecognized command line option %<-fdump-%s%>", opt->arg);
break;
case OPT_ffixed_:
/* Deferred. */
fix_register (opt->arg, 1, 1);
break;
case OPT_fplugin_:
#ifdef ENABLE_PLUGIN
add_new_plugin (opt->arg);
#else
error ("plugin support is disabled; configure with --enable-plugin");
#endif
break;
case OPT_fplugin_arg_:
#ifdef ENABLE_PLUGIN
parse_plugin_arg_opt (opt->arg);
#else
error ("plugin support is disabled; configure with --enable-plugin");
#endif
break;
case OPT_fstack_limit:
/* The real switch is -fno-stack-limit. */
gcc_assert (!opt->value);
stack_limit_rtx = NULL_RTX;
break;
case OPT_fstack_limit_register_:
{
int reg = decode_reg_name (opt->arg);
if (reg < 0)
error ("unrecognized register name %qs", opt->arg);
else
stack_limit_rtx = gen_rtx_REG (Pmode, reg);
}
break;
case OPT_fstack_limit_symbol_:
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt->arg));
break;
default:
gcc_unreachable ();
}
}
}
...@@ -25,10 +25,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -25,10 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h" #include "coretypes.h"
#include "tm.h" #include "tm.h"
#include "tree.h" #include "tree.h"
#include "rtl.h"
#include "expr.h" #include "expr.h"
#include "ggc.h"
#include "output.h"
#include "langhooks.h" #include "langhooks.h"
#include "opts.h" #include "opts.h"
#include "options.h" #include "options.h"
...@@ -39,10 +36,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -39,10 +36,8 @@ along with GCC; see the file COPYING3. If not see
#include "opts-diagnostic.h" #include "opts-diagnostic.h"
#include "insn-attr.h" /* For INSN_SCHEDULING. */ #include "insn-attr.h" /* For INSN_SCHEDULING. */
#include "target.h" #include "target.h"
#include "tree-pass.h"
#include "dbgcnt.h" #include "dbgcnt.h"
#include "debug.h" #include "debug.h"
#include "plugin.h"
#include "except.h" #include "except.h"
#include "lto-streamer.h" #include "lto-streamer.h"
...@@ -1443,7 +1438,8 @@ print_filtered_help (unsigned int include_flags, ...@@ -1443,7 +1438,8 @@ print_filtered_help (unsigned int include_flags,
else else
strcpy (new_help, "\t"); strcpy (new_help, "\t");
if (flag_var != NULL) if (flag_var != NULL
&& option->var_type != CLVC_DEFER)
{ {
if (option->flags & CL_JOINED) if (option->flags & CL_JOINED)
{ {
...@@ -1842,11 +1838,8 @@ common_handle_option (struct gcc_options *opts, ...@@ -1842,11 +1838,8 @@ common_handle_option (struct gcc_options *opts,
break; break;
case OPT_fcall_used_: case OPT_fcall_used_:
fix_register (arg, 0, 1);
break;
case OPT_fcall_saved_: case OPT_fcall_saved_:
fix_register (arg, 0, 0); /* Deferred. */
break; break;
case OPT_fcompare_debug_second: case OPT_fcompare_debug_second:
...@@ -1880,8 +1873,7 @@ common_handle_option (struct gcc_options *opts, ...@@ -1880,8 +1873,7 @@ common_handle_option (struct gcc_options *opts,
break; break;
case OPT_fdump_: case OPT_fdump_:
if (!dump_switch_p (arg)) /* Deferred. */
return false;
break; break;
case OPT_ffp_contract_: case OPT_ffp_contract_:
...@@ -1914,7 +1906,7 @@ common_handle_option (struct gcc_options *opts, ...@@ -1914,7 +1906,7 @@ common_handle_option (struct gcc_options *opts,
break; break;
case OPT_ffixed_: case OPT_ffixed_:
fix_register (arg, 1, 1); /* Deferred. */
break; break;
case OPT_finline_limit_: case OPT_finline_limit_:
...@@ -1949,19 +1941,8 @@ common_handle_option (struct gcc_options *opts, ...@@ -1949,19 +1941,8 @@ common_handle_option (struct gcc_options *opts,
break; break;
case OPT_fplugin_: case OPT_fplugin_:
#ifdef ENABLE_PLUGIN
add_new_plugin (arg);
#else
error ("plugin support is disabled; configure with --enable-plugin");
#endif
break;
case OPT_fplugin_arg_: case OPT_fplugin_arg_:
#ifdef ENABLE_PLUGIN /* Deferred. */
parse_plugin_arg_opt (arg);
#else
error ("plugin support is disabled; configure with --enable-plugin");
#endif
break; break;
case OPT_fprofile_dir_: case OPT_fprofile_dir_:
...@@ -2087,21 +2068,12 @@ common_handle_option (struct gcc_options *opts, ...@@ -2087,21 +2068,12 @@ common_handle_option (struct gcc_options *opts,
/* The real switch is -fno-stack-limit. */ /* The real switch is -fno-stack-limit. */
if (value) if (value)
return false; return false;
stack_limit_rtx = NULL_RTX; /* Deferred. */
break; break;
case OPT_fstack_limit_register_: case OPT_fstack_limit_register_:
{
int reg = decode_reg_name (arg);
if (reg < 0)
error ("unrecognized register name \"%s\"", arg);
else
stack_limit_rtx = gen_rtx_REG (Pmode, reg);
}
break;
case OPT_fstack_limit_symbol_: case OPT_fstack_limit_symbol_:
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (arg)); /* Deferred. */
break; break;
case OPT_ftree_vectorizer_verbose_: case OPT_ftree_vectorizer_verbose_:
...@@ -2383,6 +2355,7 @@ option_enabled (int opt_idx, void *opts) ...@@ -2383,6 +2355,7 @@ option_enabled (int opt_idx, void *opts)
return (*(int *) flag_var & option->var_value) != 0; return (*(int *) flag_var & option->var_value) != 0;
case CLVC_STRING: case CLVC_STRING:
case CLVC_DEFER:
break; break;
} }
return -1; return -1;
...@@ -2421,6 +2394,9 @@ get_option_state (struct gcc_options *opts, int option, ...@@ -2421,6 +2394,9 @@ get_option_state (struct gcc_options *opts, int option,
state->data = ""; state->data = "";
state->size = strlen ((const char *) state->data) + 1; state->size = strlen ((const char *) state->data) + 1;
break; break;
case CLVC_DEFER:
return false;
} }
return true; return true;
} }
......
...@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#define GCC_OPTS_H #define GCC_OPTS_H
#include "input.h" #include "input.h"
#include "vec.h"
/* Specifies how a switch's VAR_VALUE relates to its FLAG_VAR. */ /* Specifies how a switch's VAR_VALUE relates to its FLAG_VAR. */
enum cl_var_type { enum cl_var_type {
...@@ -39,7 +40,11 @@ enum cl_var_type { ...@@ -39,7 +40,11 @@ enum cl_var_type {
/* The switch takes a string argument and FLAG_VAR points to that /* The switch takes a string argument and FLAG_VAR points to that
argument. */ argument. */
CLVC_STRING CLVC_STRING,
/* The switch should be stored in the VEC pointed to by FLAG_VAR for
later processing. */
CLVC_DEFER
}; };
struct cl_option struct cl_option
...@@ -158,6 +163,20 @@ struct cl_decoded_option ...@@ -158,6 +163,20 @@ struct cl_decoded_option
int errors; int errors;
}; };
/* Structure describing an option deferred for handling after the main
option handlers. */
typedef struct
{
/* Elements from struct cl_decoded_option used for deferred
options. */
size_t opt_index;
const char *arg;
int value;
} cl_deferred_option;
DEF_VEC_O(cl_deferred_option);
DEF_VEC_ALLOC_O(cl_deferred_option,heap);
/* Structure describing a single option-handling callback. */ /* Structure describing a single option-handling callback. */
struct cl_option_handler_func struct cl_option_handler_func
...@@ -264,4 +283,5 @@ extern void control_warning_option (unsigned int opt_index, int kind, ...@@ -264,4 +283,5 @@ extern void control_warning_option (unsigned int opt_index, int kind,
struct gcc_options *opts_set, struct gcc_options *opts_set,
diagnostic_context *dc); diagnostic_context *dc);
extern void print_ignored_options (void); extern void print_ignored_options (void);
extern void handle_common_deferred_options (void);
#endif #endif
...@@ -2359,6 +2359,8 @@ toplev_main (int argc, char **argv) ...@@ -2359,6 +2359,8 @@ toplev_main (int argc, char **argv)
save_decoded_options, save_decoded_options_count, save_decoded_options, save_decoded_options_count,
UNKNOWN_LOCATION, global_dc); UNKNOWN_LOCATION, global_dc);
handle_common_deferred_options ();
init_local_tick (); init_local_tick ();
initialize_plugins (); initialize_plugins ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment