aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-01-27 11:01:26 +0100
committerMartin Liska <mliska@suse.cz>2020-01-27 11:01:26 +0100
commite97a3063fb1936d6c36eeea720134d5675f73091 (patch)
tree268d1e3c0a4ae3a7bbc87dc6c556c7d0f054c4f0
parent10fe5cbe0047478b030c13c8537ef5bc752a2048 (diff)
downloadgcc-e97a3063fb1936d6c36eeea720134d5675f73091.zip
gcc-e97a3063fb1936d6c36eeea720134d5675f73091.tar.gz
gcc-e97a3063fb1936d6c36eeea720134d5675f73091.tar.bz2
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.
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/opts.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4fc5dcd..3541c66 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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
all except --help=param.
diff --git a/gcc/opts.c b/gcc/opts.c
index 3b2cc85..7affeb4 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])