diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-26 23:18:28 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-26 23:18:28 +0000 |
commit | d62a5950068849e2419dfbeaca7e83e456e14cf9 (patch) | |
tree | 36e9808ac190cda7d402aca282c7bbe11cbf8b71 /gcc/opt-functions.awk | |
parent | fc0b81b6311a4ff954ce77fec5259d7521fe28ec (diff) | |
download | gcc-d62a5950068849e2419dfbeaca7e83e456e14cf9.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167190 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opt-functions.awk')
-rw-r--r-- | gcc/opt-functions.awk | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index 99bbb314475..9aff0e0046b 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -150,6 +150,10 @@ function var_type(flags) { if (flag_set_p("Defer", flags)) return "void *" + else if (flag_set_p("Enum.*", flags)) { + en = opt_args("Enum", flags); + return enum_type[en] " " + } else if (!flag_set_p("Joined.*", flags) && !flag_set_p("Separate", flags)) return "int " else if (flag_set_p("UInteger", flags)) @@ -176,33 +180,37 @@ function var_type_struct(flags) } # Given that an option has flags FLAGS, return an initializer for the -# "var_cond" and "var_value" fields of its cl_options[] entry. +# "var_enum", "var_type" and "var_value" fields of its cl_options[] entry. function var_set(flags) { if (flag_set_p("Defer", flags)) - return "CLVC_DEFER, 0" + return "0, CLVC_DEFER, 0" s = nth_arg(1, opt_args("Var", flags)) if (s != "") - return "CLVC_EQUAL, " s + return "0, CLVC_EQUAL, " s s = opt_args("Mask", flags); if (s != "") { vn = var_name(flags); if (vn) - return "CLVC_BIT_SET, OPTION_MASK_" s + return "0, CLVC_BIT_SET, OPTION_MASK_" s else - return "CLVC_BIT_SET, MASK_" s + return "0, CLVC_BIT_SET, MASK_" s } s = nth_arg(0, opt_args("InverseMask", flags)); if (s != "") { vn = var_name(flags); if (vn) - return "CLVC_BIT_CLEAR, OPTION_MASK_" s + return "0, CLVC_BIT_CLEAR, OPTION_MASK_" s else - return "CLVC_BIT_CLEAR, MASK_" s + return "0, CLVC_BIT_CLEAR, MASK_" s + } + if (flag_set_p("Enum.*", flags)) { + en = opt_args("Enum", flags); + return enum_index[en] ", CLVC_ENUM, 0" } if (var_type(flags) == "const char *") - return "CLVC_STRING, 0" - return "CLVC_BOOLEAN, 0" + return "0, CLVC_STRING, 0" + return "0, CLVC_BOOLEAN, 0" } # Given that an option called NAME has flags FLAGS, return an initializer |