Commit 50bcfce0 by Bernd Schmidt Committed by Bernd Schmidt

genautomata.c (parse_automata_opt): New static function.

	* genautomata.c (parse_automata_opt): New static function.
	(initiate_automaton_gen): Remove all option handling code.  Remove
	argc argument.  All callers changed.
	(main): Call init_rtx_reader_args_cb with the new function as
	argument.

From-SVN: r184936
parent c64f8a47
2012-03-05 Bernd Schmidt <bernds@codesourcery.com>
* genautomata.c (parse_automata_opt): New static function.
(initiate_automaton_gen): Remove all option handling code. Remove
argc argument. All callers changed.
(main): Call init_rtx_reader_args_cb with the new function as
argument.
2012-03-05 Richard Guenther <rguenther@suse.de> 2012-03-05 Richard Guenther <rguenther@suse.de>
* cfgexpand.c (gimple_expand_cfg): Free dominator info. * cfgexpand.c (gimple_expand_cfg): Free dominator info.
......
...@@ -9285,46 +9285,45 @@ base_file_name (const char *file_name) ...@@ -9285,46 +9285,45 @@ base_file_name (const char *file_name)
return file_name + directory_name_length + 1; return file_name + directory_name_length + 1;
} }
/* A function passed as argument to init_rtx_reader_args_cb. It parses the
options available for genautomata. Returns true if the option was
recognized. */
static bool
parse_automata_opt (const char *str)
{
if (strcmp (str, NO_MINIMIZATION_OPTION) == 0)
no_minimization_flag = 1;
else if (strcmp (str, TIME_OPTION) == 0)
time_flag = 1;
else if (strcmp (str, STATS_OPTION) == 0)
stats_flag = 1;
else if (strcmp (str, V_OPTION) == 0)
v_flag = 1;
else if (strcmp (str, W_OPTION) == 0)
w_flag = 1;
else if (strcmp (str, NDFA_OPTION) == 0)
ndfa_flag = 1;
else if (strcmp (str, COLLAPSE_OPTION) == 0)
collapse_flag = 1;
else if (strcmp (str, PROGRESS_OPTION) == 0)
progress_flag = 1;
else if (strcmp (str, "-split") == 0)
{
fatal ("option `-split' has not been implemented yet\n");
/* split_argument = atoi (argument_vect [i + 1]); */
}
else
return false;
return true;
}
/* The following is top level function to initialize the work of /* The following is top level function to initialize the work of
pipeline hazards description translator. */ pipeline hazards description translator. */
static void static void
initiate_automaton_gen (int argc, char **argv) initiate_automaton_gen (char **argv)
{ {
const char *base_name; const char *base_name;
int i;
ndfa_flag = 0;
split_argument = 0; /* default value */
no_minimization_flag = 0;
time_flag = 0;
stats_flag = 0;
v_flag = 0;
w_flag = 0;
progress_flag = 0;
for (i = 2; i < argc; i++)
if (strcmp (argv [i], NO_MINIMIZATION_OPTION) == 0)
no_minimization_flag = 1;
else if (strcmp (argv [i], TIME_OPTION) == 0)
time_flag = 1;
else if (strcmp (argv [i], STATS_OPTION) == 0)
stats_flag = 1;
else if (strcmp (argv [i], V_OPTION) == 0)
v_flag = 1;
else if (strcmp (argv [i], W_OPTION) == 0)
w_flag = 1;
else if (strcmp (argv [i], NDFA_OPTION) == 0)
ndfa_flag = 1;
else if (strcmp (argv [i], COLLAPSE_OPTION) == 0)
collapse_flag = 1;
else if (strcmp (argv [i], PROGRESS_OPTION) == 0)
progress_flag = 1;
else if (strcmp (argv [i], "-split") == 0)
{
if (i + 1 >= argc)
fatal ("-split has no argument.");
fatal ("option `-split' has not been implemented yet\n");
/* split_argument = atoi (argument_vect [i + 1]); */
}
/* Initialize IR storage. */ /* Initialize IR storage. */
obstack_init (&irp); obstack_init (&irp);
...@@ -9620,10 +9619,10 @@ main (int argc, char **argv) ...@@ -9620,10 +9619,10 @@ main (int argc, char **argv)
progname = "genautomata"; progname = "genautomata";
if (!init_rtx_reader_args (argc, argv)) if (!init_rtx_reader_args_cb (argc, argv, parse_automata_opt))
return (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
initiate_automaton_gen (argc, argv); initiate_automaton_gen (argv);
while (1) while (1)
{ {
int lineno; int lineno;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment