1994-06-24 11:31:16 +00:00
|
|
|
/* $Id$ */
|
1987-03-09 19:15:41 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1984-11-26 15:04:22 +00:00
|
|
|
/* S H A R E D F I L E
|
|
|
|
*
|
|
|
|
* G O . H
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-08-21 20:01:19 +00:00
|
|
|
/* This is the main driving routine of the optimizer.
|
|
|
|
* It first processes the flags given as argument;
|
|
|
|
* for every flag it does not recognize itself, it
|
|
|
|
* calls 'proc_flag'; as soon as the -M flag is seen,
|
|
|
|
* it opens the machine descriptor file and
|
|
|
|
* reads phase-independend information (notably the
|
|
|
|
* wordsize and pointersize of the target machine);
|
|
|
|
* next it calls 'phase_machinit' with this file as
|
|
|
|
* parameter. Subsequently it calls 'initialize'.
|
|
|
|
* Finally, all procedures are read, one at a time,
|
|
|
|
* and 'optimize' is called with the current procedure
|
|
|
|
* as parameter.
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
void go(int argc, const char** argv,
|
|
|
|
void (*initialize)(void *null),
|
|
|
|
void (*optimize)(void *), /* (proc_p *p) */
|
|
|
|
void (*phase_machinit)(void *), /* (FILE *f) */
|
|
|
|
void (*proc_flag)(void *)); /* (char *flag) */
|
2016-08-21 20:01:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Parameter to be supplied for e.g. 'initialize' if
|
|
|
|
* no action is required.
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
void no_action(void *);
|
2016-08-21 20:01:19 +00:00
|
|
|
|
|
|
|
/* Report core usage, if core_flag is set. */
|
2017-11-15 21:29:27 +00:00
|
|
|
void core_usage(void);
|
2016-08-21 20:01:19 +00:00
|
|
|
|
|
|
|
/* Report number of optimizations found, if
|
|
|
|
* report_flag is set
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
void report(char* s, int n);
|