diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc index d5e56e2d6813856daa9abcf8227e86497e0f98cb..baf93855a6456d85f466851f0f5b9b12588848e5 100644 --- a/gcc/genmatch.cc +++ b/gcc/genmatch.cc @@ -5301,13 +5301,12 @@ round_alloc_size (size_t s) /* Construct and display the help menu. */ static void -showUsage () +usage () { - fprintf (stderr, "Usage: genmatch [--gimple] [--generic] " - "[--header=<filename>] [--include=<filename>] [-v[v]] input " - "[<outputfile>...]\n"); - fprintf (stderr, "\nWhen more then one outputfile is specified --header " - "is required.\n"); + const char *usage = "Usage:\n" + " %s [--gimple|--generic] [-v[v]] <input>\n" + " %s [options] [--include=FILE] --header=FILE <input> <output>...\n"; + fprintf (stderr, usage, progname, progname); } /* Write out the correct include to the match-head fle containing the helper @@ -5332,9 +5331,6 @@ main (int argc, char **argv) progname = "genmatch"; - if (argc < 2) - return 1; - bool gimple = true; char *s_header_file = NULL; char *s_include_file = NULL; @@ -5359,14 +5355,17 @@ main (int argc, char **argv) files.safe_push (argv[i]); else { - showUsage (); + usage (); return 1; } } /* Validate if the combinations are valid. */ if ((files.length () > 1 && !s_header_file) || files.is_empty ()) - showUsage (); + { + usage (); + return 1; + } if (!s_include_file) s_include_file = s_header_file;