2016-01-04 15:30:50 +01:00
|
|
|
# Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
2004-06-18 03:59:45 +02:00
|
|
|
# Contributed by Kelley Cook, June 2004.
|
|
|
|
# Original code from Neil Booth, May 2003.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License as published by the
|
2007-07-26 10:37:01 +02:00
|
|
|
# Free Software Foundation; either version 3, or (at your option) any
|
2004-06-18 03:59:45 +02:00
|
|
|
# later version.
|
|
|
|
#
|
|
|
|
# This program 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
|
2007-07-26 10:37:01 +02:00
|
|
|
# along with this program; see the file COPYING3. If not see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
# This Awk script reads in the option records generated from
|
2008-05-11 21:43:00 +02:00
|
|
|
# opt-gather.awk, combines the flags of duplicate options and generates a
|
2004-06-18 03:59:45 +02:00
|
|
|
# C file.
|
|
|
|
#
|
2011-05-21 13:34:29 +02:00
|
|
|
|
|
|
|
# This program uses functions from opt-functions.awk and code from
|
|
|
|
# opt-read.awk.
|
2004-06-18 03:59:45 +02:00
|
|
|
#
|
2011-05-21 13:34:29 +02:00
|
|
|
# Usage: awk -f opt-functions.awk -f opt-read.awk -f optc-gen.awk \
|
2004-06-18 03:59:45 +02:00
|
|
|
# [-v header_name=header.h] < inputfile > options.c
|
|
|
|
|
|
|
|
# Dump that array of options into a C file.
|
|
|
|
END {
|
2012-05-14 15:30:32 +02:00
|
|
|
|
2015-08-09 21:30:17 +02:00
|
|
|
|
|
|
|
# Combine the flags of identical switches. Switches
|
|
|
|
# appear many times if they are handled by many front
|
|
|
|
# ends, for example.
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
merged_flags[i] = flags[i]
|
|
|
|
}
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
while(i + 1 != n_opts && opts[i] == opts[i + 1] ) {
|
|
|
|
merged_flags[i + 1] = merged_flags[i] " " merged_flags[i + 1];
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Record EnabledBy and LangEnabledBy uses.
|
2012-05-14 15:30:32 +02:00
|
|
|
n_enabledby = 0;
|
|
|
|
for (i = 0; i < n_langs; i++) {
|
|
|
|
n_enabledby_lang[i] = 0;
|
|
|
|
}
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
enabledby_arg = opt_args("EnabledBy", flags[i]);
|
|
|
|
if (enabledby_arg != "") {
|
2014-11-29 01:04:48 +01:00
|
|
|
logical_and = index(enabledby_arg, " && ");
|
|
|
|
if (logical_and != 0) {
|
|
|
|
# EnabledBy(arg1 && arg2)
|
|
|
|
split_sep = " && ";
|
|
|
|
} else {
|
|
|
|
# EnabledBy(arg) or EnabledBy(arg1 || arg2 || arg3)
|
|
|
|
split_sep = " \\|\\| ";
|
|
|
|
}
|
|
|
|
n_enabledby_names = split(enabledby_arg, enabledby_names, split_sep);
|
|
|
|
if (logical_and != 0 && n_enabledby_names > 2) {
|
2015-08-09 21:30:17 +02:00
|
|
|
print "#error " opts[i] " EnabledBy(Wfoo && Wbar && Wbaz) currently not supported"
|
2012-10-16 17:38:58 +02:00
|
|
|
}
|
|
|
|
for (j = 1; j <= n_enabledby_names; j++) {
|
|
|
|
enabledby_name = enabledby_names[j];
|
|
|
|
enabledby_index = opt_numbers[enabledby_name];
|
|
|
|
if (enabledby_index == "") {
|
2015-08-09 21:30:17 +02:00
|
|
|
print "#error " opts[i] " Enabledby(" enabledby_name "), unknown option '" enabledby_name "'"
|
|
|
|
} else if (!flag_set_p("Common", merged_flags[enabledby_index])) {
|
|
|
|
print "#error " opts[i] " Enabledby(" enabledby_name "), '" \
|
|
|
|
enabledby_name "' must have flag 'Common'" \
|
|
|
|
" to use Enabledby(), otherwise use LangEnabledBy()"
|
|
|
|
} else {
|
|
|
|
condition = "";
|
2014-11-29 01:04:48 +01:00
|
|
|
if (logical_and != 0) {
|
2012-10-16 17:38:58 +02:00
|
|
|
opt_var_name_1 = search_var_name(enabledby_names[1], opt_numbers, opts, flags, n_opts);
|
|
|
|
opt_var_name_2 = search_var_name(enabledby_names[2], opt_numbers, opts, flags, n_opts);
|
|
|
|
if (opt_var_name_1 == "") {
|
|
|
|
print "#error " enabledby_names[1] " does not have a Var() flag"
|
|
|
|
}
|
|
|
|
if (opt_var_name_2 == "") {
|
|
|
|
print "#error " enabledby_names[2] " does not have a Var() flag"
|
|
|
|
}
|
|
|
|
condition = "opts->x_" opt_var_name_1 " && opts->x_" opt_var_name_2;
|
|
|
|
}
|
|
|
|
if (enables[enabledby_name] == "") {
|
|
|
|
enabledby[n_enabledby] = enabledby_name;
|
|
|
|
n_enabledby++;
|
|
|
|
}
|
|
|
|
enables[enabledby_name] = enables[enabledby_name] opts[i] ";";
|
|
|
|
enablesif[enabledby_name] = enablesif[enabledby_name] condition ";";
|
2012-05-14 15:30:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
enabledby_arg = opt_args("LangEnabledBy", flags[i]);
|
|
|
|
if (enabledby_arg != "") {
|
2012-11-07 19:11:01 +01:00
|
|
|
enabledby_langs = nth_arg(0, enabledby_arg);
|
2012-05-14 15:30:32 +02:00
|
|
|
enabledby_name = nth_arg(1, enabledby_arg);
|
2012-11-07 19:11:01 +01:00
|
|
|
enabledby_posarg = nth_arg(2, enabledby_arg);
|
|
|
|
enabledby_negarg = nth_arg(3, enabledby_arg);
|
|
|
|
lang_enabled_by(enabledby_langs, enabledby_name, enabledby_posarg, enabledby_negarg);
|
2012-05-14 15:30:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-07 21:40:19 +01:00
|
|
|
print "/* This file is auto-generated by optc-gen.awk. */"
|
2004-06-18 03:59:45 +02:00
|
|
|
print ""
|
2005-05-16 14:30:06 +02:00
|
|
|
n_headers = split(header_name, headers, " ")
|
|
|
|
for (i = 1; i <= n_headers; i++)
|
|
|
|
print "#include " quote headers[i] quote
|
2004-06-18 03:59:45 +02:00
|
|
|
print "#include " quote "opts.h" quote
|
2005-05-16 20:14:03 +02:00
|
|
|
print "#include " quote "intl.h" quote
|
2011-07-25 23:32:56 +02:00
|
|
|
print "#include " quote "insn-attr-common.h" quote
|
2004-06-18 03:59:45 +02:00
|
|
|
print ""
|
|
|
|
|
2010-11-19 18:27:18 +01:00
|
|
|
if (n_extra_c_includes > 0) {
|
|
|
|
for (i = 0; i < n_extra_c_includes; i++) {
|
|
|
|
print "#include " quote extra_c_includes[i] quote
|
|
|
|
}
|
|
|
|
print ""
|
|
|
|
}
|
|
|
|
|
options.texi (Enum, EnumValue): Document new record types.
* doc/options.texi (Enum, EnumValue): Document new record types.
(Enum): Document new option flag.
* opt-functions.awk
* optc-gen.awk: Handle enumerated option arguments.
* opth-gen.awk: Handle enumerated option arguments.
* opts-common.c (enum_arg_ok_for_language, enum_arg_to_value,
enum_value_to_arg): New.
(decode_cmdline_option): Handle enumerated arguments.
(read_cmdline_option): Handle CL_ERR_ENUM_ARG.
(set_option, option_enabled, get_option_state): Handle CLVC_ENUM.
* opts.c (print_filtered_help, print_specific_help): Take
lang_mask arguments.
(print_filtered_help): Handle printing values of enumerated
options. Print possible arguments for enumerated options.
(print_specific_help): Update call to print_filtered_help.
(common_handle_option): Update calls to print_specific_help. Use
value rather than arg for OPT_fdiagnostics_show_location_. Don't
handle OPT_ffp_contract_, OPT_fexcess_precision_,
OPT_fvisibility_, OPT_ftls_model_, OPT_fira_algorithm_ or
OPT_fira_region_ here.
* opts.h (enum cl_var_type): Add CLVC_ENUM.
(struct cl_option): Add var_enum.
(CL_ENUM_CANONICAL, CL_ENUM_DRIVER_ONLY, struct cl_enum_arg,
struct cl_enum, cl_enums, cl_enums_count): New.
(CL_ERR_ENUM_ARG): Define.
(CL_ERR_NEGATIVE): Update value.
(enum_value_to_arg): Declare.
* common.opt (flag_ira_algorithm, flag_ira_region,
flag_fp_contract_mode, flag_excess_precision_cmdline,
default_visibility, flag_tls_default): Remove Variable entries.
(help_enum_printed): New Variable.
(fdiagnostics-show-location=): Use Enum. Add associated
SourceInclude, Enum and EnumValue entries.
(fexcess-precision=, ffp-contract=, fira-algorithm=, fira-region=,
ftls-model=, fvisibility=): Use Enum, Var and Init. Add
associated Enum and EnumValue entries.
po:
* exgettext: Handle UnknownError.
From-SVN: r167190
2010-11-27 00:18:28 +01:00
|
|
|
for (i = 0; i < n_enums; i++) {
|
|
|
|
name = enum_names[i]
|
|
|
|
type = enum_type[name]
|
|
|
|
print "static const struct cl_enum_arg cl_enum_" name \
|
|
|
|
"_data[] = "
|
|
|
|
print "{"
|
|
|
|
print enum_data[name] " { NULL, 0, 0 }"
|
|
|
|
print "};"
|
|
|
|
print ""
|
|
|
|
print "static void"
|
|
|
|
print "cl_enum_" name "_set (void *var, int value)"
|
|
|
|
print "{"
|
|
|
|
print " *((" type " *) var) = (" type ") value;"
|
|
|
|
print "}"
|
|
|
|
print ""
|
|
|
|
print "static int"
|
|
|
|
print "cl_enum_" name "_get (const void *var)"
|
|
|
|
print "{"
|
|
|
|
print " return (int) *((const " type " *) var);"
|
|
|
|
print "}"
|
|
|
|
print ""
|
|
|
|
}
|
|
|
|
|
|
|
|
print "const struct cl_enum cl_enums[] ="
|
|
|
|
print "{"
|
|
|
|
for (i = 0; i < n_enums; i++) {
|
|
|
|
name = enum_names[i]
|
|
|
|
ehelp = enum_help[name]
|
|
|
|
if (ehelp == "")
|
|
|
|
ehelp = "NULL"
|
|
|
|
else
|
|
|
|
ehelp = quote ehelp quote
|
|
|
|
unknown_error = enum_unknown_error[name]
|
|
|
|
if (unknown_error == "")
|
|
|
|
unknown_error = "NULL"
|
|
|
|
else
|
|
|
|
unknown_error = quote unknown_error quote
|
|
|
|
print " {"
|
|
|
|
print " " ehelp ","
|
|
|
|
print " " unknown_error ","
|
|
|
|
print " cl_enum_" name "_data,"
|
|
|
|
print " sizeof (" enum_type[name] "),"
|
|
|
|
print " cl_enum_" name "_set,"
|
|
|
|
print " cl_enum_" name "_get"
|
|
|
|
print " },"
|
|
|
|
}
|
|
|
|
print "};"
|
|
|
|
print "const unsigned int cl_enums_count = " n_enums ";"
|
|
|
|
print ""
|
|
|
|
|
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
2010-10-08 17:17:32 +02:00
|
|
|
print "const struct gcc_options global_options_init =\n{"
|
2010-09-17 16:14:49 +02:00
|
|
|
for (i = 0; i < n_extra_vars; i++) {
|
optc-gen.awk: Generate global_options initializer instead of individual variables.
gcc:
* optc-gen.awk: Generate global_options initializer instead of
individual variables. Add x_ prefix to names of structure
members.
* opth-gen.awk: Generate gcc_options structure. Add x_ prefix to
names of structure members.
* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
* doc/tm.texi: Regenerate.
* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
* c-parser.c (disable_extension_diagnostics,
restore_extension_diagnostics): Update names of cpp_options
members.
* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* common.opt (fcompare-debug-second): Don't use Var.
* config/alpha/alpha.h (target_flags): Remove.
* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/bfin/bfin.h (target_flags): Remove.
* config/cris/cris.h (target_flags): Remove.
* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
cl_target_option members.
* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
(ix86_function_specific_print, ix86_valid_target_attribute_tree,
ix86_can_inline_p): Update names of cl_target_option members.
* config/i386/i386.h (ix86_isa_flags): Remove.
* config/lm32/lm32.h (target_flags): Remove.
* config/mcore/mcore.h (mcore_stack_increment): Remove.
* config/mcore/mcore.md (addsi3): Remove extern declaration of
flag_omit_frame_pointer.
* config/mep/mep.h (target_flags): Remove.
* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/mmix/mmix.h (target_flags): Remove.
* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
flag_expensive_optimizations): Remove.
* config/s390/s390.h (flag_pic): Remove.
* config/score/score-conv.h (target_flags): Remove.
* config/sh/sh.h (sh_fixed_range_str): Remove.
* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* diagnostic.c (diagnostic_initialize): Update names of
diagnostic_context members.
* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
warn_system_headers.
(diagnostic_report_warnings_p): Update for new names.
* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
HARD_FRAME_POINTER_IS_ARG_POINTER.
* flags.h (flag_compare_debug): Declare.
* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* opts.c (flag_compare_debug): Define.
(common_handle_option): Update names of diagnostic_context
members. Handle -fcompare-debug-second.
(fast_math_flags_struct_set_p): Update names of cl_optimization
members.
* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
gcc/c-family:
* c-common.c (c_cpp_error): Update names of diagnostic_context
members.
* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
cl_optimization members.
* c-opts.c (warning_as_error_callback, c_common_handle_option,
sanitize_cpp_opts, finish_options): Update names of cpp_options
members.
gcc/fortran:
* cpp.c (cpp_define_builtins): Update names of gfc_option_t
members.
(gfc_cpp_post_options): Update names of cpp_options members.
(cb_cpp_error): Update names of diagnostic_context members.
* f95-lang.c (gfc_init_builtin_functions): Update names of
gfc_option_t members.
* gfortran.h (gfc_option_t): Rename warn_conversion and
flag_openmp.
* intrinsic.c (gfc_convert_type_warn): Update names of
gfc_option_t members.
* options.c (gfc_init_options, gfc_post_options, set_Wall,
gfc_handle_option): Update names of gfc_option_t members.
* parse.c (next_free, next_fixed): Update names of gfc_option_t
members.
* scanner.c (pedantic): Remove extern declaration.
(skip_free_comments, skip_fixed_comments, include_line): Update
names of gfc_option_t members.
* trans-decl.c (gfc_generate_function_code): Update names of
gfc_option_t members.
gcc/java:
* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
flag_force_classes_archive_check, flag_redundant, flag_newer,
flag_use_divide_subroutine, flag_use_atomic_builtins,
flag_use_boehm_gc, flag_hash_synchronization,
flag_check_references, flag_optimize_sci, flag_indirect_classes,
flag_indirect_dispatch, flag_store_check,
flag_reduced_reflection): Remove.
* jcf-dump.c (flag_newer): Remove.
* jcf.h (quiet_flag): Remove.
* parse.h (quiet_flag): Remove.
libcpp:
* include/cpplib.h (cpp_options): Rename warn_deprecated,
warn_traditional, warn_long_long and pedantic.
* directives.c (directive_diagnostics, _cpp_handle_directive):
Update names of cpp_options members.
* expr.c (cpp_classify_number, eval_token): Update names of
cpp_options members.
* init.c (cpp_create_reader, post_options): Update names of
cpp_options members.
* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
cpp_options members.
* macro.c (parse_params): Update names of cpp_options members.
From-SVN: r164723
2010-09-29 16:49:14 +02:00
|
|
|
var = extra_vars[i]
|
|
|
|
init = extra_vars[i]
|
|
|
|
if (var ~ "=" ) {
|
|
|
|
sub(".*= *", "", init)
|
|
|
|
} else {
|
|
|
|
init = "0"
|
|
|
|
}
|
2011-04-04 16:18:31 +02:00
|
|
|
sub(" *=.*", "", var)
|
|
|
|
name = var
|
|
|
|
sub("^.*[ *]", "", name)
|
|
|
|
sub("\\[.*\\]$", "", name)
|
|
|
|
var_seen[name] = 1
|
|
|
|
print " " init ", /* " name " */"
|
2010-09-17 16:14:49 +02:00
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
name = var_name(flags[i]);
|
|
|
|
if (name == "")
|
|
|
|
continue;
|
|
|
|
|
optc-gen.awk: Generate global_options initializer instead of individual variables.
gcc:
* optc-gen.awk: Generate global_options initializer instead of
individual variables. Add x_ prefix to names of structure
members.
* opth-gen.awk: Generate gcc_options structure. Add x_ prefix to
names of structure members.
* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
* doc/tm.texi: Regenerate.
* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
* c-parser.c (disable_extension_diagnostics,
restore_extension_diagnostics): Update names of cpp_options
members.
* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* common.opt (fcompare-debug-second): Don't use Var.
* config/alpha/alpha.h (target_flags): Remove.
* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/bfin/bfin.h (target_flags): Remove.
* config/cris/cris.h (target_flags): Remove.
* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
cl_target_option members.
* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
(ix86_function_specific_print, ix86_valid_target_attribute_tree,
ix86_can_inline_p): Update names of cl_target_option members.
* config/i386/i386.h (ix86_isa_flags): Remove.
* config/lm32/lm32.h (target_flags): Remove.
* config/mcore/mcore.h (mcore_stack_increment): Remove.
* config/mcore/mcore.md (addsi3): Remove extern declaration of
flag_omit_frame_pointer.
* config/mep/mep.h (target_flags): Remove.
* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/mmix/mmix.h (target_flags): Remove.
* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
flag_expensive_optimizations): Remove.
* config/s390/s390.h (flag_pic): Remove.
* config/score/score-conv.h (target_flags): Remove.
* config/sh/sh.h (sh_fixed_range_str): Remove.
* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* diagnostic.c (diagnostic_initialize): Update names of
diagnostic_context members.
* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
warn_system_headers.
(diagnostic_report_warnings_p): Update for new names.
* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
HARD_FRAME_POINTER_IS_ARG_POINTER.
* flags.h (flag_compare_debug): Declare.
* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* opts.c (flag_compare_debug): Define.
(common_handle_option): Update names of diagnostic_context
members. Handle -fcompare-debug-second.
(fast_math_flags_struct_set_p): Update names of cl_optimization
members.
* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
gcc/c-family:
* c-common.c (c_cpp_error): Update names of diagnostic_context
members.
* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
cl_optimization members.
* c-opts.c (warning_as_error_callback, c_common_handle_option,
sanitize_cpp_opts, finish_options): Update names of cpp_options
members.
gcc/fortran:
* cpp.c (cpp_define_builtins): Update names of gfc_option_t
members.
(gfc_cpp_post_options): Update names of cpp_options members.
(cb_cpp_error): Update names of diagnostic_context members.
* f95-lang.c (gfc_init_builtin_functions): Update names of
gfc_option_t members.
* gfortran.h (gfc_option_t): Rename warn_conversion and
flag_openmp.
* intrinsic.c (gfc_convert_type_warn): Update names of
gfc_option_t members.
* options.c (gfc_init_options, gfc_post_options, set_Wall,
gfc_handle_option): Update names of gfc_option_t members.
* parse.c (next_free, next_fixed): Update names of gfc_option_t
members.
* scanner.c (pedantic): Remove extern declaration.
(skip_free_comments, skip_fixed_comments, include_line): Update
names of gfc_option_t members.
* trans-decl.c (gfc_generate_function_code): Update names of
gfc_option_t members.
gcc/java:
* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
flag_force_classes_archive_check, flag_redundant, flag_newer,
flag_use_divide_subroutine, flag_use_atomic_builtins,
flag_use_boehm_gc, flag_hash_synchronization,
flag_check_references, flag_optimize_sci, flag_indirect_classes,
flag_indirect_dispatch, flag_store_check,
flag_reduced_reflection): Remove.
* jcf-dump.c (flag_newer): Remove.
* jcf.h (quiet_flag): Remove.
* parse.h (quiet_flag): Remove.
libcpp:
* include/cpplib.h (cpp_options): Rename warn_deprecated,
warn_traditional, warn_long_long and pedantic.
* directives.c (directive_diagnostics, _cpp_handle_directive):
Update names of cpp_options members.
* expr.c (cpp_classify_number, eval_token): Update names of
cpp_options members.
* init.c (cpp_create_reader, post_options): Update names of
cpp_options members.
* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
cpp_options members.
* macro.c (parse_params): Update names of cpp_options members.
From-SVN: r164723
2010-09-29 16:49:14 +02:00
|
|
|
init = opt_args("Init", flags[i])
|
|
|
|
if (init != "") {
|
|
|
|
if (name in var_init && var_init[name] != init)
|
|
|
|
print "#error multiple initializers for " name
|
|
|
|
var_init[name] = init
|
2006-05-16 16:27:18 +02:00
|
|
|
}
|
optc-gen.awk: Generate global_options initializer instead of individual variables.
gcc:
* optc-gen.awk: Generate global_options initializer instead of
individual variables. Add x_ prefix to names of structure
members.
* opth-gen.awk: Generate gcc_options structure. Add x_ prefix to
names of structure members.
* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
* doc/tm.texi: Regenerate.
* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
* c-parser.c (disable_extension_diagnostics,
restore_extension_diagnostics): Update names of cpp_options
members.
* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* common.opt (fcompare-debug-second): Don't use Var.
* config/alpha/alpha.h (target_flags): Remove.
* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/bfin/bfin.h (target_flags): Remove.
* config/cris/cris.h (target_flags): Remove.
* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
cl_target_option members.
* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
(ix86_function_specific_print, ix86_valid_target_attribute_tree,
ix86_can_inline_p): Update names of cl_target_option members.
* config/i386/i386.h (ix86_isa_flags): Remove.
* config/lm32/lm32.h (target_flags): Remove.
* config/mcore/mcore.h (mcore_stack_increment): Remove.
* config/mcore/mcore.md (addsi3): Remove extern declaration of
flag_omit_frame_pointer.
* config/mep/mep.h (target_flags): Remove.
* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/mmix/mmix.h (target_flags): Remove.
* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
flag_expensive_optimizations): Remove.
* config/s390/s390.h (flag_pic): Remove.
* config/score/score-conv.h (target_flags): Remove.
* config/sh/sh.h (sh_fixed_range_str): Remove.
* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* diagnostic.c (diagnostic_initialize): Update names of
diagnostic_context members.
* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
warn_system_headers.
(diagnostic_report_warnings_p): Update for new names.
* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
HARD_FRAME_POINTER_IS_ARG_POINTER.
* flags.h (flag_compare_debug): Declare.
* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* opts.c (flag_compare_debug): Define.
(common_handle_option): Update names of diagnostic_context
members. Handle -fcompare-debug-second.
(fast_math_flags_struct_set_p): Update names of cl_optimization
members.
* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
gcc/c-family:
* c-common.c (c_cpp_error): Update names of diagnostic_context
members.
* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
cl_optimization members.
* c-opts.c (warning_as_error_callback, c_common_handle_option,
sanitize_cpp_opts, finish_options): Update names of cpp_options
members.
gcc/fortran:
* cpp.c (cpp_define_builtins): Update names of gfc_option_t
members.
(gfc_cpp_post_options): Update names of cpp_options members.
(cb_cpp_error): Update names of diagnostic_context members.
* f95-lang.c (gfc_init_builtin_functions): Update names of
gfc_option_t members.
* gfortran.h (gfc_option_t): Rename warn_conversion and
flag_openmp.
* intrinsic.c (gfc_convert_type_warn): Update names of
gfc_option_t members.
* options.c (gfc_init_options, gfc_post_options, set_Wall,
gfc_handle_option): Update names of gfc_option_t members.
* parse.c (next_free, next_fixed): Update names of gfc_option_t
members.
* scanner.c (pedantic): Remove extern declaration.
(skip_free_comments, skip_fixed_comments, include_line): Update
names of gfc_option_t members.
* trans-decl.c (gfc_generate_function_code): Update names of
gfc_option_t members.
gcc/java:
* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
flag_force_classes_archive_check, flag_redundant, flag_newer,
flag_use_divide_subroutine, flag_use_atomic_builtins,
flag_use_boehm_gc, flag_hash_synchronization,
flag_check_references, flag_optimize_sci, flag_indirect_classes,
flag_indirect_dispatch, flag_store_check,
flag_reduced_reflection): Remove.
* jcf-dump.c (flag_newer): Remove.
* jcf.h (quiet_flag): Remove.
* parse.h (quiet_flag): Remove.
libcpp:
* include/cpplib.h (cpp_options): Rename warn_deprecated,
warn_traditional, warn_long_long and pedantic.
* directives.c (directive_diagnostics, _cpp_handle_directive):
Update names of cpp_options members.
* expr.c (cpp_classify_number, eval_token): Update names of
cpp_options members.
* init.c (cpp_create_reader, post_options): Update names of
cpp_options members.
* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
cpp_options members.
* macro.c (parse_params): Update names of cpp_options members.
From-SVN: r164723
2010-09-29 16:49:14 +02:00
|
|
|
}
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
name = var_name(flags[i]);
|
|
|
|
if (name == "")
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (name in var_seen)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (name in var_init)
|
|
|
|
init = var_init[name]
|
|
|
|
else
|
|
|
|
init = "0"
|
2005-03-30 08:24:35 +02:00
|
|
|
|
optc-gen.awk: Generate global_options initializer instead of individual variables.
gcc:
* optc-gen.awk: Generate global_options initializer instead of
individual variables. Add x_ prefix to names of structure
members.
* opth-gen.awk: Generate gcc_options structure. Add x_ prefix to
names of structure members.
* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
* doc/tm.texi: Regenerate.
* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
* c-parser.c (disable_extension_diagnostics,
restore_extension_diagnostics): Update names of cpp_options
members.
* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* common.opt (fcompare-debug-second): Don't use Var.
* config/alpha/alpha.h (target_flags): Remove.
* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/bfin/bfin.h (target_flags): Remove.
* config/cris/cris.h (target_flags): Remove.
* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
cl_target_option members.
* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
(ix86_function_specific_print, ix86_valid_target_attribute_tree,
ix86_can_inline_p): Update names of cl_target_option members.
* config/i386/i386.h (ix86_isa_flags): Remove.
* config/lm32/lm32.h (target_flags): Remove.
* config/mcore/mcore.h (mcore_stack_increment): Remove.
* config/mcore/mcore.md (addsi3): Remove extern declaration of
flag_omit_frame_pointer.
* config/mep/mep.h (target_flags): Remove.
* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/mmix/mmix.h (target_flags): Remove.
* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
flag_expensive_optimizations): Remove.
* config/s390/s390.h (flag_pic): Remove.
* config/score/score-conv.h (target_flags): Remove.
* config/sh/sh.h (sh_fixed_range_str): Remove.
* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* diagnostic.c (diagnostic_initialize): Update names of
diagnostic_context members.
* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
warn_system_headers.
(diagnostic_report_warnings_p): Update for new names.
* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
HARD_FRAME_POINTER_IS_ARG_POINTER.
* flags.h (flag_compare_debug): Declare.
* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* opts.c (flag_compare_debug): Define.
(common_handle_option): Update names of diagnostic_context
members. Handle -fcompare-debug-second.
(fast_math_flags_struct_set_p): Update names of cl_optimization
members.
* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
gcc/c-family:
* c-common.c (c_cpp_error): Update names of diagnostic_context
members.
* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
cl_optimization members.
* c-opts.c (warning_as_error_callback, c_common_handle_option,
sanitize_cpp_opts, finish_options): Update names of cpp_options
members.
gcc/fortran:
* cpp.c (cpp_define_builtins): Update names of gfc_option_t
members.
(gfc_cpp_post_options): Update names of cpp_options members.
(cb_cpp_error): Update names of diagnostic_context members.
* f95-lang.c (gfc_init_builtin_functions): Update names of
gfc_option_t members.
* gfortran.h (gfc_option_t): Rename warn_conversion and
flag_openmp.
* intrinsic.c (gfc_convert_type_warn): Update names of
gfc_option_t members.
* options.c (gfc_init_options, gfc_post_options, set_Wall,
gfc_handle_option): Update names of gfc_option_t members.
* parse.c (next_free, next_fixed): Update names of gfc_option_t
members.
* scanner.c (pedantic): Remove extern declaration.
(skip_free_comments, skip_fixed_comments, include_line): Update
names of gfc_option_t members.
* trans-decl.c (gfc_generate_function_code): Update names of
gfc_option_t members.
gcc/java:
* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
flag_force_classes_archive_check, flag_redundant, flag_newer,
flag_use_divide_subroutine, flag_use_atomic_builtins,
flag_use_boehm_gc, flag_hash_synchronization,
flag_check_references, flag_optimize_sci, flag_indirect_classes,
flag_indirect_dispatch, flag_store_check,
flag_reduced_reflection): Remove.
* jcf-dump.c (flag_newer): Remove.
* jcf.h (quiet_flag): Remove.
* parse.h (quiet_flag): Remove.
libcpp:
* include/cpplib.h (cpp_options): Rename warn_deprecated,
warn_traditional, warn_long_long and pedantic.
* directives.c (directive_diagnostics, _cpp_handle_directive):
Update names of cpp_options members.
* expr.c (cpp_classify_number, eval_token): Update names of
cpp_options members.
* init.c (cpp_create_reader, post_options): Update names of
cpp_options members.
* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
cpp_options members.
* macro.c (parse_params): Update names of cpp_options members.
From-SVN: r164723
2010-09-29 16:49:14 +02:00
|
|
|
print " " init ", /* " name " */"
|
2005-04-28 22:52:12 +02:00
|
|
|
|
|
|
|
var_seen[name] = 1;
|
2005-03-30 08:24:35 +02:00
|
|
|
}
|
2005-06-14 16:37:49 +02:00
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
name = static_var(opts[i], flags[i]);
|
opt-functions.awk (static_var): Update comment.
* opt-functions.awk (static_var): Update comment.
(var_ref): Return offsetof expression or -1, not variable address.
* optc-gen.awk: Generate structure field initializers instead of
static variables. Expect -1 for missing variables instead of null
pointer. Add gcc_options parameters to generated functions.
* opth-gen.awk: Generate structure fields for static variables.
Add gcc_options parameters to generated functions.
* common.opt (optimize, optimize_size): Add variables.
* config/i386/i386-c.c (ix86_pragma_target_parse): Pass
&global_options to cl_target_option_restore.
* config/i386/i386.c (ix86_valid_target_attribute_p): Pass
&global_options to cl_optimization_restore, cl_target_option_save
and cl_target_option_restore.
(ix86_set_current_function): Pass &global_options to
cl_target_option_restore.
* config/pdp11/pdp11.h (optimize): Remove.
* config/rs6000/rs6000.h (optimize): Remove.
* config/sh/sh.h (optimize): Remove.
* config/xtensa/xtensa.h (optimize): Remove.
* coretypes.h (struct gcc_options): Declare.
* diagnostic.c (diagnostic_initialize): Initialize
context->option_state.
(diagnostic_report_diagnostic): Pass option_state to
option_enabled hook.
* diagnostic.h (diagnostic_context.option_enabled): Add void *
parameter.
(diagnostic_context.option_state): New field.
* final.c (final_start_function, final, final_scan_insn): Rename
optimize parameter to optimize_p.
* flags.h (optimize, optimize_size): Remove.
* function.c (invoke_set_current_function_hook): Pass
&global_options to cl_optimization_restore.
* gcc.c (driver_handle_option): Take gcc_options parameter.
Assert that it is &global_options.
(process_command): Pass &global_options to read_cmdline_option.
* ipa-pure-const.c (suggest_attribute): Pass &global_options to
option_enabled.
* lto-opts.c (lto_reissue_options): Use option_flag_var. Pass
&global_options to set_option.
* opts-common.c (handle_option, handle_generated_option,
read_cmdline_option, set_option): Take explicit gcc_options
parameters. Use option_flag_var.
(option_flag_var): New.
* opts.c (common_handle_option, lang_handle_option,
target_handle_option): Take gcc_options parameter. Assert that it
is &global_options.
(read_cmdline_options): Pass &global_options to
read_cmdline_option.
(print_filtered_help): Use option_flag_var. Pass &global_options
to option_enabled.
(common_handle_option): Use option_flag_var.
(option_enabled): Take opts parameter. Use option_flag_var.
(get_option_state): Take gcc_options parameter. Use
option_flag_var. Pass gcc_options parameter to option_enabled.
(enable_warning_as_error): Pass &global_options to
handle_generated_option.
* opts.h (struct cl_option): Change flag_var to flag_var_offset.
(cl_option_handler_func.handler): Take gcc_options parameter.
(option_enabled, get_option_state, set_option, handle_option,
handle_generated_option, read_cmdline_option): Take gcc_options
parameters.
* toplev.c (optimize, optimize_size): Remove.
(print_switch_values): Pass &global_options to option_enabled.
(option_affects_pch_p): Use option_flag_var. Pass &global_options
to get_option_state.
(general_init): Initialize global_dc->option_state.
* tree.c (build_optimization_node): Pass &global_options to
cl_optimization_save.
(build_target_option_node): Pass &global_options to
cl_target_option_save.
c-family:
* c-common.c (handle_optimize_attribute): Pass &global_options to
cl_optimization_save and cl_optimization_restore.
* c-opts.c (c_common_handle_option): Pass &global_options to
handle_generated_option.
* c-pragma.c (handle_pragma_diagnostic): Use option_flag_var.
(handle_pragma_pop_options, handle_pragma_reset_options): Pass
&global_options to cl_optimization_restore.
From-SVN: r164751
2010-09-30 15:53:12 +02:00
|
|
|
if (name != "") {
|
|
|
|
print " 0, /* " name " (private state) */"
|
|
|
|
print "#undef x_" name
|
|
|
|
}
|
2005-06-14 16:37:49 +02:00
|
|
|
}
|
2011-02-08 18:41:00 +01:00
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
if (flag_set_p("SetByCombined", flags[i]))
|
|
|
|
print " false, /* frontend_set_" var_name(flags[i]) " */"
|
|
|
|
}
|
opt-functions.awk (static_var): Update comment.
* opt-functions.awk (static_var): Update comment.
(var_ref): Return offsetof expression or -1, not variable address.
* optc-gen.awk: Generate structure field initializers instead of
static variables. Expect -1 for missing variables instead of null
pointer. Add gcc_options parameters to generated functions.
* opth-gen.awk: Generate structure fields for static variables.
Add gcc_options parameters to generated functions.
* common.opt (optimize, optimize_size): Add variables.
* config/i386/i386-c.c (ix86_pragma_target_parse): Pass
&global_options to cl_target_option_restore.
* config/i386/i386.c (ix86_valid_target_attribute_p): Pass
&global_options to cl_optimization_restore, cl_target_option_save
and cl_target_option_restore.
(ix86_set_current_function): Pass &global_options to
cl_target_option_restore.
* config/pdp11/pdp11.h (optimize): Remove.
* config/rs6000/rs6000.h (optimize): Remove.
* config/sh/sh.h (optimize): Remove.
* config/xtensa/xtensa.h (optimize): Remove.
* coretypes.h (struct gcc_options): Declare.
* diagnostic.c (diagnostic_initialize): Initialize
context->option_state.
(diagnostic_report_diagnostic): Pass option_state to
option_enabled hook.
* diagnostic.h (diagnostic_context.option_enabled): Add void *
parameter.
(diagnostic_context.option_state): New field.
* final.c (final_start_function, final, final_scan_insn): Rename
optimize parameter to optimize_p.
* flags.h (optimize, optimize_size): Remove.
* function.c (invoke_set_current_function_hook): Pass
&global_options to cl_optimization_restore.
* gcc.c (driver_handle_option): Take gcc_options parameter.
Assert that it is &global_options.
(process_command): Pass &global_options to read_cmdline_option.
* ipa-pure-const.c (suggest_attribute): Pass &global_options to
option_enabled.
* lto-opts.c (lto_reissue_options): Use option_flag_var. Pass
&global_options to set_option.
* opts-common.c (handle_option, handle_generated_option,
read_cmdline_option, set_option): Take explicit gcc_options
parameters. Use option_flag_var.
(option_flag_var): New.
* opts.c (common_handle_option, lang_handle_option,
target_handle_option): Take gcc_options parameter. Assert that it
is &global_options.
(read_cmdline_options): Pass &global_options to
read_cmdline_option.
(print_filtered_help): Use option_flag_var. Pass &global_options
to option_enabled.
(common_handle_option): Use option_flag_var.
(option_enabled): Take opts parameter. Use option_flag_var.
(get_option_state): Take gcc_options parameter. Use
option_flag_var. Pass gcc_options parameter to option_enabled.
(enable_warning_as_error): Pass &global_options to
handle_generated_option.
* opts.h (struct cl_option): Change flag_var to flag_var_offset.
(cl_option_handler_func.handler): Take gcc_options parameter.
(option_enabled, get_option_state, set_option, handle_option,
handle_generated_option, read_cmdline_option): Take gcc_options
parameters.
* toplev.c (optimize, optimize_size): Remove.
(print_switch_values): Pass &global_options to option_enabled.
(option_affects_pch_p): Use option_flag_var. Pass &global_options
to get_option_state.
(general_init): Initialize global_dc->option_state.
* tree.c (build_optimization_node): Pass &global_options to
cl_optimization_save.
(build_target_option_node): Pass &global_options to
cl_target_option_save.
c-family:
* c-common.c (handle_optimize_attribute): Pass &global_options to
cl_optimization_save and cl_optimization_restore.
* c-opts.c (c_common_handle_option): Pass &global_options to
handle_generated_option.
* c-pragma.c (handle_pragma_diagnostic): Use option_flag_var.
(handle_pragma_pop_options, handle_pragma_reset_options): Pass
&global_options to cl_optimization_restore.
From-SVN: r164751
2010-09-30 15:53:12 +02:00
|
|
|
print "};"
|
2005-06-14 16:37:49 +02:00
|
|
|
print ""
|
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
2010-10-08 17:17:32 +02:00
|
|
|
print "struct gcc_options global_options;"
|
optc-gen.awk: Define global_options_set.
* optc-gen.awk: Define global_options_set. Don't define
target_flags_explicit.
* opth-gen.awk: Declare global_options_set. Define
target_flags_explicit as macro.
* opts-common.c (handle_option): Take opts_set and generated_p
parameters.
(handle_generated_option, read_cmdline_option, set_option): Take
opts_set parameter.
(set_option): Use opts_set instead of hardcoding target_flags and
target_flags_explicit.
* opts.c (sel_sched_switch_set, profile_arc_flag_set,
flag_profile_values_set, flag_unroll_loops_set, flag_tracer_set,
flag_value_profile_transformations_set, flag_peel_loops_set,
flag_branch_probabilities_set, flag_inline_functions_set,
flag_ipa_cp_set, flag_ipa_cp_clone_set,
flag_predictive_commoning_set, flag_unswitch_loops_set,
flag_gcse_after_reload_set): Remove.
(common_handle_option, lang_handle_option, target_handle_option):
Take opts_set parameter. Assert that it is &global_options_set.
(common_handle_option): Don't set _set variables. Check opts_set
instead of such variables.
(enable_warning_as_error): Pass &global_options_set to
handle_generated_option.
* opts.h (cl_option_handler_func.handler, set_option,
handle_option, handle_generated_option, read_cmdline_option): Add
opts_set parameters.
(handle_option): Add generated_p parameter.
* config/i386/i386.c (ix86_function_specific_save,
ix86_function_specific_restore): Updat for renaming of
target_flags_explicit field.
* config/i386/i386.opt (target_flags_explicit): Rename to
ix86_target_flags_explicit.
* config/ia64/ia64.c (ia64_override_options_after_change): Check
global_options_set.x_flag_selective_scheduling and
global_options_set.x_flag_selective_scheduling2, not
sel_sched_switch_set.
* flags.h (sel_sched_switch_set,
flag_speculative_prefetching_set): Remove.
* gcc.c (driver_handle_option): Take opts_set parameter. Assert
that it is &global_options_set.
(process_command): Pass &global_options_set to
read_cmdline_option.
* lto-opts.c (lto_reissue_options): Pass &global_options_set to
set_option.
* toplev.c (target_flags_explicit): Remove.
c-family:
* c-opts.c (c_common_handle_option): Pass &global_options_set to
handle_generated_option.
From-SVN: r164932
2010-10-04 13:51:00 +02:00
|
|
|
print "struct gcc_options global_options_set;"
|
|
|
|
print ""
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
print "const char * const lang_names[] =\n{"
|
|
|
|
for (i = 0; i < n_langs; i++) {
|
2012-05-14 15:30:32 +02:00
|
|
|
macros[i] = "CL_" lang_sanitized_name(langs[i])
|
2004-06-18 03:59:45 +02:00
|
|
|
s = substr(" ", length (macros[i]))
|
|
|
|
print " " quote langs[i] quote ","
|
|
|
|
}
|
|
|
|
|
|
|
|
print " 0\n};\n"
|
|
|
|
print "const unsigned int cl_options_count = N_OPTS;\n"
|
2011-09-02 23:19:17 +02:00
|
|
|
print "#if (1U << " n_langs ") > CL_MIN_OPTION_CLASS"
|
|
|
|
print " #error the number of languages exceeds the implementation limit"
|
|
|
|
print "#endif"
|
2007-02-12 17:25:14 +01:00
|
|
|
print "const unsigned int cl_lang_count = " n_langs ";\n"
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
print "const struct cl_option cl_options[] =\n{"
|
|
|
|
|
2006-05-16 16:27:18 +02:00
|
|
|
j = 0
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
2004-06-18 03:59:45 +02:00
|
|
|
back_chain[i] = "N_OPTS";
|
2006-05-16 16:27:18 +02:00
|
|
|
indices[opts[i]] = j;
|
|
|
|
# Combine the flags of identical switches. Switches
|
|
|
|
# appear many times if they are handled by many front
|
|
|
|
# ends, for example.
|
|
|
|
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
|
|
|
|
flags[i + 1] = flags[i] " " flags[i + 1];
|
2009-03-01 13:20:33 +01:00
|
|
|
if (help[i + 1] == "")
|
|
|
|
help[i + 1] = help[i]
|
2009-03-30 07:55:57 +02:00
|
|
|
else if (help[i] != "" && help[i + 1] != help[i])
|
2012-05-13 13:10:49 +02:00
|
|
|
print "#error Multiple different help strings for " \
|
|
|
|
opts[i] ":\n\t" help[i] "\n\t" help[i + 1]
|
|
|
|
|
2006-05-16 16:27:18 +02:00
|
|
|
i++;
|
|
|
|
back_chain[i] = "N_OPTS";
|
|
|
|
indices[opts[i]] = j;
|
|
|
|
}
|
|
|
|
j++;
|
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-05-15 10:10:10 +02:00
|
|
|
for (i = 0; i < n_opts; i++) {
|
2009-03-01 13:20:33 +01:00
|
|
|
# With identical flags, pick only the last one. The
|
|
|
|
# earlier loop ensured that it has all flags merged,
|
|
|
|
# and a nonempty help text if one of the texts was nonempty.
|
2005-05-15 10:10:10 +02:00
|
|
|
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
|
|
|
|
i++;
|
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-05-15 10:10:10 +02:00
|
|
|
len = length (opts[i]);
|
2010-04-13 16:27:22 +02:00
|
|
|
enum = opt_enum(opts[i])
|
2005-05-15 10:10:10 +02:00
|
|
|
|
|
|
|
# If this switch takes joined arguments, back-chain all
|
|
|
|
# subsequent switches to it for which it is a prefix. If
|
|
|
|
# a later switch S is a longer prefix of a switch T, T
|
|
|
|
# will be back-chained to S in a later iteration of this
|
|
|
|
# for() loop, which is what we want.
|
|
|
|
if (flag_set_p("Joined.*", flags[i])) {
|
|
|
|
for (j = i + 1; j < n_opts; j++) {
|
|
|
|
if (substr (opts[j], 1, len) != opts[i])
|
|
|
|
break;
|
|
|
|
back_chain[j] = enum;
|
2004-06-18 03:59:45 +02:00
|
|
|
}
|
2005-05-15 10:10:10 +02:00
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-05-15 10:10:10 +02:00
|
|
|
s = substr(" ", length (opts[i]))
|
|
|
|
if (i + 1 == n_opts)
|
|
|
|
comma = ""
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-05-15 10:10:10 +02:00
|
|
|
if (help[i] == "")
|
|
|
|
hlp = "0"
|
|
|
|
else
|
|
|
|
hlp = quote help[i] quote;
|
2004-06-18 03:59:45 +02:00
|
|
|
|
common.opt (o): Add MissingArgError.
* common.opt (o): Add MissingArgError.
* doc/options.texi (MissingArgError): Document.
* hooks.c (hook_bool_constcharptr_size_t_false): Remove.
* hooks.h (hook_bool_constcharptr_size_t_false): Remove.
* langhooks-def.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
(LANG_HOOKS_INITIALIZER): Remove missing_argument hook
initializer.
* langhooks.h (struct lang_hooks): Remove missing_argument.
* optc-gen.awk: Handle MissingArgError and output new structure
field initializers.
* opts.c (read_cmdline_option): Use missing_argument_error field
instead of missing_argument langhook.
* opts.h (struct cl_option): Add missing_argument_error field.
* system.h (LANG_HOOKS_MISSING_ARGUMENT): Poison.
c-family:
* c-common.h (c_common_missing_argument): Remove.
* c-opts.c (c_common_missing_argument): Remove.
* c.opt (A, D, F, I, MD, MMD, MQ, MT, U, fconstant-string-class=,
idirafter, imacros, include, isysroot, isystem, iquote): Add
MissingArgError.
* c-objc-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
cp:
* cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
po:
* exgettext: Also extract MissingArgError texts from .opt files.
From-SVN: r162571
2010-07-27 16:43:31 +02:00
|
|
|
missing_arg_error = opt_args("MissingArgError", flags[i])
|
|
|
|
if (missing_arg_error == "")
|
|
|
|
missing_arg_error = "0"
|
|
|
|
else
|
|
|
|
missing_arg_error = quote missing_arg_error quote
|
|
|
|
|
opts.h (struct cl_option): Add warn_message field.
* opts.h (struct cl_option): Add warn_message field.
(struct cl_decoded_option): Add warn_message field.
* doc/options.texi (Ignore, Warn): Document.
* opt-functions.awk (needs_state_p): Don't consider aliases or
ignored options to need state saved.
* optc-gen.awk: Handle Warn and Ignore.
* opth-gen.awk: Output OPT_SPECIAL_ignore.
* opts-common.c (decode_cmdline_option): Set warn_message field.
Handle ignored options.
(decode_cmdline_options_to_array, generate_option,
generate_option_input_file): Set warn_message field.
(read_cmdline_option): Generate warnings from warn_message field.
Handle ignored options.
* common.opt (Wunreachable-code, fargument-alias,
fargument-noalias, fargument-noalias-global,
fargument-noalias-anything, fcse-skip-blocks, fforce-addr,
floop-optimize, frerun-loop-opt, fsched2-use-traces, fsee,
fstrength-reduce, ftree-store-ccp, ftree-store-copy-prop,
ftree-salias): Mark Ignore.
* config/i386/i386.h (CC1_CPU_SPEC_1): Don't handle -mcpu,
-mintel-syntax and -mno-intel-syntax here.
* config/i386/i386.opt (mcpu=, mintel-syntax): Define as aliases
using Warn.
* opts.c (common_handle_option): Don't handle options marked as
ignored.
(enable_warning_as_error): Handle ignored options.
c-family:
* c.opt (Wimport, fall-virtual, falt-external-templates,
fdefault-inline, fenum-int-equiv, fexternal-templates,
fguiding-decls, fhonor-std, fhuge-objects, flabels-ok,
fname-mangling-version-, fnew-abi, fnonnull-objects,
foptional-diags, fsquangle, fstrict-prototype, fthis-is-variable,
fvtable-gc, fvtable-thunks, fxref): Mark with Ignore and Warn as
applicable.
(fhandle-exceptions): Mark with Alias and Warn.
* c-opts.c (c_common_handle_option): Don't handle options marked
as ignored.
po:
* exgettext: Handle {} in operand of MissingArgError. Handle
Warn.
From-SVN: r163771
2010-09-02 13:43:19 +02:00
|
|
|
|
|
|
|
warn_message = opt_args("Warn", flags[i])
|
|
|
|
if (warn_message == "")
|
|
|
|
warn_message = "0"
|
|
|
|
else
|
|
|
|
warn_message = quote warn_message quote
|
|
|
|
|
re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
* opt-functions.awk (opt_sanitized_name): Don't handle
finline-limit=, Wlarger-than= and ftemplate-depth= specially.
* optc-gen.awk: Generate alias fields.
* opth-gen.awk: Explicitly give values for OPT_* enum constants.
Don't generate such constants for aliases.
* opts-common.c (generate_canonical_option): New.
(decode_cmdline_option): Handle aliases. Use
generate_canonical_option for known options instead of copying the
input option text.
* doc/options.texi (Alias): Document.
* common.opt (W, Wlarger-than-, aux-info=, finline-limit-,
fstack-check, specs): Mark as aliases.
* gcc.c (driver_handle_option): Canonicalize -L options to joined
arguments.
(driver_handle_option): Don't handle OPT_specs.
* opts.c (common_handle_option): Don't handle options marked as
aliases.
(enable_warning_as_error): Handle aliases.
* stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of
OPT_Wlarger_than_eq.
* tree-optimize.c (tree_rest_of_compilation): Use
OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq.
c-family:
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
aliases.
* c-common.c (option_codes): Use OPT_Wcomment instead of
OPT_Wcomments.
* c-opts.c (warning_as_error_callback, c_common_handle_option):
Don't handle options marked as aliases.
java:
* lang.opt (CLASSPATH, bootclasspath, classpath, encoding,
fCLASSPATH=): Mark as Java options and as aliases.
* jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*.
(lang_specific_driver): Don't handle options marked as aliases.
* lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_.
testsuite:
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
but using -Werror=comment.
* gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust
expected error messages.
From-SVN: r163770
2010-09-02 13:41:22 +02:00
|
|
|
alias_arg = opt_args("Alias", flags[i])
|
|
|
|
if (alias_arg == "") {
|
opts.h (struct cl_option): Add warn_message field.
* opts.h (struct cl_option): Add warn_message field.
(struct cl_decoded_option): Add warn_message field.
* doc/options.texi (Ignore, Warn): Document.
* opt-functions.awk (needs_state_p): Don't consider aliases or
ignored options to need state saved.
* optc-gen.awk: Handle Warn and Ignore.
* opth-gen.awk: Output OPT_SPECIAL_ignore.
* opts-common.c (decode_cmdline_option): Set warn_message field.
Handle ignored options.
(decode_cmdline_options_to_array, generate_option,
generate_option_input_file): Set warn_message field.
(read_cmdline_option): Generate warnings from warn_message field.
Handle ignored options.
* common.opt (Wunreachable-code, fargument-alias,
fargument-noalias, fargument-noalias-global,
fargument-noalias-anything, fcse-skip-blocks, fforce-addr,
floop-optimize, frerun-loop-opt, fsched2-use-traces, fsee,
fstrength-reduce, ftree-store-ccp, ftree-store-copy-prop,
ftree-salias): Mark Ignore.
* config/i386/i386.h (CC1_CPU_SPEC_1): Don't handle -mcpu,
-mintel-syntax and -mno-intel-syntax here.
* config/i386/i386.opt (mcpu=, mintel-syntax): Define as aliases
using Warn.
* opts.c (common_handle_option): Don't handle options marked as
ignored.
(enable_warning_as_error): Handle ignored options.
c-family:
* c.opt (Wimport, fall-virtual, falt-external-templates,
fdefault-inline, fenum-int-equiv, fexternal-templates,
fguiding-decls, fhonor-std, fhuge-objects, flabels-ok,
fname-mangling-version-, fnew-abi, fnonnull-objects,
foptional-diags, fsquangle, fstrict-prototype, fthis-is-variable,
fvtable-gc, fvtable-thunks, fxref): Mark with Ignore and Warn as
applicable.
(fhandle-exceptions): Mark with Alias and Warn.
* c-opts.c (c_common_handle_option): Don't handle options marked
as ignored.
po:
* exgettext: Handle {} in operand of MissingArgError. Handle
Warn.
From-SVN: r163771
2010-09-02 13:43:19 +02:00
|
|
|
if (flag_set_p("Ignore", flags[i]))
|
|
|
|
alias_data = "NULL, NULL, OPT_SPECIAL_ignore"
|
|
|
|
else
|
|
|
|
alias_data = "NULL, NULL, N_OPTS"
|
re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
* opt-functions.awk (opt_sanitized_name): Don't handle
finline-limit=, Wlarger-than= and ftemplate-depth= specially.
* optc-gen.awk: Generate alias fields.
* opth-gen.awk: Explicitly give values for OPT_* enum constants.
Don't generate such constants for aliases.
* opts-common.c (generate_canonical_option): New.
(decode_cmdline_option): Handle aliases. Use
generate_canonical_option for known options instead of copying the
input option text.
* doc/options.texi (Alias): Document.
* common.opt (W, Wlarger-than-, aux-info=, finline-limit-,
fstack-check, specs): Mark as aliases.
* gcc.c (driver_handle_option): Canonicalize -L options to joined
arguments.
(driver_handle_option): Don't handle OPT_specs.
* opts.c (common_handle_option): Don't handle options marked as
aliases.
(enable_warning_as_error): Handle aliases.
* stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of
OPT_Wlarger_than_eq.
* tree-optimize.c (tree_rest_of_compilation): Use
OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq.
c-family:
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
aliases.
* c-common.c (option_codes): Use OPT_Wcomment instead of
OPT_Wcomments.
* c-opts.c (warning_as_error_callback, c_common_handle_option):
Don't handle options marked as aliases.
java:
* lang.opt (CLASSPATH, bootclasspath, classpath, encoding,
fCLASSPATH=): Mark as Java options and as aliases.
* jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*.
(lang_specific_driver): Don't handle options marked as aliases.
* lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_.
testsuite:
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
but using -Werror=comment.
* gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust
expected error messages.
From-SVN: r163770
2010-09-02 13:41:22 +02:00
|
|
|
} else {
|
|
|
|
alias_opt = nth_arg(0, alias_arg)
|
|
|
|
alias_posarg = nth_arg(1, alias_arg)
|
|
|
|
alias_negarg = nth_arg(2, alias_arg)
|
|
|
|
|
opt-functions.awk (static_var): Update comment.
* opt-functions.awk (static_var): Update comment.
(var_ref): Return offsetof expression or -1, not variable address.
* optc-gen.awk: Generate structure field initializers instead of
static variables. Expect -1 for missing variables instead of null
pointer. Add gcc_options parameters to generated functions.
* opth-gen.awk: Generate structure fields for static variables.
Add gcc_options parameters to generated functions.
* common.opt (optimize, optimize_size): Add variables.
* config/i386/i386-c.c (ix86_pragma_target_parse): Pass
&global_options to cl_target_option_restore.
* config/i386/i386.c (ix86_valid_target_attribute_p): Pass
&global_options to cl_optimization_restore, cl_target_option_save
and cl_target_option_restore.
(ix86_set_current_function): Pass &global_options to
cl_target_option_restore.
* config/pdp11/pdp11.h (optimize): Remove.
* config/rs6000/rs6000.h (optimize): Remove.
* config/sh/sh.h (optimize): Remove.
* config/xtensa/xtensa.h (optimize): Remove.
* coretypes.h (struct gcc_options): Declare.
* diagnostic.c (diagnostic_initialize): Initialize
context->option_state.
(diagnostic_report_diagnostic): Pass option_state to
option_enabled hook.
* diagnostic.h (diagnostic_context.option_enabled): Add void *
parameter.
(diagnostic_context.option_state): New field.
* final.c (final_start_function, final, final_scan_insn): Rename
optimize parameter to optimize_p.
* flags.h (optimize, optimize_size): Remove.
* function.c (invoke_set_current_function_hook): Pass
&global_options to cl_optimization_restore.
* gcc.c (driver_handle_option): Take gcc_options parameter.
Assert that it is &global_options.
(process_command): Pass &global_options to read_cmdline_option.
* ipa-pure-const.c (suggest_attribute): Pass &global_options to
option_enabled.
* lto-opts.c (lto_reissue_options): Use option_flag_var. Pass
&global_options to set_option.
* opts-common.c (handle_option, handle_generated_option,
read_cmdline_option, set_option): Take explicit gcc_options
parameters. Use option_flag_var.
(option_flag_var): New.
* opts.c (common_handle_option, lang_handle_option,
target_handle_option): Take gcc_options parameter. Assert that it
is &global_options.
(read_cmdline_options): Pass &global_options to
read_cmdline_option.
(print_filtered_help): Use option_flag_var. Pass &global_options
to option_enabled.
(common_handle_option): Use option_flag_var.
(option_enabled): Take opts parameter. Use option_flag_var.
(get_option_state): Take gcc_options parameter. Use
option_flag_var. Pass gcc_options parameter to option_enabled.
(enable_warning_as_error): Pass &global_options to
handle_generated_option.
* opts.h (struct cl_option): Change flag_var to flag_var_offset.
(cl_option_handler_func.handler): Take gcc_options parameter.
(option_enabled, get_option_state, set_option, handle_option,
handle_generated_option, read_cmdline_option): Take gcc_options
parameters.
* toplev.c (optimize, optimize_size): Remove.
(print_switch_values): Pass &global_options to option_enabled.
(option_affects_pch_p): Use option_flag_var. Pass &global_options
to get_option_state.
(general_init): Initialize global_dc->option_state.
* tree.c (build_optimization_node): Pass &global_options to
cl_optimization_save.
(build_target_option_node): Pass &global_options to
cl_target_option_save.
c-family:
* c-common.c (handle_optimize_attribute): Pass &global_options to
cl_optimization_save and cl_optimization_restore.
* c-opts.c (c_common_handle_option): Pass &global_options to
handle_generated_option.
* c-pragma.c (handle_pragma_diagnostic): Use option_flag_var.
(handle_pragma_pop_options, handle_pragma_reset_options): Pass
&global_options to cl_optimization_restore.
From-SVN: r164751
2010-09-30 15:53:12 +02:00
|
|
|
if (var_ref(opts[i], flags[i]) != "-1")
|
re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
* opt-functions.awk (opt_sanitized_name): Don't handle
finline-limit=, Wlarger-than= and ftemplate-depth= specially.
* optc-gen.awk: Generate alias fields.
* opth-gen.awk: Explicitly give values for OPT_* enum constants.
Don't generate such constants for aliases.
* opts-common.c (generate_canonical_option): New.
(decode_cmdline_option): Handle aliases. Use
generate_canonical_option for known options instead of copying the
input option text.
* doc/options.texi (Alias): Document.
* common.opt (W, Wlarger-than-, aux-info=, finline-limit-,
fstack-check, specs): Mark as aliases.
* gcc.c (driver_handle_option): Canonicalize -L options to joined
arguments.
(driver_handle_option): Don't handle OPT_specs.
* opts.c (common_handle_option): Don't handle options marked as
aliases.
(enable_warning_as_error): Handle aliases.
* stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of
OPT_Wlarger_than_eq.
* tree-optimize.c (tree_rest_of_compilation): Use
OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq.
c-family:
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
aliases.
* c-common.c (option_codes): Use OPT_Wcomment instead of
OPT_Wcomments.
* c-opts.c (warning_as_error_callback, c_common_handle_option):
Don't handle options marked as aliases.
java:
* lang.opt (CLASSPATH, bootclasspath, classpath, encoding,
fCLASSPATH=): Mark as Java options and as aliases.
* jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*.
(lang_specific_driver): Don't handle options marked as aliases.
* lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_.
testsuite:
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
but using -Werror=comment.
* gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust
expected error messages.
From-SVN: r163770
2010-09-02 13:41:22 +02:00
|
|
|
print "#error Alias setting variable"
|
|
|
|
|
|
|
|
if (alias_posarg != "" && alias_negarg == "") {
|
|
|
|
if (!flag_set_p("RejectNegative", flags[i]) \
|
|
|
|
&& opts[i] ~ "^[Wfm]")
|
|
|
|
print "#error Alias with single argument " \
|
|
|
|
"allowing negative form"
|
|
|
|
}
|
2011-03-30 21:42:51 +02:00
|
|
|
if (alias_posarg != "" \
|
|
|
|
&& flag_set_p("NegativeAlias", flags[i])) {
|
|
|
|
print "#error Alias with multiple arguments " \
|
|
|
|
"used with NegativeAlias"
|
|
|
|
}
|
re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
* opt-functions.awk (opt_sanitized_name): Don't handle
finline-limit=, Wlarger-than= and ftemplate-depth= specially.
* optc-gen.awk: Generate alias fields.
* opth-gen.awk: Explicitly give values for OPT_* enum constants.
Don't generate such constants for aliases.
* opts-common.c (generate_canonical_option): New.
(decode_cmdline_option): Handle aliases. Use
generate_canonical_option for known options instead of copying the
input option text.
* doc/options.texi (Alias): Document.
* common.opt (W, Wlarger-than-, aux-info=, finline-limit-,
fstack-check, specs): Mark as aliases.
* gcc.c (driver_handle_option): Canonicalize -L options to joined
arguments.
(driver_handle_option): Don't handle OPT_specs.
* opts.c (common_handle_option): Don't handle options marked as
aliases.
(enable_warning_as_error): Handle aliases.
* stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of
OPT_Wlarger_than_eq.
* tree-optimize.c (tree_rest_of_compilation): Use
OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq.
c-family:
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
aliases.
* c-common.c (option_codes): Use OPT_Wcomment instead of
OPT_Wcomments.
* c-opts.c (warning_as_error_callback, c_common_handle_option):
Don't handle options marked as aliases.
java:
* lang.opt (CLASSPATH, bootclasspath, classpath, encoding,
fCLASSPATH=): Mark as Java options and as aliases.
* jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*.
(lang_specific_driver): Don't handle options marked as aliases.
* lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_.
testsuite:
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
but using -Werror=comment.
* gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust
expected error messages.
From-SVN: r163770
2010-09-02 13:41:22 +02:00
|
|
|
|
|
|
|
alias_opt = opt_enum(alias_opt)
|
|
|
|
if (alias_posarg == "")
|
|
|
|
alias_posarg = "NULL"
|
|
|
|
else
|
|
|
|
alias_posarg = quote alias_posarg quote
|
|
|
|
if (alias_negarg == "")
|
|
|
|
alias_negarg = "NULL"
|
|
|
|
else
|
|
|
|
alias_negarg = quote alias_negarg quote
|
|
|
|
alias_data = alias_posarg ", " alias_negarg ", " alias_opt
|
|
|
|
}
|
|
|
|
|
2006-05-16 16:27:18 +02:00
|
|
|
neg = opt_args("Negative", flags[i]);
|
|
|
|
if (neg != "")
|
|
|
|
idx = indices[neg]
|
|
|
|
else {
|
|
|
|
if (flag_set_p("RejectNegative", flags[i]))
|
|
|
|
idx = -1;
|
|
|
|
else {
|
|
|
|
if (opts[i] ~ "^[Wfm]")
|
|
|
|
idx = indices[opts[i]];
|
|
|
|
else
|
|
|
|
idx = -1;
|
|
|
|
}
|
|
|
|
}
|
2008-04-29 00:27:22 +02:00
|
|
|
# Split the printf after %u to work around an ia64-hp-hpux11.23
|
|
|
|
# awk bug.
|
opts.h (struct cl_option): Add warn_message field.
* opts.h (struct cl_option): Add warn_message field.
(struct cl_decoded_option): Add warn_message field.
* doc/options.texi (Ignore, Warn): Document.
* opt-functions.awk (needs_state_p): Don't consider aliases or
ignored options to need state saved.
* optc-gen.awk: Handle Warn and Ignore.
* opth-gen.awk: Output OPT_SPECIAL_ignore.
* opts-common.c (decode_cmdline_option): Set warn_message field.
Handle ignored options.
(decode_cmdline_options_to_array, generate_option,
generate_option_input_file): Set warn_message field.
(read_cmdline_option): Generate warnings from warn_message field.
Handle ignored options.
* common.opt (Wunreachable-code, fargument-alias,
fargument-noalias, fargument-noalias-global,
fargument-noalias-anything, fcse-skip-blocks, fforce-addr,
floop-optimize, frerun-loop-opt, fsched2-use-traces, fsee,
fstrength-reduce, ftree-store-ccp, ftree-store-copy-prop,
ftree-salias): Mark Ignore.
* config/i386/i386.h (CC1_CPU_SPEC_1): Don't handle -mcpu,
-mintel-syntax and -mno-intel-syntax here.
* config/i386/i386.opt (mcpu=, mintel-syntax): Define as aliases
using Warn.
* opts.c (common_handle_option): Don't handle options marked as
ignored.
(enable_warning_as_error): Handle ignored options.
c-family:
* c.opt (Wimport, fall-virtual, falt-external-templates,
fdefault-inline, fenum-int-equiv, fexternal-templates,
fguiding-decls, fhonor-std, fhuge-objects, flabels-ok,
fname-mangling-version-, fnew-abi, fnonnull-objects,
foptional-diags, fsquangle, fstrict-prototype, fthis-is-variable,
fvtable-gc, fvtable-thunks, fxref): Mark with Ignore and Warn as
applicable.
(fhandle-exceptions): Mark with Alias and Warn.
* c-opts.c (c_common_handle_option): Don't handle options marked
as ignored.
po:
* exgettext: Handle {} in operand of MissingArgError. Handle
Warn.
From-SVN: r163771
2010-09-02 13:43:19 +02:00
|
|
|
printf(" { %c-%s%c,\n %s,\n %s,\n %s,\n %s, %s, %u,",
|
|
|
|
quote, opts[i], quote, hlp, missing_arg_error, warn_message,
|
re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
* opt-functions.awk (opt_sanitized_name): Don't handle
finline-limit=, Wlarger-than= and ftemplate-depth= specially.
* optc-gen.awk: Generate alias fields.
* opth-gen.awk: Explicitly give values for OPT_* enum constants.
Don't generate such constants for aliases.
* opts-common.c (generate_canonical_option): New.
(decode_cmdline_option): Handle aliases. Use
generate_canonical_option for known options instead of copying the
input option text.
* doc/options.texi (Alias): Document.
* common.opt (W, Wlarger-than-, aux-info=, finline-limit-,
fstack-check, specs): Mark as aliases.
* gcc.c (driver_handle_option): Canonicalize -L options to joined
arguments.
(driver_handle_option): Don't handle OPT_specs.
* opts.c (common_handle_option): Don't handle options marked as
aliases.
(enable_warning_as_error): Handle aliases.
* stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of
OPT_Wlarger_than_eq.
* tree-optimize.c (tree_rest_of_compilation): Use
OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq.
c-family:
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
aliases.
* c-common.c (option_codes): Use OPT_Wcomment instead of
OPT_Wcomments.
* c-opts.c (warning_as_error_callback, c_common_handle_option):
Don't handle options marked as aliases.
java:
* lang.opt (CLASSPATH, bootclasspath, classpath, encoding,
fCLASSPATH=): Mark as Java options and as aliases.
* jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*.
(lang_specific_driver): Don't handle options marked as aliases.
* lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_.
testsuite:
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
but using -Werror=comment.
* gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust
expected error messages.
From-SVN: r163770
2010-09-02 13:41:22 +02:00
|
|
|
alias_data, back_chain[i], len)
|
2008-04-29 00:27:22 +02:00
|
|
|
printf(" %d,\n", idx)
|
2005-05-16 14:30:06 +02:00
|
|
|
condition = opt_args("Condition", flags[i])
|
|
|
|
cl_flags = switch_flags(flags[i])
|
opts.h (cl_option): Add comments to fields.
* opts.h (cl_option): Add comments to fields. Add bit-fields for
various flags.
(CL_SEPARATE_NARGS_SHIFT, CL_SEPARATE_NARGS_MASK,
CL_SEPARATE_ALIAS, CL_NO_DRIVER_ARG, CL_REJECT_DRIVER, CL_SAVE,
CL_DISABLED, CL_REPOR, CL_REJECT_NEGATIVE, CL_MISSING_OK,
CL_UINTEGER, CL_NEGATIVE_ALIAS): Remove.
(CL_JOINED, CL_SEPARATE, CL_UNDOCUMENTED): Update bit positions.
* opt-functions.awk (flag_init, switch_bit_fields): New.
(switch_flags): Don't handle flags moved to bit-fields. Don't
generate CL_MISSING_OK or CL_SAVE.
* optc-gen.awk: Update to generate bit-field output as well as
flags field.
* gcc.c (driver_wrong_lang_callback): Use cl_reject_driver
bit-field instead of CL_REJECT_DRIVER flag.
* opts-common.c (generate_canonical_option,
decode_cmdline_option): Use bit-fields instead of CL_* flags.
* opts.c (maybe_default_option): Use cl_reject_negative bit-field
instead of CL_REJECT_NEGATIVE flag.
* toplev.c (print_switch_values): Use cl_report bit-field instead
of CL_REPORT flag.
From-SVN: r171804
2011-04-01 00:37:14 +02:00
|
|
|
cl_bit_fields = switch_bit_fields(flags[i])
|
|
|
|
cl_zero_bit_fields = switch_bit_fields("")
|
2005-05-16 14:30:06 +02:00
|
|
|
if (condition != "")
|
|
|
|
printf("#if %s\n" \
|
|
|
|
" %s,\n" \
|
opts.h (cl_option): Add comments to fields.
* opts.h (cl_option): Add comments to fields. Add bit-fields for
various flags.
(CL_SEPARATE_NARGS_SHIFT, CL_SEPARATE_NARGS_MASK,
CL_SEPARATE_ALIAS, CL_NO_DRIVER_ARG, CL_REJECT_DRIVER, CL_SAVE,
CL_DISABLED, CL_REPOR, CL_REJECT_NEGATIVE, CL_MISSING_OK,
CL_UINTEGER, CL_NEGATIVE_ALIAS): Remove.
(CL_JOINED, CL_SEPARATE, CL_UNDOCUMENTED): Update bit positions.
* opt-functions.awk (flag_init, switch_bit_fields): New.
(switch_flags): Don't handle flags moved to bit-fields. Don't
generate CL_MISSING_OK or CL_SAVE.
* optc-gen.awk: Update to generate bit-field output as well as
flags field.
* gcc.c (driver_wrong_lang_callback): Use cl_reject_driver
bit-field instead of CL_REJECT_DRIVER flag.
* opts-common.c (generate_canonical_option,
decode_cmdline_option): Use bit-fields instead of CL_* flags.
* opts.c (maybe_default_option): Use cl_reject_negative bit-field
instead of CL_REJECT_NEGATIVE flag.
* toplev.c (print_switch_values): Use cl_report bit-field instead
of CL_REPORT flag.
From-SVN: r171804
2011-04-01 00:37:14 +02:00
|
|
|
" 0, %s,\n" \
|
2005-05-16 14:30:06 +02:00
|
|
|
"#else\n" \
|
opts.h (cl_option): Add comments to fields.
* opts.h (cl_option): Add comments to fields. Add bit-fields for
various flags.
(CL_SEPARATE_NARGS_SHIFT, CL_SEPARATE_NARGS_MASK,
CL_SEPARATE_ALIAS, CL_NO_DRIVER_ARG, CL_REJECT_DRIVER, CL_SAVE,
CL_DISABLED, CL_REPOR, CL_REJECT_NEGATIVE, CL_MISSING_OK,
CL_UINTEGER, CL_NEGATIVE_ALIAS): Remove.
(CL_JOINED, CL_SEPARATE, CL_UNDOCUMENTED): Update bit positions.
* opt-functions.awk (flag_init, switch_bit_fields): New.
(switch_flags): Don't handle flags moved to bit-fields. Don't
generate CL_MISSING_OK or CL_SAVE.
* optc-gen.awk: Update to generate bit-field output as well as
flags field.
* gcc.c (driver_wrong_lang_callback): Use cl_reject_driver
bit-field instead of CL_REJECT_DRIVER flag.
* opts-common.c (generate_canonical_option,
decode_cmdline_option): Use bit-fields instead of CL_* flags.
* opts.c (maybe_default_option): Use cl_reject_negative bit-field
instead of CL_REJECT_NEGATIVE flag.
* toplev.c (print_switch_values): Use cl_report bit-field instead
of CL_REPORT flag.
From-SVN: r171804
2011-04-01 00:37:14 +02:00
|
|
|
" 0,\n" \
|
|
|
|
" 1 /* Disabled. */, %s,\n" \
|
2005-05-16 14:30:06 +02:00
|
|
|
"#endif\n",
|
opts.h (cl_option): Add comments to fields.
* opts.h (cl_option): Add comments to fields. Add bit-fields for
various flags.
(CL_SEPARATE_NARGS_SHIFT, CL_SEPARATE_NARGS_MASK,
CL_SEPARATE_ALIAS, CL_NO_DRIVER_ARG, CL_REJECT_DRIVER, CL_SAVE,
CL_DISABLED, CL_REPOR, CL_REJECT_NEGATIVE, CL_MISSING_OK,
CL_UINTEGER, CL_NEGATIVE_ALIAS): Remove.
(CL_JOINED, CL_SEPARATE, CL_UNDOCUMENTED): Update bit positions.
* opt-functions.awk (flag_init, switch_bit_fields): New.
(switch_flags): Don't handle flags moved to bit-fields. Don't
generate CL_MISSING_OK or CL_SAVE.
* optc-gen.awk: Update to generate bit-field output as well as
flags field.
* gcc.c (driver_wrong_lang_callback): Use cl_reject_driver
bit-field instead of CL_REJECT_DRIVER flag.
* opts-common.c (generate_canonical_option,
decode_cmdline_option): Use bit-fields instead of CL_* flags.
* opts.c (maybe_default_option): Use cl_reject_negative bit-field
instead of CL_REJECT_NEGATIVE flag.
* toplev.c (print_switch_values): Use cl_report bit-field instead
of CL_REPORT flag.
From-SVN: r171804
2011-04-01 00:37:14 +02:00
|
|
|
condition, cl_flags, cl_bit_fields, cl_zero_bit_fields)
|
2005-05-16 14:30:06 +02:00
|
|
|
else
|
opts.h (cl_option): Add comments to fields.
* opts.h (cl_option): Add comments to fields. Add bit-fields for
various flags.
(CL_SEPARATE_NARGS_SHIFT, CL_SEPARATE_NARGS_MASK,
CL_SEPARATE_ALIAS, CL_NO_DRIVER_ARG, CL_REJECT_DRIVER, CL_SAVE,
CL_DISABLED, CL_REPOR, CL_REJECT_NEGATIVE, CL_MISSING_OK,
CL_UINTEGER, CL_NEGATIVE_ALIAS): Remove.
(CL_JOINED, CL_SEPARATE, CL_UNDOCUMENTED): Update bit positions.
* opt-functions.awk (flag_init, switch_bit_fields): New.
(switch_flags): Don't handle flags moved to bit-fields. Don't
generate CL_MISSING_OK or CL_SAVE.
* optc-gen.awk: Update to generate bit-field output as well as
flags field.
* gcc.c (driver_wrong_lang_callback): Use cl_reject_driver
bit-field instead of CL_REJECT_DRIVER flag.
* opts-common.c (generate_canonical_option,
decode_cmdline_option): Use bit-fields instead of CL_* flags.
* opts.c (maybe_default_option): Use cl_reject_negative bit-field
instead of CL_REJECT_NEGATIVE flag.
* toplev.c (print_switch_values): Use cl_report bit-field instead
of CL_REPORT flag.
From-SVN: r171804
2011-04-01 00:37:14 +02:00
|
|
|
printf(" %s,\n" \
|
|
|
|
" 0, %s,\n",
|
|
|
|
cl_flags, cl_bit_fields)
|
2005-06-14 16:37:49 +02:00
|
|
|
printf(" %s, %s }%s\n", var_ref(opts[i], flags[i]),
|
|
|
|
var_set(flags[i]), comma)
|
2004-06-18 03:59:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
print "};"
|
2008-07-23 12:28:06 +02:00
|
|
|
|
2012-05-11 14:23:50 +02:00
|
|
|
print "\n\n"
|
|
|
|
print "bool "
|
|
|
|
print "common_handle_option_auto (struct gcc_options *opts, "
|
|
|
|
print " struct gcc_options *opts_set, "
|
|
|
|
print " const struct cl_decoded_option *decoded, "
|
|
|
|
print " unsigned int lang_mask, int kind, "
|
|
|
|
print " location_t loc, "
|
|
|
|
print " const struct cl_option_handlers *handlers, "
|
|
|
|
print " diagnostic_context *dc) "
|
|
|
|
print "{ "
|
|
|
|
print " size_t scode = decoded->opt_index; "
|
|
|
|
print " int value = decoded->value; "
|
|
|
|
print " enum opt_code code = (enum opt_code) scode; "
|
|
|
|
print " "
|
|
|
|
print " gcc_assert (decoded->canonical_option_num_elements <= 2); "
|
|
|
|
print " "
|
|
|
|
print " switch (code) "
|
|
|
|
print " { "
|
2012-10-16 17:38:58 +02:00
|
|
|
# Handle EnabledBy
|
2012-05-11 14:23:50 +02:00
|
|
|
for (i = 0; i < n_enabledby; i++) {
|
|
|
|
enabledby_name = enabledby[i];
|
|
|
|
print " case " opt_enum(enabledby_name) ":"
|
2012-10-16 17:31:46 +02:00
|
|
|
n_enables = split(enables[enabledby_name], thisenable, ";");
|
2012-10-16 17:38:58 +02:00
|
|
|
n_enablesif = split(enablesif[enabledby_name], thisenableif, ";");
|
|
|
|
if (n_enables != n_enablesif) {
|
|
|
|
print "#error n_enables != n_enablesif: Something went wrong!"
|
|
|
|
}
|
2012-05-11 14:23:50 +02:00
|
|
|
for (j = 1; j < n_enables; j++) {
|
|
|
|
opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
|
2012-05-17 13:50:37 +02:00
|
|
|
if (opt_var_name != "") {
|
2012-10-16 17:38:58 +02:00
|
|
|
condition = "!opts_set->x_" opt_var_name
|
|
|
|
if (thisenableif[j] != "") {
|
2014-05-09 00:17:43 +02:00
|
|
|
value = "(" thisenableif[j] ")"
|
|
|
|
} else {
|
|
|
|
value = "value"
|
2012-10-16 17:38:58 +02:00
|
|
|
}
|
|
|
|
print " if (" condition ")"
|
2012-05-17 13:50:37 +02:00
|
|
|
print " handle_generated_option (opts, opts_set,"
|
2014-05-09 00:17:43 +02:00
|
|
|
print " " opt_enum(thisenable[j]) ", NULL, " value ","
|
2012-05-17 13:50:37 +02:00
|
|
|
print " lang_mask, kind, loc, handlers, dc);"
|
|
|
|
} else {
|
|
|
|
print "#error " thisenable[j] " does not have a Var() flag"
|
|
|
|
}
|
2012-05-11 14:23:50 +02:00
|
|
|
}
|
|
|
|
print " break;\n"
|
|
|
|
}
|
|
|
|
print " default: "
|
|
|
|
print " break; "
|
|
|
|
print " } "
|
|
|
|
print " return true; "
|
|
|
|
print "} "
|
|
|
|
|
2012-05-14 15:30:32 +02:00
|
|
|
# Handle LangEnabledBy
|
|
|
|
for (i = 0; i < n_langs; i++) {
|
|
|
|
lang_name = lang_sanitized_name(langs[i]);
|
|
|
|
mark_unused = " ATTRIBUTE_UNUSED";
|
|
|
|
|
|
|
|
print "\n\n"
|
|
|
|
print "bool "
|
|
|
|
print lang_name "_handle_option_auto (struct gcc_options *opts" mark_unused ", "
|
|
|
|
print " struct gcc_options *opts_set" mark_unused ", "
|
|
|
|
print " size_t scode" mark_unused ", const char *arg" mark_unused ", int value" mark_unused ", "
|
|
|
|
print " unsigned int lang_mask" mark_unused ", int kind" mark_unused ", "
|
|
|
|
print " location_t loc" mark_unused ", "
|
|
|
|
print " const struct cl_option_handlers *handlers" mark_unused ", "
|
|
|
|
print " diagnostic_context *dc" mark_unused ") "
|
|
|
|
print "{ "
|
|
|
|
print " enum opt_code code = (enum opt_code) scode; "
|
|
|
|
print " "
|
|
|
|
print " switch (code) "
|
|
|
|
print " { "
|
|
|
|
|
|
|
|
for (k = 0; k < n_enabledby_lang[i]; k++) {
|
|
|
|
enabledby_name = enabledby[lang_name,k];
|
|
|
|
print " case " opt_enum(enabledby_name) ":"
|
2012-10-16 17:31:46 +02:00
|
|
|
n_thisenable = split(enables[lang_name,enabledby_name], thisenable, ";");
|
|
|
|
for (j = 1; j < n_thisenable; j++) {
|
|
|
|
n_thisenable_args = split(thisenable[j], thisenable_args, ",");
|
|
|
|
if (n_thisenable_args == 1) {
|
|
|
|
thisenable_opt = thisenable[j];
|
|
|
|
value = "value";
|
|
|
|
} else {
|
|
|
|
thisenable_opt = thisenable_args[1];
|
|
|
|
with_posarg = thisenable_args[2];
|
|
|
|
with_negarg = thisenable_args[3];
|
|
|
|
value = "value ? " with_posarg " : " with_negarg;
|
|
|
|
}
|
|
|
|
opt_var_name = var_name(flags[opt_numbers[thisenable_opt]]);
|
2012-05-17 13:50:37 +02:00
|
|
|
if (opt_var_name != "") {
|
|
|
|
print " if (!opts_set->x_" opt_var_name ")"
|
|
|
|
print " handle_generated_option (opts, opts_set,"
|
2012-10-16 17:31:46 +02:00
|
|
|
print " " opt_enum(thisenable_opt) ", NULL, " value ","
|
2012-05-17 13:50:37 +02:00
|
|
|
print " lang_mask, kind, loc, handlers, dc);"
|
|
|
|
} else {
|
2012-10-16 17:31:46 +02:00
|
|
|
print "#error " thisenable_opt " does not have a Var() flag"
|
2012-05-17 13:50:37 +02:00
|
|
|
}
|
2012-05-14 15:30:32 +02:00
|
|
|
}
|
|
|
|
print " break;\n"
|
|
|
|
}
|
|
|
|
print " default: "
|
|
|
|
print " break; "
|
|
|
|
print " } "
|
|
|
|
print " return true; "
|
|
|
|
print "} "
|
|
|
|
}
|
|
|
|
|
2014-08-20 00:37:49 +02:00
|
|
|
#Handle CPP()
|
|
|
|
print "\n"
|
|
|
|
print "#include " quote "cpplib.h" quote;
|
|
|
|
print "void"
|
|
|
|
print "cpp_handle_option_auto (const struct gcc_options * opts, "
|
|
|
|
print " size_t scode, struct cpp_options * cpp_opts)"
|
|
|
|
print "{ "
|
|
|
|
print " enum opt_code code = (enum opt_code) scode; "
|
|
|
|
print " "
|
|
|
|
print " switch (code) "
|
|
|
|
print " { "
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
# With identical flags, pick only the last one. The
|
|
|
|
# earlier loop ensured that it has all flags merged,
|
|
|
|
# and a nonempty help text if one of the texts was nonempty.
|
|
|
|
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
cpp_option = nth_arg(0, opt_args("CPP", flags[i]));
|
options.texi: Document that Var and Init are required if CPP is given.
gcc/ChangeLog:
2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
* doc/options.texi: Document that Var and Init are required if CPP
is given.
* optc-gen.awk: Require Var and Init if CPP is given.
* common.opt (Wpedantic): Use Init.
libcpp/ChangeLog:
2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
* macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
CPP_W flags.
* include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
* init.c (cpp_create_reader): Do not init to -1 here.
* expr.c (num_binary_op): Use cpp_pedwarning.
gcc/c-family/ChangeLog:
2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c.opt (Wc90-c99-compat,Wc++-compat,Wcomment,Wendif-labels,
Winvalid-pch,Wlong-long,Wmissing-include-dirs,Wmultichar,Wpedantic,
(Wdate-time,Wtraditional,Wundef,Wvariadic-macros): Add CPP, Var
and Init.
* c-opts.c (c_common_handle_option): Do not handle here.
(sanitize_cpp_opts): Likewise.
* c-common.c (struct reason_option_codes_t): Handle
CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
gcc/testsuite/ChangeLog:
2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/cpp/endif-pedantic2.c: More general options do not
override specific ones, but specific ones do.
From-SVN: r214904
2014-09-04 17:13:40 +02:00
|
|
|
if (cpp_option != "") {
|
|
|
|
opt_var_name = var_name(flags[i]);
|
|
|
|
init = opt_args("Init", flags[i])
|
|
|
|
if (opt_var_name != "" && init != "") {
|
|
|
|
print " case " opt_enum(opts[i]) ":"
|
|
|
|
print " cpp_opts->" cpp_option " = opts->x_" opt_var_name ";"
|
|
|
|
print " break;"
|
|
|
|
} else if (opt_var_name == "" && init == "") {
|
|
|
|
print "#error CPP() requires setting Init() and Var() for " opts[i]
|
|
|
|
} else if (opt_var_name != "") {
|
|
|
|
print "#error CPP() requires setting Init() for " opts[i]
|
|
|
|
} else {
|
|
|
|
print "#error CPP() requires setting Var() for " opts[i]
|
|
|
|
}
|
2014-08-20 00:37:49 +02:00
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
}
|
2014-08-20 00:37:49 +02:00
|
|
|
print " default: "
|
|
|
|
print " break; "
|
|
|
|
print " } "
|
|
|
|
print "}\n"
|
|
|
|
print "void"
|
|
|
|
print "init_global_opts_from_cpp(struct gcc_options * opts, "
|
|
|
|
print " const struct cpp_options * cpp_opts)"
|
|
|
|
print "{ "
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
# With identical flags, pick only the last one. The
|
|
|
|
# earlier loop ensured that it has all flags merged,
|
|
|
|
# and a nonempty help text if one of the texts was nonempty.
|
|
|
|
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
cpp_option = nth_arg(0, opt_args("CPP", flags[i]));
|
|
|
|
opt_var_name = var_name(flags[i]);
|
|
|
|
if (cpp_option != "" && opt_var_name != "") {
|
|
|
|
print " opts->x_" opt_var_name " = cpp_opts->" cpp_option ";"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print "} "
|
|
|
|
|
|
|
|
}
|
|
|
|
|