diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2009-03-01 12:20:33 +0000 |
---|---|---|
committer | Ralf Wildenhues <rwild@gcc.gnu.org> | 2009-03-01 12:20:33 +0000 |
commit | a16d1645a3a4e7f74278461d29637847270c70e1 (patch) | |
tree | f8f28c90dfc60a40de8b62fafcc2148ea4b31a52 /gcc/optc-gen.awk | |
parent | 1156c176fbed53d0fa6b316a863cbcdb75fe5e3e (diff) | |
download | gcc-a16d1645a3a4e7f74278461d29637847270c70e1.zip gcc-a16d1645a3a4e7f74278461d29637847270c70e1.tar.gz gcc-a16d1645a3a4e7f74278461d29637847270c70e1.tar.bz2 |
optc-gen.awk: No need to duplicate option flags twice.
gcc/
* optc-gen.awk: No need to duplicate option flags twice.
Reuse help texts for duplicate options which do not have
any.
From-SVN: r144526
Diffstat (limited to 'gcc/optc-gen.awk')
-rw-r--r-- | gcc/optc-gen.awk | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 6844bd6..3e644a5 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++; } |