summaryrefslogtreecommitdiff
path: root/gcc/opts.h
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-06-28 12:45:59 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-06-28 12:45:59 +0000
commit52368c3466e6cda349d981d82d577d7edba3ff7c (patch)
tree95e68b86727f13f74cf2fc3286161cf1780cce3f /gcc/opts.h
parent932b72f08b19edd60d53836edb0901e13d2c2cf2 (diff)
downloadgcc-52368c3466e6cda349d981d82d577d7edba3ff7c.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249734 138bc75d-0d04-0410-961f-82ee72b054a4
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 16371e8141f..5599711cc76 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). */