summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrwild <rwild@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-01 12:20:33 +0000
committerrwild <rwild@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-01 12:20:33 +0000
commite6a039738b08dcf0cbff75f9619ae887e8d59148 (patch)
treef8f28c90dfc60a40de8b62fafcc2148ea4b31a52
parent53f9a00b0948fe141882b78a32a16ce89a78ec98 (diff)
downloadgcc-e6a039738b08dcf0cbff75f9619ae887e8d59148.tar.gz
gcc/
* optc-gen.awk: No need to duplicate option flags twice. Reuse help texts for duplicate options which do not have any. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144526 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/optc-gen.awk11
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2640f373a33..493b8badc4d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2009-03-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ * optc-gen.awk: No need to duplicate option flags twice.
+ Reuse help texts for duplicate options which do not have
+ any.
+
* gcc.c (display_help): Document --version.
* gcc.c (main): If print_help_list and verbose_flag, ensure
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index 6844bd64586..3e644a571df 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
# Contributed by Kelley Cook, June 2004.
# Original code from Neil Booth, May 2003.
#
@@ -147,6 +147,8 @@ for (i = 0; i < n_opts; i++) {
# ends, for example.
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
flags[i + 1] = flags[i] " " flags[i + 1];
+ if (help[i + 1] == "")
+ help[i + 1] = help[i]
i++;
back_chain[i] = "N_OPTS";
indices[opts[i]] = j;
@@ -155,11 +157,10 @@ for (i = 0; i < n_opts; i++) {
}
for (i = 0; i < n_opts; i++) {
- # Combine the flags of identical switches. Switches
- # appear many times if they are handled by many front
- # ends, for example.
+ # With identical flags, pick only the last one. The
+ # earlier loop ensured that it has all flags merged,
+ # and a nonempty help text if one of the texts was nonempty.
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
- flags[i + 1] = flags[i] " " flags[i + 1];
i++;
}