ego now builds and is used.
This needed lots of refactoring to ego --- not all platforms have ego descr files, and ego will just crash if you invoke it without one. I think originally it was never intended that these platforms would be used at -O2 or above. Plats now only specify the ego descr file if they have one.
This commit is contained in:
parent
08823a172c
commit
5bae29a00c
|
@ -2,7 +2,7 @@ vars.cflags = {
|
||||||
"-g", "-O"
|
"-g", "-O"
|
||||||
}
|
}
|
||||||
vars.ackcflags = {
|
vars.ackcflags = {
|
||||||
"-O"
|
"-O6"
|
||||||
}
|
}
|
||||||
vars.plats = {
|
vars.plats = {
|
||||||
"cpm",
|
"cpm",
|
||||||
|
@ -27,6 +27,7 @@ installable {
|
||||||
"util/ack+pkg",
|
"util/ack+pkg",
|
||||||
"util/amisc+pkg",
|
"util/amisc+pkg",
|
||||||
"util/arch+pkg",
|
"util/arch+pkg",
|
||||||
|
"util/ego+pkg",
|
||||||
"util/led+pkg",
|
"util/led+pkg",
|
||||||
"util/misc+pkg",
|
"util/misc+pkg",
|
||||||
"util/opt+pkg",
|
"util/opt+pkg",
|
||||||
|
|
15
lib/descr/fe
15
lib/descr/fe
|
@ -206,19 +206,6 @@ name ego
|
||||||
to .gk
|
to .gk
|
||||||
program {EM}/lib/ack/em_ego
|
program {EM}/lib/ack/em_ego
|
||||||
mapflag -EGO-* EGO_F={EGO_F?} -*
|
mapflag -EGO-* EGO_F={EGO_F?} -*
|
||||||
# The following lines are obsolete, but here for backwards compatibility.
|
|
||||||
# They should be removed some day.
|
|
||||||
mapflag -IL* EGO_F={EGO_F?} -IL*
|
|
||||||
mapflag -CS* EGO_F={EGO_F?} -CS*
|
|
||||||
mapflag -SR* EGO_F={EGO_F?} -SR*
|
|
||||||
mapflag -UD* EGO_F={EGO_F?} -UD*
|
|
||||||
mapflag -LV* EGO_F={EGO_F?} -LV*
|
|
||||||
mapflag -SA* EGO_F={EGO_F?} -RA*
|
|
||||||
mapflag -SP* EGO_F={EGO_F?} -SP*
|
|
||||||
mapflag -BO* EGO_F={EGO_F?} -BO*
|
|
||||||
mapflag -CJ* EGO_F={EGO_F?} -CJ*
|
|
||||||
mapflag -EV EGO_F={EGO_F?} -V
|
|
||||||
# End of obsolete lines
|
|
||||||
mapflag -Q* EGO_F={EGO_F?} -Q*
|
mapflag -Q* EGO_F={EGO_F?} -Q*
|
||||||
mapflag -T* EGO_F={EGO_F?} -T*
|
mapflag -T* EGO_F={EGO_F?} -T*
|
||||||
mapflag -S* EGO_F={EGO_F?} -S*
|
mapflag -S* EGO_F={EGO_F?} -S*
|
||||||
|
@ -227,7 +214,7 @@ name ego
|
||||||
mapflag -O* EGO_F={EGO_F?} -O*
|
mapflag -O* EGO_F={EGO_F?} -O*
|
||||||
args \
|
args \
|
||||||
{EGO_F?} -P {EM}/lib/ack/ego \
|
{EGO_F?} -P {EM}/lib/ack/ego \
|
||||||
-M{EM}/share/ack/ego/{ARCH}.descr <
|
{EGO_PLAT_FLAGS?} <
|
||||||
optimizer 2
|
optimizer 2
|
||||||
stdout
|
stdout
|
||||||
combiner
|
combiner
|
||||||
|
|
|
@ -20,6 +20,7 @@ definerule("ackfile",
|
||||||
"lang/pc/comp+pkg",
|
"lang/pc/comp+pkg",
|
||||||
"plat/"..plat.."+tools",
|
"plat/"..plat.."+tools",
|
||||||
"util/ack+pkg",
|
"util/ack+pkg",
|
||||||
|
"util/ego+pkg",
|
||||||
"util/misc+pkg",
|
"util/misc+pkg",
|
||||||
e.deps
|
e.deps
|
||||||
},
|
},
|
||||||
|
@ -67,7 +68,6 @@ definerule("ackprogram",
|
||||||
"plat/"..e.vars.plat.."+pkg",
|
"plat/"..e.vars.plat.."+pkg",
|
||||||
"util/ack+pkg",
|
"util/ack+pkg",
|
||||||
"util/led+pkg",
|
"util/led+pkg",
|
||||||
"util/amisc+pkg",
|
|
||||||
e.deps
|
e.deps
|
||||||
},
|
},
|
||||||
_clibrary = acklibrary,
|
_clibrary = acklibrary,
|
||||||
|
|
|
@ -26,6 +26,7 @@ var C_LIB={PLATFORMDIR}/libc-ansi.a
|
||||||
var CC_ALIGN=-Vr
|
var CC_ALIGN=-Vr
|
||||||
var OLD_C_LIB={C_LIB}
|
var OLD_C_LIB={C_LIB}
|
||||||
var MACHOPT_F=-m10
|
var MACHOPT_F=-m10
|
||||||
|
var EGO_PLAT_FLAGS=-M{EM}/share/ack/ego/{ARCH}.descr
|
||||||
|
|
||||||
# Override the setting in fe so that files compiled for linux386 can see
|
# Override the setting in fe so that files compiled for linux386 can see
|
||||||
# the platform-specific headers.
|
# the platform-specific headers.
|
||||||
|
|
|
@ -26,6 +26,7 @@ var C_LIB={PLATFORMDIR}/libc-ansi.a
|
||||||
var CC_ALIGN=-Vr
|
var CC_ALIGN=-Vr
|
||||||
var OLD_C_LIB={C_LIB}
|
var OLD_C_LIB={C_LIB}
|
||||||
var MACHOPT_F=-ml10
|
var MACHOPT_F=-ml10
|
||||||
|
var EGO_PLAT_FLAGS=-M{EM}/share/ack/ego/{ARCH}.descr
|
||||||
|
|
||||||
# Override the setting in fe so that files compiled for linux68k can see
|
# Override the setting in fe so that files compiled for linux68k can see
|
||||||
# the platform-specific headers.
|
# the platform-specific headers.
|
||||||
|
|
|
@ -22,6 +22,7 @@ var PLATFORMDIR={EM}/share/ack/{PLATFORM}
|
||||||
var CPP_F=-D__unix
|
var CPP_F=-D__unix
|
||||||
var ALIGN=-a0:1 -a1:1 -a2:1 -a3:1
|
var ALIGN=-a0:1 -a1:1 -a2:1 -a3:1
|
||||||
var MACHOPT_F=-m8
|
var MACHOPT_F=-m8
|
||||||
|
var EGO_PLAT_FLAGS=-M{EM}/share/ack/ego/{ARCH}.descr
|
||||||
|
|
||||||
# Override the setting in fe so that files compiled for this platform can see
|
# Override the setting in fe so that files compiled for this platform can see
|
||||||
# the platform-specific headers.
|
# the platform-specific headers.
|
||||||
|
|
58
util/ego/build.lua
Normal file
58
util/ego/build.lua
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
local function build_ego(name)
|
||||||
|
cprogram {
|
||||||
|
name = name,
|
||||||
|
srcs = { "./"..name.."/*.c" },
|
||||||
|
deps = {
|
||||||
|
"util/ego/share+lib",
|
||||||
|
"modules/src/em_data+lib",
|
||||||
|
"h+emheaders",
|
||||||
|
},
|
||||||
|
vars = {
|
||||||
|
["+cflags"] = {"-DVERBOSE", "-DNOTCOMPACT"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
build_ego("bo")
|
||||||
|
build_ego("ca")
|
||||||
|
build_ego("cf")
|
||||||
|
build_ego("cj")
|
||||||
|
build_ego("cs")
|
||||||
|
build_ego("ic")
|
||||||
|
build_ego("il")
|
||||||
|
build_ego("lv")
|
||||||
|
build_ego("sp")
|
||||||
|
build_ego("sr")
|
||||||
|
build_ego("ud")
|
||||||
|
|
||||||
|
cprogram {
|
||||||
|
name = "em_ego",
|
||||||
|
srcs = { "./em_ego/em_ego.c" },
|
||||||
|
deps = {
|
||||||
|
"modules/src/print+lib",
|
||||||
|
"modules/src/string+lib",
|
||||||
|
"modules/src/system+lib",
|
||||||
|
"modules+headers",
|
||||||
|
"h+emheaders",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
installable {
|
||||||
|
name = "pkg",
|
||||||
|
map = {
|
||||||
|
["$(PLATDEP)/em_ego"] = "+em_ego",
|
||||||
|
["$(PLATDEP)/ego/bo"] = "+bo",
|
||||||
|
["$(PLATDEP)/ego/ca"] = "+ca",
|
||||||
|
["$(PLATDEP)/ego/cf"] = "+cf",
|
||||||
|
["$(PLATDEP)/ego/cj"] = "+cj",
|
||||||
|
["$(PLATDEP)/ego/cs"] = "+cs",
|
||||||
|
["$(PLATDEP)/ego/ic"] = "+ic",
|
||||||
|
["$(PLATDEP)/ego/il"] = "+il",
|
||||||
|
["$(PLATDEP)/ego/lv"] = "+lv",
|
||||||
|
["$(PLATDEP)/ego/ra"] = "./ra+ra",
|
||||||
|
["$(PLATDEP)/ego/sp"] = "+sp",
|
||||||
|
["$(PLATDEP)/ego/sr"] = "+sr",
|
||||||
|
["$(PLATDEP)/ego/ud"] = "+ud",
|
||||||
|
"./descr+pkg",
|
||||||
|
}
|
||||||
|
}
|
|
@ -220,24 +220,50 @@ main(argc, argv) int argc;
|
||||||
char* argv[];
|
char* argv[];
|
||||||
{
|
{
|
||||||
/* CA does not output proctable etc. files. Instead, its
|
/* CA does not output proctable etc. files. Instead, its
|
||||||
* pname2 and dname2 arguments contain the names of the
|
* pname_out and dname_out arguments contain the names of the
|
||||||
* dump files created by IC.
|
* dump files created by IC.
|
||||||
*/
|
*/
|
||||||
|
struct files* files = findfiles(argc, argv);
|
||||||
|
|
||||||
FILE* f, *f2; /* The EM input and output. */
|
FILE* f, *f2; /* The EM input and output. */
|
||||||
FILE* df, *pf; /* The dump files */
|
FILE* df, *pf; /* The dump files */
|
||||||
line_p lnp;
|
line_p lnp;
|
||||||
|
|
||||||
fproc = getptable(pname); /* proc table */
|
/* The names of the input files of every phase are passed as
|
||||||
fdblock = getdtable(dname); /* data block table */
|
* arguments to the phase. First come the input file names,
|
||||||
|
* then the output file names. We use a one-letter convention
|
||||||
|
* to denote the type of file:
|
||||||
|
* p: procedure table file
|
||||||
|
* d: data table file
|
||||||
|
* l: EM text file (lines of EM instructions)
|
||||||
|
* b: basic block file (Control Flow Graph file)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* The input file names */
|
||||||
|
|
||||||
|
char* pname_in = argv[1];
|
||||||
|
char* dname_in = argv[2];
|
||||||
|
char* lname_in = argv[3];
|
||||||
|
char* bname_in = argv[4];
|
||||||
|
|
||||||
|
/* The output file names */
|
||||||
|
|
||||||
|
char* pname_out = argv[5];
|
||||||
|
char* dname_out = argv[6];
|
||||||
|
char* lname_out = argv[7];
|
||||||
|
char* bname_out = argv[8];
|
||||||
|
|
||||||
|
fproc = getptable(pname_in); /* proc table */
|
||||||
|
fdblock = getdtable(dname_in); /* data block table */
|
||||||
dlength = makedmap(fdblock); /* allocate dmap table */
|
dlength = makedmap(fdblock); /* allocate dmap table */
|
||||||
df = openfile(dname2, "r");
|
df = openfile(dname_out, "r");
|
||||||
getdnames(df);
|
getdnames(df);
|
||||||
fclose(df);
|
fclose(df);
|
||||||
pf = openfile(pname2, "r");
|
pf = openfile(pname_out, "r");
|
||||||
getpnames(pf);
|
getpnames(pf);
|
||||||
fclose(pf);
|
fclose(pf);
|
||||||
uniq_names();
|
uniq_names();
|
||||||
f = openfile(lname, "r");
|
f = openfile(lname_in, "r");
|
||||||
f2 = stdout;
|
f2 = stdout;
|
||||||
cputmagic(f2); /* write magic number */
|
cputmagic(f2); /* write magic number */
|
||||||
while ((lnp = get_ca_lines(f, &curproc)) != (line_p)0)
|
while ((lnp = get_ca_lines(f, &curproc)) != (line_p)0)
|
||||||
|
|
|
@ -530,22 +530,46 @@ char* argv[];
|
||||||
short n, kind;
|
short n, kind;
|
||||||
line_p l;
|
line_p l;
|
||||||
|
|
||||||
|
/* The names of the input files of every phase are passed as
|
||||||
|
* arguments to the phase. First come the input file names,
|
||||||
|
* then the output file names. We use a one-letter convention
|
||||||
|
* to denote the type of file:
|
||||||
|
* p: procedure table file
|
||||||
|
* d: data table file
|
||||||
|
* l: EM text file (lines of EM instructions)
|
||||||
|
* b: basic block file (Control Flow Graph file)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* The input file names */
|
||||||
|
|
||||||
|
char* pname_in = argv[1];
|
||||||
|
char* dname_in = argv[2];
|
||||||
|
char* lname_in = argv[3];
|
||||||
|
char* bname_in = argv[4];
|
||||||
|
|
||||||
|
/* The output file names */
|
||||||
|
|
||||||
|
char* pname_out = argv[5];
|
||||||
|
char* dname_out = argv[6];
|
||||||
|
char* lname_out = argv[7];
|
||||||
|
char* bname_out = argv[8];
|
||||||
|
|
||||||
linecount = 0;
|
linecount = 0;
|
||||||
fproc = getptable(pname); /* proc table */
|
fproc = getptable(pname_in); /* proc table */
|
||||||
fdblock = getdtable(dname); /* data block table */
|
fdblock = getdtable(dname_in); /* data block table */
|
||||||
lpi_set = Cempty_set(plength);
|
lpi_set = Cempty_set(plength);
|
||||||
cai_set = Cempty_set(plength);
|
cai_set = Cempty_set(plength);
|
||||||
if ((f = fopen(lname, "r")) == NULL)
|
if ((f = fopen(lname_in, "r")) == NULL)
|
||||||
{
|
{
|
||||||
error("cannot open %s", lname);
|
error("cannot open %s", lname_in);
|
||||||
}
|
}
|
||||||
if ((f2 = fopen(lname2, "w")) == NULL)
|
if ((f2 = fopen(lname_out, "w")) == NULL)
|
||||||
{
|
{
|
||||||
error("cannot open %s", lname2);
|
error("cannot open %s", lname_out);
|
||||||
}
|
}
|
||||||
if ((gf2 = fopen(bname2, "w")) == NULL)
|
if ((gf2 = fopen(bname_out, "w")) == NULL)
|
||||||
{
|
{
|
||||||
error("cannot open %s", bname2);
|
error("cannot open %s", bname_out);
|
||||||
}
|
}
|
||||||
while (getbblocks(f, &kind, &n, &g, &l))
|
while (getbblocks(f, &kind, &n, &g, &l))
|
||||||
{
|
{
|
||||||
|
@ -581,14 +605,14 @@ char* argv[];
|
||||||
/* Compute transitive closure of used/changed
|
/* Compute transitive closure of used/changed
|
||||||
* variables information for every procedure.
|
* variables information for every procedure.
|
||||||
*/
|
*/
|
||||||
if ((f = fopen(dname2, "w")) == NULL)
|
if ((f = fopen(dname_out, "w")) == NULL)
|
||||||
{
|
{
|
||||||
error("cannot open %s", dname2);
|
error("cannot open %s", dname_out);
|
||||||
}
|
}
|
||||||
putdtable(fdblock, f);
|
putdtable(fdblock, f);
|
||||||
if ((f = fopen(pname2, "w")) == NULL)
|
if ((f = fopen(pname_out, "w")) == NULL)
|
||||||
{
|
{
|
||||||
error("cannot open %s", pname2);
|
error("cannot open %s", pname_out);
|
||||||
}
|
}
|
||||||
putptable(fproc, f, TRUE);
|
putptable(fproc, f, TRUE);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
30
util/ego/descr/build.lua
Normal file
30
util/ego/descr/build.lua
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
local installmap = {}
|
||||||
|
|
||||||
|
local function build_descr(name)
|
||||||
|
local descr = normalrule {
|
||||||
|
name = name,
|
||||||
|
ins = {
|
||||||
|
"lang/cem/cpp.ansi+cpp",
|
||||||
|
"./"..name..".descr",
|
||||||
|
"./descr.sed",
|
||||||
|
matching(filenamesof("modules/src/em_data+lib"), "em_mnem%.h$"),
|
||||||
|
},
|
||||||
|
outleaves = { name..".descr" },
|
||||||
|
commands = {
|
||||||
|
"%{ins[1]} -P -I%{dirname(ins[4])} %{ins[2]} > %{dir}/temp",
|
||||||
|
"sed -f %{ins[3]} < %{dir}/temp > %{outs}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
installmap["$(PLATIND)/ego/"..name..".descr"] = descr
|
||||||
|
end
|
||||||
|
|
||||||
|
build_descr("i386")
|
||||||
|
build_descr("i86")
|
||||||
|
build_descr("m68020")
|
||||||
|
|
||||||
|
installable {
|
||||||
|
name = "pkg",
|
||||||
|
map = installmap
|
||||||
|
}
|
||||||
|
|
|
@ -4,38 +4,54 @@
|
||||||
optimizer itself one day ...
|
optimizer itself one day ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <em_path.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <system.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "em_path.h"
|
||||||
|
#include "system.h"
|
||||||
|
#include "print.h"
|
||||||
|
|
||||||
#define IC 1
|
enum
|
||||||
#define CF 2
|
{
|
||||||
#define IL 3
|
NONE = 0,
|
||||||
#define CS 4
|
IC,
|
||||||
#define SR 5
|
CF,
|
||||||
#define UD 6
|
IL,
|
||||||
#define LV 7
|
CS,
|
||||||
#define RA 8
|
SR,
|
||||||
#define SP 9
|
UD,
|
||||||
#define BO 10
|
LV,
|
||||||
#define CJ 11
|
RA,
|
||||||
#define CA 12
|
SP,
|
||||||
|
BO,
|
||||||
|
CJ,
|
||||||
|
CA
|
||||||
|
};
|
||||||
|
|
||||||
static char* phnames[] = {
|
static const struct
|
||||||
0,
|
{
|
||||||
"ic",
|
const char* name;
|
||||||
"cf",
|
bool needsdescr;
|
||||||
"il",
|
|
||||||
"cs",
|
} phase_data[] = {
|
||||||
"sr",
|
{},
|
||||||
"ud",
|
{ "ic" },
|
||||||
"lv",
|
{ "cf" },
|
||||||
"ra",
|
{ "il" },
|
||||||
"sp",
|
{ "cs", true },
|
||||||
"bo",
|
{ "sr" },
|
||||||
"cj",
|
{ "ud", true },
|
||||||
"ca",
|
{ "lv" },
|
||||||
0
|
{ "ra" },
|
||||||
|
{ "sp" },
|
||||||
|
{ "bo" },
|
||||||
|
{ "cj" },
|
||||||
|
{ "ca" },
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAXUPHASES 64 /* max # of phases to be run */
|
#define MAXUPHASES 64 /* max # of phases to be run */
|
||||||
|
@ -77,8 +93,9 @@ static int keeptemps = 0;
|
||||||
static char** phase_args;
|
static char** phase_args;
|
||||||
static int nphase_args;
|
static int nphase_args;
|
||||||
|
|
||||||
static char* opt_dir;
|
static const char* descr_file;
|
||||||
static char* prog_name;
|
static const char* opt_dir;
|
||||||
|
static const char* prog_name;
|
||||||
|
|
||||||
static int v_flag;
|
static int v_flag;
|
||||||
|
|
||||||
|
@ -93,7 +110,7 @@ cleanup()
|
||||||
|
|
||||||
for (i = NTEMPS * 2; i > 0; i--)
|
for (i = NTEMPS * 2; i > 0; i--)
|
||||||
{
|
{
|
||||||
register char* f = phargs[i];
|
const char* f = phargs[i];
|
||||||
if (f != 0 && *f != '\0' && *f != '-')
|
if (f != 0 && *f != '\0' && *f != '-')
|
||||||
(void)unlink(f);
|
(void)unlink(f);
|
||||||
}
|
}
|
||||||
|
@ -167,8 +184,8 @@ get_infiles()
|
||||||
/* Make output temps from previous phase input temps of next phase. */
|
/* Make output temps from previous phase input temps of next phase. */
|
||||||
|
|
||||||
register int i;
|
register int i;
|
||||||
register char** dst = &phargs[1];
|
char** dst = &phargs[1];
|
||||||
register char** src = &phargs[NTEMPS + 1];
|
char** src = &phargs[NTEMPS + 1];
|
||||||
|
|
||||||
for (i = 1; i <= NTEMPS; i++)
|
for (i = 1; i <= NTEMPS; i++)
|
||||||
{
|
{
|
||||||
|
@ -184,7 +201,7 @@ new_outfiles()
|
||||||
static char dig1 = '1';
|
static char dig1 = '1';
|
||||||
static char dig2 = '0';
|
static char dig2 = '0';
|
||||||
register int i;
|
register int i;
|
||||||
register char** dst = &phargs[NTEMPS + 1];
|
char** dst = &phargs[NTEMPS + 1];
|
||||||
|
|
||||||
if (!Bindex)
|
if (!Bindex)
|
||||||
{
|
{
|
||||||
|
@ -219,14 +236,21 @@ static void
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int pid, status;
|
int pid, status;
|
||||||
|
|
||||||
|
/* Skip this phase if it requires a descr file and one hasn't been
|
||||||
|
* provided. */
|
||||||
|
|
||||||
|
if (phase_data[phase].needsdescr && !descr_file)
|
||||||
|
return;
|
||||||
|
|
||||||
phargs[0] = buf;
|
phargs[0] = buf;
|
||||||
(void)strcpy(buf, opt_dir);
|
(void)strcpy(buf, opt_dir);
|
||||||
(void)strcat(buf, "/");
|
(void)strcat(buf, "/");
|
||||||
(void)strcat(buf, phnames[phase]);
|
(void)strcat(buf, phase_data[phase].name);
|
||||||
|
|
||||||
switch (phase)
|
switch (phase)
|
||||||
{
|
{
|
||||||
case IC:
|
case IC:
|
||||||
|
/* always first */
|
||||||
phargs[1] = pdump;
|
phargs[1] = pdump;
|
||||||
phargs[2] = ddump;
|
phargs[2] = ddump;
|
||||||
for (i = 3; i <= NTEMPS; i++)
|
for (i = 3; i <= NTEMPS; i++)
|
||||||
|
@ -237,6 +261,7 @@ static void
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CA:
|
case CA:
|
||||||
|
/* always last */
|
||||||
old_infiles();
|
old_infiles();
|
||||||
get_infiles();
|
get_infiles();
|
||||||
phargs[NTEMPS + 1] = pdump;
|
phargs[NTEMPS + 1] = pdump;
|
||||||
|
@ -248,21 +273,25 @@ static void
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
old_infiles();
|
old_infiles();
|
||||||
get_infiles();
|
get_infiles();
|
||||||
new_outfiles();
|
new_outfiles();
|
||||||
if (!flags_added)
|
|
||||||
{
|
|
||||||
flags_added = 1;
|
|
||||||
argc = 2 * NTEMPS + 1;
|
argc = 2 * NTEMPS + 1;
|
||||||
while (--nphase_args >= 0)
|
if (descr_file)
|
||||||
{
|
{
|
||||||
phargs[argc++] = *phase_args++;
|
phargs[argc++] = "-M";
|
||||||
}
|
phargs[argc++] = descr_file;
|
||||||
phargs[argc] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i=0; i<nphase_args; i++)
|
||||||
|
phargs[argc++] = phase_args[i];
|
||||||
|
|
||||||
|
phargs[argc] = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ((pid = fork()) < 0)
|
if ((pid = fork()) < 0)
|
||||||
{
|
{
|
||||||
fatal("Could not fork");
|
fatal("Could not fork");
|
||||||
|
@ -300,10 +329,10 @@ static void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
main(argc, argv) int argc;
|
int main(int argc, char* argv[])
|
||||||
char* argv[];
|
|
||||||
{
|
{
|
||||||
register int i = 0;
|
int opt;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (signal(SIGHUP, catch) == SIG_IGN)
|
if (signal(SIGHUP, catch) == SIG_IGN)
|
||||||
(void)signal(SIGHUP, SIG_IGN);
|
(void)signal(SIGHUP, SIG_IGN);
|
||||||
|
@ -312,113 +341,58 @@ char* argv[];
|
||||||
if (signal(SIGINT, catch) == SIG_IGN)
|
if (signal(SIGINT, catch) == SIG_IGN)
|
||||||
(void)signal(SIGINT, SIG_IGN);
|
(void)signal(SIGINT, SIG_IGN);
|
||||||
prog_name = argv[0];
|
prog_name = argv[0];
|
||||||
|
|
||||||
|
nphase_args = 0;
|
||||||
phase_args = &argv[1];
|
phase_args = &argv[1];
|
||||||
while (--argc > 0)
|
|
||||||
|
opterr = 0;
|
||||||
|
for (;;)
|
||||||
{
|
{
|
||||||
argv++;
|
int opt = getopt(argc, argv, "-M:P:O:vt");
|
||||||
if (argv[0][0] == '-')
|
if (opt == -1)
|
||||||
{
|
break;
|
||||||
switch (argv[0][1])
|
|
||||||
|
switch (opt)
|
||||||
{
|
{
|
||||||
|
case 'M':
|
||||||
|
descr_file = optarg;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'P':
|
case 'P':
|
||||||
if (argv[0][2] == '\0')
|
opt_dir = optarg;
|
||||||
{
|
|
||||||
opt_dir = argv[1];
|
|
||||||
argc--;
|
|
||||||
argv++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'O':
|
||||||
|
{
|
||||||
|
int o = atoi(optarg);
|
||||||
|
if (o <= 2)
|
||||||
|
break;
|
||||||
|
if (o <= 3)
|
||||||
|
Ophase = &O3phases[0];
|
||||||
|
Ophase = &O4phases[0];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
add_file(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
if (argv[0][2] == '\0')
|
|
||||||
{
|
|
||||||
keeptemps = 1;
|
keeptemps = 1;
|
||||||
/* no continue; IL also needs this */
|
goto addopt;
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'v':
|
case 'v':
|
||||||
v_flag = 1;
|
v_flag = 1;
|
||||||
break;
|
goto addopt;
|
||||||
case 'O':
|
|
||||||
if (argv[0][2] == '2' || argv[0][2] == '\0')
|
case '?':
|
||||||
continue;
|
addopt:
|
||||||
if (argv[0][2] == '3')
|
phase_args[nphase_args++] = argv[optind - 1];
|
||||||
{
|
|
||||||
Ophase = &O3phases[0];
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
Ophase = &O4phases[0];
|
|
||||||
continue;
|
|
||||||
case 'I':
|
|
||||||
if (!strcmp(&argv[0][1], "IL"))
|
|
||||||
{
|
|
||||||
add_uphase(IL);
|
|
||||||
add_uphase(CF);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'B':
|
|
||||||
if (!strcmp(&argv[0][1], "BO"))
|
|
||||||
{
|
|
||||||
add_uphase(BO);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'R':
|
|
||||||
if (!strcmp(&argv[0][1], "RA"))
|
|
||||||
{
|
|
||||||
add_uphase(RA);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'U':
|
|
||||||
if (!strcmp(&argv[0][1], "UD"))
|
|
||||||
{
|
|
||||||
add_uphase(UD);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'L':
|
|
||||||
if (!strcmp(&argv[0][1], "LV"))
|
|
||||||
{
|
|
||||||
add_uphase(LV);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'C':
|
|
||||||
if (!strcmp(&argv[0][1], "CS"))
|
|
||||||
{
|
|
||||||
add_uphase(CS);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!strcmp(&argv[0][1], "CJ"))
|
|
||||||
{
|
|
||||||
add_uphase(CJ);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'S':
|
|
||||||
if (!strcmp(&argv[0][1], "SR"))
|
|
||||||
{
|
|
||||||
add_uphase(SR);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!strcmp(&argv[0][1], "SP"))
|
|
||||||
{
|
|
||||||
add_uphase(SP);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
phase_args[i++] = argv[0];
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
phase_args[nphase_args] = 0;
|
||||||
add_file(argv[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
phase_args[i] = 0;
|
|
||||||
nphase_args = i;
|
|
||||||
if (nuphases)
|
if (nuphases)
|
||||||
Ophase = uphases;
|
Ophase = uphases;
|
||||||
|
|
||||||
|
|
|
@ -72,13 +72,26 @@ char* argv[];
|
||||||
* - ddump: the names of all data blocks
|
* - ddump: the names of all data blocks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FILE* lfile, *dfile, *pfile, *pdump, *ddump;
|
/* The input file names */
|
||||||
|
|
||||||
|
const char* pdump_out = argv[1];
|
||||||
|
const char* ddump_out = argv[2];
|
||||||
|
|
||||||
|
/* The output file names */
|
||||||
|
|
||||||
|
const char* pname_out = argv[5];
|
||||||
|
const char* dname_out = argv[6];
|
||||||
|
const char* lname_out = argv[7];
|
||||||
|
|
||||||
|
FILE* lfile = openfile(lname_out, "w");
|
||||||
|
FILE* pdump = openfile(pdump_out, "w");
|
||||||
|
FILE* ddump = openfile(ddump_out, "w");
|
||||||
|
|
||||||
|
FILE* dfile;
|
||||||
|
FILE* pfile;
|
||||||
|
|
||||||
lfile = openfile(lname2, "w");
|
|
||||||
pdump = openfile(argv[1], "w");
|
|
||||||
ddump = openfile(argv[2], "w");
|
|
||||||
hol0_db = block_of_lab((char*)0);
|
hol0_db = block_of_lab((char*)0);
|
||||||
while (next_file(argc, argv) != NULL)
|
while (next_file(argc-8, argv+8) != NULL)
|
||||||
{
|
{
|
||||||
/* Read all EM input files, process the code
|
/* Read all EM input files, process the code
|
||||||
* and concatenate all output.
|
* and concatenate all output.
|
||||||
|
@ -104,9 +117,9 @@ char* argv[];
|
||||||
cleanprocs(prochash, NPROCHASH, 0);
|
cleanprocs(prochash, NPROCHASH, 0);
|
||||||
cleandblocks(symhash, NSYMHASH, 0);
|
cleandblocks(symhash, NSYMHASH, 0);
|
||||||
/* Now write the datablock table and the proctable */
|
/* Now write the datablock table and the proctable */
|
||||||
dfile = openfile(dname2, "w");
|
dfile = openfile(dname_out, "w");
|
||||||
putdtable(fdblock, dfile);
|
putdtable(fdblock, dfile);
|
||||||
pfile = openfile(pname2, "w");
|
pfile = openfile(pname_out, "w");
|
||||||
putptable(fproc, pfile, FALSE);
|
putptable(fproc, pfile, FALSE);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ STATIC bool read_hdr()
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC int argcnt = ARGSTART - 1;
|
STATIC int argcnt = 0;
|
||||||
STATIC short arstate = NO_ARCHIVE;
|
STATIC short arstate = NO_ARCHIVE;
|
||||||
|
|
||||||
FILE* next_file(argc, argv) int argc;
|
FILE* next_file(argc, argv) int argc;
|
||||||
|
|
|
@ -325,6 +325,7 @@ il_flags(p) char* p;
|
||||||
main(argc, argv) int argc;
|
main(argc, argv) int argc;
|
||||||
char* argv[];
|
char* argv[];
|
||||||
{
|
{
|
||||||
|
struct files* files = findfiles(argc, argv);
|
||||||
FILE* f;
|
FILE* f;
|
||||||
|
|
||||||
go(argc, argv, no_action, no_action, no_action, il_flags);
|
go(argc, argv, no_action, no_action, no_action, il_flags);
|
||||||
|
@ -337,14 +338,14 @@ char* argv[];
|
||||||
mktemp(ccname);
|
mktemp(ccname);
|
||||||
mktemp(sname);
|
mktemp(sname);
|
||||||
mktemp(cname2);
|
mktemp(cname2);
|
||||||
pass1(lname, bname, cname); /* grep calls, analyse procedures */
|
pass1(files->lname_in, files->bname_in, cname); /* grep calls, analyse procedures */
|
||||||
space = total_size * space / 100;
|
space = total_size * space / 100;
|
||||||
pass2(cname, space); /* select calls to be expanded */
|
pass2(cname, space); /* select calls to be expanded */
|
||||||
pass3(lname, lname2); /* do substitutions */
|
pass3(files->lname_in, files->lname_out); /* do substitutions */
|
||||||
f = openfile(dname2, "w");
|
f = openfile(files->dname_out, "w");
|
||||||
il_cleanptab(fproc); /* remove extended data structures */
|
il_cleanptab(fproc); /* remove extended data structures */
|
||||||
putdtable(fdblock, f);
|
putdtable(fdblock, f);
|
||||||
f = openfile(pname2, "w");
|
f = openfile(files->pname_out, "w");
|
||||||
putptable(fproc, f, FALSE);
|
putptable(fproc, f, FALSE);
|
||||||
report("inline substitutions", Ssubst);
|
report("inline substitutions", Ssubst);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
|
|
32
util/ego/ra/build.lua
Normal file
32
util/ego/ra/build.lua
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
cprogram {
|
||||||
|
name = "makeitems",
|
||||||
|
srcs = { "./makeitems.c" }
|
||||||
|
}
|
||||||
|
|
||||||
|
normalrule {
|
||||||
|
name = "itemtab_h",
|
||||||
|
ins = {
|
||||||
|
"+makeitems",
|
||||||
|
matching(filenamesof("modules/src/em_data+lib"), "em_mnem%.h$"),
|
||||||
|
"./itemtab.src"
|
||||||
|
},
|
||||||
|
outleaves = { "itemtab.h" },
|
||||||
|
commands = {
|
||||||
|
"%{ins} > %{outs}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cprogram {
|
||||||
|
name = "ra",
|
||||||
|
srcs = { "./ra*.c" },
|
||||||
|
deps = {
|
||||||
|
"util/ego/share+lib",
|
||||||
|
"modules/src/em_data+lib",
|
||||||
|
"h+emheaders",
|
||||||
|
"+itemtab_h",
|
||||||
|
},
|
||||||
|
vars = {
|
||||||
|
["+cflags"] = {"-DVERBOSE", "-DNOTCOMPACT"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -9,9 +9,45 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "files.h"
|
||||||
|
|
||||||
FILE *openfile(name,mode)
|
struct files* findfiles(int argc, const char** argv)
|
||||||
char *name,*mode;
|
{
|
||||||
|
static struct files files;
|
||||||
|
|
||||||
|
/* The names of the input files of every phase are passed as
|
||||||
|
* arguments to the phase. First come the input file names,
|
||||||
|
* then the output file names. We use a one-letter convention
|
||||||
|
* to denote the type of file:
|
||||||
|
* p: procedure table file
|
||||||
|
* d: data table file
|
||||||
|
* l: EM text file (lines of EM instructions)
|
||||||
|
* b: basic block file (Control Flow Graph file)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* The input file names */
|
||||||
|
|
||||||
|
files.pname_in = argv[1];
|
||||||
|
files.dname_in = argv[2];
|
||||||
|
files.lname_in = argv[3];
|
||||||
|
files.bname_in = argv[4];
|
||||||
|
|
||||||
|
/* The output file names */
|
||||||
|
|
||||||
|
files.pname_out = argv[5];
|
||||||
|
files.dname_out = argv[6];
|
||||||
|
files.lname_out = argv[7];
|
||||||
|
files.bname_out = argv[8];
|
||||||
|
|
||||||
|
/* The rest of the arguments. */
|
||||||
|
|
||||||
|
files.argv = argv + 8;
|
||||||
|
files.argc = argc - 8;
|
||||||
|
|
||||||
|
return &files;
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE *openfile(char* name, char* mode)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
|
|
|
@ -15,21 +15,29 @@
|
||||||
* b: basic block file (Control Flow Graph file)
|
* b: basic block file (Control Flow Graph file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The input file names */
|
struct files
|
||||||
|
{
|
||||||
|
/* Input files */
|
||||||
|
|
||||||
#define pname argv[1]
|
const char* pname_in;
|
||||||
#define dname argv[2]
|
const char* dname_in;
|
||||||
#define lname argv[3]
|
const char* lname_in;
|
||||||
#define bname argv[4]
|
const char* bname_in;
|
||||||
|
|
||||||
/* The output file names */
|
/* Output files */
|
||||||
|
|
||||||
#define pname2 argv[5]
|
const char* pname_out;
|
||||||
#define dname2 argv[6]
|
const char* dname_out;
|
||||||
#define lname2 argv[7]
|
const char* lname_out;
|
||||||
#define bname2 argv[8]
|
const char* bname_out;
|
||||||
|
|
||||||
#define ARGSTART 9
|
/* The rest of the arguments. */
|
||||||
|
|
||||||
|
const char** argv;
|
||||||
|
int argc;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct files* findfiles(int argc, const char** argv);
|
||||||
|
|
||||||
extern FILE *openfile(); /* (char *name, *mode)
|
extern FILE *openfile(); /* (char *name, *mode)
|
||||||
* Open a file with the given name
|
* Open a file with the given name
|
||||||
|
|
|
@ -10,24 +10,24 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "files.h"
|
|
||||||
#include "get.h"
|
#include "get.h"
|
||||||
#include "put.h"
|
#include "put.h"
|
||||||
#include "lset.h"
|
#include "lset.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "alloc.h"
|
#include "alloc.h"
|
||||||
#include "go.h"
|
#include "go.h"
|
||||||
|
#include "files.h"
|
||||||
|
|
||||||
STATIC bool report_flag = FALSE; /* report #optimizations found? */
|
STATIC bool report_flag = FALSE; /* report #optimizations found? */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
STATIC bool core_flag = FALSE; /* report core usage? */
|
STATIC bool core_flag = FALSE; /* report core usage? */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STATIC mach_init(machfile, phase_machinit) char* machfile;
|
static mach_init(char* machfile, int (*phase_machinit)())
|
||||||
int (*phase_machinit)();
|
|
||||||
{
|
{
|
||||||
/* Read target machine dependent information */
|
/* Read target machine dependent information */
|
||||||
|
|
||||||
|
@ -42,13 +42,10 @@ int (*phase_machinit)();
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
go(argc, argv, initialize, optimize, phase_machinit, proc_flag) int argc;
|
void go(int argc, const char** argv,
|
||||||
char* argv[];
|
int (*initialize)(), int (*optimize)(), int (*phase_machinit)(), int (*proc_flag)())
|
||||||
int (*initialize)();
|
|
||||||
int (*optimize)();
|
|
||||||
int (*phase_machinit)();
|
|
||||||
int (*proc_flag)();
|
|
||||||
{
|
{
|
||||||
|
struct files* files = findfiles(argc, argv);
|
||||||
FILE* f, *gf, *f2, *gf2; /* The EM input and output and
|
FILE* f, *gf, *f2, *gf2; /* The EM input and output and
|
||||||
* the basic block graphs input and output
|
* the basic block graphs input and output
|
||||||
*/
|
*/
|
||||||
|
@ -60,49 +57,56 @@ int (*proc_flag)();
|
||||||
bool time_opt = TRUE;
|
bool time_opt = TRUE;
|
||||||
|
|
||||||
linecount = 0;
|
linecount = 0;
|
||||||
for (i = ARGSTART; i < argc; i++)
|
opterr = 0;
|
||||||
|
for (;;)
|
||||||
{
|
{
|
||||||
p = argv[i];
|
int opt = getopt(files->argc, files->argv, "STM:CQV");
|
||||||
if (*p++ != '-')
|
if (opt == -1)
|
||||||
error("illegal argument");
|
break;
|
||||||
switch (*p)
|
|
||||||
|
switch (opt)
|
||||||
{
|
{
|
||||||
case 'S':
|
case 'S':
|
||||||
time_opt = FALSE;
|
time_opt = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
time_opt = TRUE;
|
time_opt = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'M':
|
case 'M':
|
||||||
p++;
|
mach_init(optarg, phase_machinit);
|
||||||
mach_init(p, phase_machinit);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'C':
|
case 'C':
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
core_flag = TRUE;
|
core_flag = TRUE;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Q':
|
case 'Q':
|
||||||
report_flag = TRUE;
|
report_flag = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
verbose_flag = TRUE;
|
verbose_flag = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
(*proc_flag)(p);
|
case '?':
|
||||||
|
proc_flag(argv[optind - 1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
time_space_ratio = (time_opt ? 100 : 0);
|
time_space_ratio = (time_opt ? 100 : 0);
|
||||||
fproc = getptable(pname); /* proc table */
|
fproc = getptable(files->pname_in); /* proc table */
|
||||||
fdblock = getdtable(dname); /* data block table */
|
fdblock = getdtable(files->dname_in); /* data block table */
|
||||||
(*initialize)();
|
(*initialize)();
|
||||||
if (optimize == no_action)
|
if (optimize == no_action)
|
||||||
return;
|
return;
|
||||||
f = openfile(lname, "r");
|
f = openfile(files->lname_in, "r");
|
||||||
gf = openfile(bname, "r");
|
gf = openfile(files->bname_in, "r");
|
||||||
f2 = openfile(lname2, "w");
|
f2 = openfile(files->lname_out, "w");
|
||||||
gf2 = openfile(bname2, "w");
|
gf2 = openfile(files->bname_out, "w");
|
||||||
mesregs = Lempty_set();
|
mesregs = Lempty_set();
|
||||||
while (getunit(gf, f, &kind, &g, &l, &curproc, TRUE))
|
while (getunit(gf, f, &kind, &g, &l, &curproc, TRUE))
|
||||||
{
|
{
|
||||||
|
@ -130,18 +134,18 @@ int (*proc_flag)();
|
||||||
fclose(f2);
|
fclose(f2);
|
||||||
fclose(gf);
|
fclose(gf);
|
||||||
fclose(gf2);
|
fclose(gf2);
|
||||||
f = openfile(dname2, "w");
|
f = openfile(files->dname_out, "w");
|
||||||
putdtable(fdblock, f);
|
putdtable(fdblock, f);
|
||||||
/* fclose(f); done by putdtable */
|
/* fclose(f); done by putdtable */
|
||||||
f = openfile(pname2, "w");
|
f = openfile(files->pname_out, "w");
|
||||||
putptable(fproc, f, TRUE);
|
putptable(fproc, f, TRUE);
|
||||||
/* fclose(f); done by putptable */
|
/* fclose(f); done by putptable */
|
||||||
core_usage();
|
core_usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
no_action() {}
|
int no_action() {}
|
||||||
|
|
||||||
core_usage()
|
void core_usage(void)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (core_flag)
|
if (core_flag)
|
||||||
|
@ -151,8 +155,7 @@ core_usage()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
report(s, n) char* s;
|
void report(char* s, int n)
|
||||||
int n;
|
|
||||||
{
|
{
|
||||||
/* Report number of optimizations found, if report_flag is set */
|
/* Report number of optimizations found, if report_flag is set */
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern go(); /* ( int argc; char *argv[];
|
/* This is the main driving routine of the optimizer.
|
||||||
* int (*initialize)(); int (*optimize)();
|
|
||||||
* int (*phase_machinit)(); int (*proc_flag)() )
|
|
||||||
* This is the main driving routine of the optimizer.
|
|
||||||
* It first processes the flags given as argument;
|
* It first processes the flags given as argument;
|
||||||
* for every flag it does not recognize itself, it
|
* for every flag it does not recognize itself, it
|
||||||
* calls 'proc_flag'; as soon as the -M flag is seen,
|
* calls 'proc_flag'; as soon as the -M flag is seen,
|
||||||
|
@ -25,14 +22,20 @@ extern go(); /* ( int argc; char *argv[];
|
||||||
* and 'optimize' is called with the current procedure
|
* and 'optimize' is called with the current procedure
|
||||||
* as parameter.
|
* as parameter.
|
||||||
*/
|
*/
|
||||||
extern no_action(); /* ()
|
extern void go(int argc, const char** argv,
|
||||||
|
int (*initialize)(), int (*optimize)(),
|
||||||
|
int (*phase_machinit)(), int (*proc_flag)());
|
||||||
|
|
||||||
|
/*
|
||||||
* Parameter to be supplied for e.g. 'initialize' if
|
* Parameter to be supplied for e.g. 'initialize' if
|
||||||
* no action is required.
|
* no action is required.
|
||||||
*/
|
*/
|
||||||
extern core_usage(); /* ()
|
extern int no_action();
|
||||||
* Report core usage, if core_flag is set.
|
|
||||||
*/
|
/* Report core usage, if core_flag is set. */
|
||||||
extern report(); /* ( char *s; int n)
|
extern void core_usage(void);
|
||||||
* Report number of optimizations found, if
|
|
||||||
|
/* Report number of optimizations found, if
|
||||||
* report_flag is set
|
* report_flag is set
|
||||||
*/
|
*/
|
||||||
|
extern void report(char* s, int n);
|
||||||
|
|
Loading…
Reference in a new issue