aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-05-28 14:05:50 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-05-28 12:05:50 +0000
commitbc405869c272442b8d39caf1aebc74f90ed2d8c2 (patch)
treec58ae5a68e9bdbca68c6897f5d70c6e553ff6108 /gcc/opts.c
parent392d2ff3bd6fc66a6683540fc33910ddef9bf6f1 (diff)
downloadgcc-bc405869c272442b8d39caf1aebc74f90ed2d8c2.zip
gcc-bc405869c272442b8d39caf1aebc74f90ed2d8c2.tar.gz
gcc-bc405869c272442b8d39caf1aebc74f90ed2d8c2.tar.bz2
Support again multiple --help options (PR other/90315).
2019-05-28 Martin Liska <mliska@suse.cz> PR other/90315 * opts-global.c (decode_options): Print help for all help_option_arguments. * opts.c (print_help): Add new argument. (common_handle_option): Remember all values into help_option_arguments. * opts.h (print_help): Add new argument. From-SVN: r271700
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 2e3e8b2..9e396f8 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -856,7 +856,7 @@ control_options_for_live_patching (struct gcc_options *opts,
}
/* --help option argument if set. */
-const char *help_option_argument = NULL;
+vec<const char *> help_option_arguments;
/* After all options at LOC have been read into OPTS and OPTS_SET,
@@ -2062,7 +2062,8 @@ check_alignment_argument (location_t loc, const char *flag, const char *name)
/* Print help when OPT__help_ is set. */
void
-print_help (struct gcc_options *opts, unsigned int lang_mask)
+print_help (struct gcc_options *opts, unsigned int lang_mask,
+ const char *help_option_argument)
{
const char *a = help_option_argument;
unsigned int include_flags = 0;
@@ -2255,7 +2256,7 @@ common_handle_option (struct gcc_options *opts,
case OPT__help_:
{
- help_option_argument = arg;
+ help_option_arguments.safe_push (arg);
opts->x_exit_after_options = true;
break;
}