From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 1BCD93857007 for ; Wed, 1 Jul 2020 07:11:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1BCD93857007 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3394BAEB6; Wed, 1 Jul 2020 07:11:42 +0000 (UTC) From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] gcov: rename 2 options. To: gcc-patches@gcc.gnu.org Cc: Nathan Sidwell , Jan Hubicka Message-ID: <1993ae30-9b57-24f6-9012-f08e938c98f5@suse.cz> Date: Wed, 1 Jul 2020 09:11:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2020 07:11:44 -0000 Hey. Even thought an option renaming is a problematic change, I still believe the option names were selected poorly and this patch is attempt to improve it. Thoughts? Thanks, Martin gcc/ChangeLog: * doc/gcov.texi: Rename 2 options. * gcov.c (print_usage): Rename -i,--json-format to -j,--json-format and -j,--human-readable to -H,--human-readable. (process_args): Fix up parsing. gcc/testsuite/ChangeLog: * g++.dg/gcov/loop.C: Use -H option instead of -j option. --- gcc/doc/gcov.texi | 8 ++++---- gcc/gcov.c | 14 +++++++------- gcc/testsuite/g++.dg/gcov/loop.C | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi index 22e42da2ea6..00f0cdc45f9 100644 --- a/gcc/doc/gcov.texi +++ b/gcc/doc/gcov.texi @@ -124,8 +124,8 @@ gcov [@option{-v}|@option{--version}] [@option{-h}|@option{--help}] [@option{-c}|@option{--branch-counts}] [@option{-d}|@option{--display-progress}] [@option{-f}|@option{--function-summaries}] - [@option{-i}|@option{--json-format}] - [@option{-j}|@option{--human-readable}] + [@option{-j}|@option{--json-format}] + [@option{-H}|@option{--human-readable}] [@option{-k}|@option{--use-colors}] [@option{-l}|@option{--long-file-names}] [@option{-m}|@option{--demangled-names}] @@ -180,7 +180,7 @@ Output summaries for each function in addition to the file level summary. Display help about using @command{gcov} (on the standard output), and exit without doing any further processing. -@item -i +@item -j @itemx --json-format Output gcov file in an easy-to-parse JSON intermediate format which does not require source code for generation. The JSON @@ -339,7 +339,7 @@ Fields of the @var{branch} element have following semantics: @var{throw}: true when the branch is an exceptional branch @end itemize -@item -j +@item -H @itemx --human-readable Write counts in human readable format (like 24.6k). diff --git a/gcc/gcov.c b/gcc/gcov.c index ef93758b26f..21c42c72be1 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -898,8 +898,8 @@ print_usage (int error_p) fnotice (file, " -d, --display-progress Display progress information\n"); fnotice (file, " -f, --function-summaries Output summaries for each function\n"); fnotice (file, " -h, --help Print this help, then exit\n"); - fnotice (file, " -i, --json-format Output JSON intermediate format into .gcov.json.gz file\n"); - fnotice (file, " -j, --human-readable Output human readable numbers\n"); + fnotice (file, " -j, --json-format Output JSON intermediate format into .gcov.json.gz file\n"); + fnotice (file, " -H, --human-readable Output human readable numbers\n"); fnotice (file, " -k, --use-colors Emit colored output\n"); fnotice (file, " -l, --long-file-names Use long output file names for included\n\ source files\n"); @@ -942,8 +942,8 @@ static const struct option options[] = { "all-blocks", no_argument, NULL, 'a' }, { "branch-probabilities", no_argument, NULL, 'b' }, { "branch-counts", no_argument, NULL, 'c' }, - { "json-format", no_argument, NULL, 'i' }, - { "human-readable", no_argument, NULL, 'j' }, + { "json-format", no_argument, NULL, 'j' }, + { "human-readable", no_argument, NULL, 'H' }, { "no-output", no_argument, NULL, 'n' }, { "long-file-names", no_argument, NULL, 'l' }, { "function-summaries", no_argument, NULL, 'f' }, @@ -969,7 +969,7 @@ process_args (int argc, char **argv) { int opt; - const char *opts = "abcdfhijklmno:pqrs:tuvwx"; + const char *opts = "abcdfhHjklmno:pqrs:tuvwx"; while ((opt = getopt_long (argc, argv, opts, options, NULL)) != -1) { switch (opt) @@ -992,7 +992,7 @@ process_args (int argc, char **argv) case 'l': flag_long_names = 1; break; - case 'j': + case 'H': flag_human_readable_numbers = 1; break; case 'k': @@ -1023,7 +1023,7 @@ process_args (int argc, char **argv) case 'u': flag_unconditional = 1; break; - case 'i': + case 'j': flag_json_format = 1; flag_gcov_file = 1; break; diff --git a/gcc/testsuite/g++.dg/gcov/loop.C b/gcc/testsuite/g++.dg/gcov/loop.C index 24f580634d9..e63cb92e6e6 100644 --- a/gcc/testsuite/g++.dg/gcov/loop.C +++ b/gcc/testsuite/g++.dg/gcov/loop.C @@ -24,4 +24,4 @@ int main(int argc, char **argv) return 0; /* count(1) */ } -/* { dg-final { run-gcov branches { -abj loop.C } } } */ +/* { dg-final { run-gcov branches { -abH loop.C } } } */ -- 2.27.0