aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-06-28 14:45:59 +0200
committerMartin Liska <marxin@gcc.gnu.org>2017-06-28 12:45:59 +0000
commit6301008994fa6370261a8c190e4cdf0a27021e63 (patch)
tree95e68b86727f13f74cf2fc3286161cf1780cce3f /gcc/opts.h
parentb1cac008e2629fc225a6ed6a6e748e6caec4dc26 (diff)
downloadgcc-6301008994fa6370261a8c190e4cdf0a27021e63.zip
gcc-6301008994fa6370261a8c190e4cdf0a27021e63.tar.gz
gcc-6301008994fa6370261a8c190e4cdf0a27021e63.tar.bz2
Introduce IntegerRange for options (PR driver/79659).
2017-06-28 Martin Liska <mliska@suse.cz> PR driver/79659 * common.opt: Add IntegerRange to various options. * opt-functions.awk (integer_range_info): New function. * optc-gen.awk: Add integer_range_info to cl_options struct. * opts-common.c (decode_cmdline_option): Handle CL_ERR_INT_RANGE_ARG. (cmdline_handle_error): Likewise. * opts.c (print_filtered_help): Show valid interval in when --help is provided. * opts.h (struct cl_option): Add range_min and range_max fields. * config/i386/i386.opt: Add IntegerRange for -mbranch-cost. 2017-06-28 Martin Liska <mliska@suse.cz> PR driver/79659 * c.opt: Add IntegerRange to various options. 2017-06-28 Martin Liska <mliska@suse.cz> PR driver/79659 * g++.dg/opt/pr79659.C: New test. From-SVN: r249734
Diffstat (limited to 'gcc/opts.h')
-rw-r--r--gcc/opts.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/opts.h b/gcc/opts.h
index 16371e8..5599711 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -110,6 +110,10 @@ struct cl_option
enum cl_var_type var_type;
/* Value or bit-mask with which to set a field. */
HOST_WIDE_INT var_value;
+ /* Range info minimum, or -1. */
+ int range_min;
+ /* Range info maximum, or -1. */
+ int range_max;
};
/* Records that the state of an option consists of SIZE bytes starting
@@ -200,8 +204,9 @@ extern const unsigned int cl_enums_count;
#define CL_ERR_MISSING_ARG (1 << 1) /* Argument required but missing. */
#define CL_ERR_WRONG_LANG (1 << 2) /* Option for wrong language. */
#define CL_ERR_UINT_ARG (1 << 3) /* Bad unsigned integer argument. */
-#define CL_ERR_ENUM_ARG (1 << 4) /* Bad enumerated argument. */
-#define CL_ERR_NEGATIVE (1 << 5) /* Negative form of option
+#define CL_ERR_INT_RANGE_ARG (1 << 4) /* Bad unsigned integer argument. */
+#define CL_ERR_ENUM_ARG (1 << 5) /* Bad enumerated argument. */
+#define CL_ERR_NEGATIVE (1 << 6) /* Negative form of option
not permitted (together
with OPT_SPECIAL_unknown). */