[gcc/devel/ranger] Filter out language specific options from --help=common.

Aldy Hernandez aldyh@gcc.gnu.org
Wed Jun 17 18:19:53 GMT 2020


https://gcc.gnu.org/g:e97a3063fb1936d6c36eeea720134d5675f73091

commit e97a3063fb1936d6c36eeea720134d5675f73091
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Jan 27 11:01:26 2020 +0100

    Filter out language specific options from --help=common.
    
            PR driver/91220
            * opts.c (print_filtered_help): Exclude language-specific
            options from --help=common unless enabled in all FEs.

Diff:
---
 gcc/ChangeLog | 6 ++++++
 gcc/opts.c    | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4fc5dcd527e..3541c6638f9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-01-27  Martin Liska  <mliska@suse.cz>
+
+	PR driver/91220
+	* opts.c (print_filtered_help): Exclude language-specific
+	options from --help=common unless enabled in all FEs.
+
 2020-01-27  Martin Liska  <mliska@suse.cz>
 
 	* opts.c (print_help): Exclude params from
diff --git a/gcc/opts.c b/gcc/opts.c
index 3b2cc854af1..7affeb41a96 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1285,6 +1285,14 @@ print_filtered_help (unsigned int include_flags,
 			       | CL_COMMON | CL_TARGET)) == 0)
 	continue;
 
+      /* If an option contains a language specification,
+	 exclude it from common unless all languages are present.  */
+      if ((include_flags & CL_COMMON)
+	  && !(option->flags & CL_DRIVER)
+	  && (option->flags & CL_LANG_ALL)
+	  && (option->flags & CL_LANG_ALL) != CL_LANG_ALL)
+	continue;
+
       found = true;
       /* Skip switches that have already been printed.  */
       if (opts->x_help_printed[i])


More information about the Gcc-cvs mailing list