aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>2009-03-17 21:25:59 +0000
committerRalf Wildenhues <rwild@gcc.gnu.org>2009-03-17 21:25:59 +0000
commit0631b69f9aa1bc1d56a1d26336524aed3ee38e41 (patch)
tree10eadf15b3f22c36e8cf24a1f0e199069fdf4aa2
parent668112286a4102cfd38e1d4b9c5748337f0a5409 (diff)
downloadgcc-0631b69f9aa1bc1d56a1d26336524aed3ee38e41.zip
gcc-0631b69f9aa1bc1d56a1d26336524aed3ee38e41.tar.gz
gcc-0631b69f9aa1bc1d56a1d26336524aed3ee38e41.tar.bz2
re PR middle-end/37805 (gcc --help=separate)
gcc/ PR middle-end/37805 * opts.c (print_specific_help): In addition to `undocumented', accept `separate' and `joined' flags if passed alone. Describe output by the first matched one of those. (common_handle_option): Skip over empty strings. * gcc.c (display_help): Fix help string for `--help='. * doc/invoke.texi (Option Summary, Overall Options): With `--help=', classes and qualifiers can both be repeated, but only the latter can be negated. One should not pass only negated qualifiers. Fix markup and examples. From-SVN: r144921
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/doc/invoke.texi22
-rw-r--r--gcc/gcc.c2
-rw-r--r--gcc/opts.c15
4 files changed, 35 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a032bb8..8736d5f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2009-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ PR middle-end/37805
+ * opts.c (print_specific_help): In addition to `undocumented',
+ accept `separate' and `joined' flags if passed alone. Describe
+ output by the first matched one of those.
+ (common_handle_option): Skip over empty strings.
+ * gcc.c (display_help): Fix help string for `--help='.
+ * doc/invoke.texi (Option Summary, Overall Options): With
+ `--help=', classes and qualifiers can both be repeated, but
+ only the latter can be negated. One should not pass only
+ negated qualifiers. Fix markup and examples.
+
Revert
2008-10-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/37805
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 9dbd1a7..275986c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -163,7 +163,7 @@ in the following sections.
@item Overall Options
@xref{Overall Options,,Options Controlling the Kind of Output}.
@gccoptlist{-c -S -E -o @var{file} -combine -pipe -pass-exit-codes @gol
--x @var{language} -v -### --help@r{[}=@var{class}@r{]} --target-help @gol
+-x @var{language} -v -### --help@r{[}=@var{class}@r{[},@dots{}@r{]]} --target-help @gol
--version -wrapper@@@var{file}}
@item C Language Options
@@ -1161,11 +1161,10 @@ Print (on the standard output) a description of target-specific command
line options for each tool. For some targets extra target-specific
information may also be printed.
-@item --help=@var{class}@r{[},@var{qualifier}@r{]}
+@item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
Print (on the standard output) a description of the command line
-options understood by the compiler that fit into a specific class.
-The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
-@samp{params}, or @var{language}:
+options understood by the compiler that fit into all specified classes
+and qualifiers. These are the supported classes:
@table @asis
@item @samp{optimizers}
@@ -1195,9 +1194,7 @@ version of GCC.
This will display the options that are common to all languages.
@end table
-It is possible to further refine the output of the @option{--help=}
-option by adding a comma separated list of qualifiers after the
-class. These can be any from the following list:
+These are the supported qualifiers:
@table @asis
@item @samp{undocumented}
@@ -1221,7 +1218,7 @@ switches supported by the compiler the following can be used:
@end smallexample
The sense of a qualifier can be inverted by prefixing it with the
-@var{^} character, so for example to display all binary warning
+@samp{^} character, so for example to display all binary warning
options (i.e., ones that are either on or off and that do not take an
argument), which have a description the following can be used:
@@ -1229,7 +1226,10 @@ argument), which have a description the following can be used:
--help=warnings,^joined,^undocumented
@end smallexample
-A class can also be used as a qualifier, although this usually
+The argument to @option{--help=} should not consist solely of inverted
+qualifiers.
+
+Combining several classes is possible, although this usually
restricts the output by so much that there is nothing to display. One
case where it does work however is when one of the classes is
@var{target}. So for example to display all the target-specific
@@ -1265,7 +1265,7 @@ options, so for example it is possible to find out which optimizations
are enabled at @option{-O2} by using:
@smallexample
--O2 --help=optimizers
+-Q -O2 --help=optimizers
@end smallexample
Alternatively you can discover which binary optimizations are enabled
diff --git a/gcc/gcc.c b/gcc/gcc.c
index cf85618..ee95366 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3228,7 +3228,7 @@ display_help (void)
fputs (_(" -pass-exit-codes Exit with highest error code from a phase\n"), stdout);
fputs (_(" --help Display this information\n"), stdout);
fputs (_(" --target-help Display target specific command line options\n"), stdout);
- fputs (_(" --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]\n"), stdout);
+ fputs (_(" --help={target|optimizers|warnings|params|[^]{joined|separate|undocumented}}[,...]\n"), stdout);
fputs (_(" Display specific types of command line options\n"), stdout);
if (! verbose_flag)
fputs (_(" (Use '-v --help' to display command line options of sub-processes)\n"), stdout);
diff --git a/gcc/opts.c b/gcc/opts.c
index 7788b02..63197709 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1396,7 +1396,7 @@ print_specific_help (unsigned int include_flags,
default:
if (i >= cl_lang_count)
break;
- if ((exclude_flags & ((1U << cl_lang_count) - 1)) != 0)
+ if (exclude_flags & all_langs_mask)
description = _("The following options are specific to just the language ");
else
description = _("The following options are supported by the language ");
@@ -1409,8 +1409,12 @@ print_specific_help (unsigned int include_flags,
{
if (any_flags == 0)
{
- if (include_flags == CL_UNDOCUMENTED)
+ if (include_flags & CL_UNDOCUMENTED)
description = _("The following options are not documented");
+ else if (include_flags & CL_SEPARATE)
+ description = _("The following options take separate arguments");
+ else if (include_flags & CL_JOINED)
+ description = _("The following options take joined arguments");
else
{
internal_error ("unrecognized include_flags 0x%x passed to print_specific_help",
@@ -1539,6 +1543,11 @@ common_handle_option (size_t scode, const char *arg, int value,
len = strlen (a);
else
len = comma - a;
+ if (len == 0)
+ {
+ a = comma + 1;
+ continue;
+ }
/* Check to see if the string matches an option class name. */
for (i = 0, specific_flag = 0; specifics[i].string != NULL; i++)
@@ -1547,7 +1556,7 @@ common_handle_option (size_t scode, const char *arg, int value,
specific_flag = specifics[i].flag;
break;
}
-
+
/* Check to see if the string matches a language name.
Note - we rely upon the alpha-sorted nature of the entries in
the lang_names array, specifically that shorter names appear