7 ['P'] = 0, /* parsing */
8 ['A'] = 0, /* abi lowering */
9 ['I'] = 0, /* instruction selection */
10 ['L'] = 0, /* liveness */
11 ['M'] = 0, /* memory optimization */
12 ['N'] = 0, /* ssa construction */
13 ['C'] = 0, /* copy elimination */
14 ['F'] = 0, /* constant folding */
15 ['S'] = 0, /* spilling */
16 ['R'] = 0, /* reg. allocation */
27 if (d
->type
== DEnd
) {
28 fputs("/* end data */\n\n", outf
);
40 fprintf(stderr
, "**** Function %s ****", fn
->name
);
42 fprintf(stderr
, "\n> After parsing:\n");
69 assert(fn
->rpo
[0] == fn
->start
);
71 if (n
== fn
->nblk
-1) {
75 fn
->rpo
[n
]->link
= fn
->rpo
[n
+1];
78 fprintf(outf
, "/* end function %s */\n\n", fn
->name
);
80 fprintf(stderr
, "\n");
85 main(int ac
, char *av
[])
93 while ((c
= getopt(ac
, av
, "hd:o:G:")) != -1)
96 for (; *optarg
; optarg
++)
97 if (isalpha(*optarg
)) {
98 debug
[toupper(*optarg
)] = 1;
103 if (strcmp(optarg
, "-") != 0)
104 outf
= fopen(optarg
, "w");
107 if (strcmp(optarg
, "e") == 0)
109 else if (strcmp(optarg
, "m") == 0)
112 fprintf(stderr
, "unknown gas flavor '%s'\n", optarg
);
118 fprintf(stderr
, "%s [OPTIONS] {file.ssa, -}\n", av
[0]);
119 fprintf(stderr
, "\t%-10s prints this help\n", "-h");
120 fprintf(stderr
, "\t%-10s output to file\n", "-o file");
121 fprintf(stderr
, "\t%-10s generate gas (e) or osx (m) asm\n", "-G {e,m}");
122 fprintf(stderr
, "\t%-10s dump debug information\n", "-d <flags>");
139 if (!f
|| strcmp(f
, "-") == 0) {
145 fprintf(stderr
, "cannot open '%s'\n", f
);
149 parse(inf
, f
, data
, func
);
150 } while (++optind
< ac
);