aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2014-09-30 04:10:12 +0000
committerAndi Kleen <ak@gcc.gnu.org>2014-09-30 04:10:12 +0000
commitff5101bf0dd39a12e9d5a40b2bfafee9248307a4 (patch)
tree0d9cbc3c11bf7fac6effcfd547507450952df7ef /gcc/opts.c
parentb3b1547f19735b652463a77fd07d1887c82da2af (diff)
downloadgcc-ff5101bf0dd39a12e9d5a40b2bfafee9248307a4.zip
gcc-ff5101bf0dd39a12e9d5a40b2bfafee9248307a4.tar.gz
gcc-ff5101bf0dd39a12e9d5a40b2bfafee9248307a4.tar.bz2
Make -Q --help print param defaults and min/max values
Make -Q --help print the --param default, min, max values, similar to how it does print the defaults for other flags. This is useful to let a option auto tuner automatically query all needed information abourt gcc params (previously it needed to access the .def file in the source) gcc/: 2014-09-29 Andi Kleen <ak@linux.intel.com> * opts.c (print_filtered_help): Print --param min/max/default with -Q. From-SVN: r215704
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 0a49bc0..5cb5a39 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -953,6 +953,7 @@ print_filtered_help (unsigned int include_flags,
const char *help;
bool found = false;
bool displayed = false;
+ char new_help[128];
if (include_flags == CL_PARAMS)
{
@@ -971,6 +972,15 @@ print_filtered_help (unsigned int include_flags,
/* Get the translation. */
help = _(help);
+ if (!opts->x_quiet_flag)
+ {
+ snprintf (new_help, sizeof (new_help),
+ _("default %d minimum %d maximum %d"),
+ compiler_params[i].default_value,
+ compiler_params[i].min_value,
+ compiler_params[i].max_value);
+ help = new_help;
+ }
wrap_help (help, param, strlen (param), columns);
}
putchar ('\n');
@@ -985,7 +995,6 @@ print_filtered_help (unsigned int include_flags,
for (i = 0; i < cl_options_count; i++)
{
- char new_help[128];
const struct cl_option *option = cl_options + i;
unsigned int len;
const char *opt;