From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5391 invoked by alias); 27 Sep 2014 13:55:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 5369 invoked by uid 89); 27 Sep 2014 13:55:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: one.firstfloor.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (193.170.194.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 27 Sep 2014 13:55:17 +0000 Received: from basil.firstfloor.org (184-100-254-193.ptld.qwest.net [184.100.254.193]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by one.firstfloor.org (Postfix) with ESMTPSA id 410B3869A8; Sat, 27 Sep 2014 15:55:14 +0200 (CEST) Received: by basil.firstfloor.org (Postfix, from userid 1000) id 8B705A6330; Sat, 27 Sep 2014 06:54:31 -0700 (PDT) From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: Andi Kleen Subject: [PATCH 2/2] Make -Q --help print param defaults and min/max values Date: Sat, 27 Sep 2014 13:55:00 -0000 Message-Id: <1411826065-15761-2-git-send-email-andi@firstfloor.org> In-Reply-To: <1411826065-15761-1-git-send-email-andi@firstfloor.org> References: <1411826065-15761-1-git-send-email-andi@firstfloor.org> X-SW-Source: 2014-09/txt/msg02463.txt.bz2 From: Andi Kleen 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-26 Andi Kleen * opts.c (print_filtered_help): Print --param min/max/default with -Q. --- gcc/opts.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- 2.1.1