summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-07-22 14:31:27 -0400
committerOri Bernstein <ori@eigenstate.org>2012-07-22 14:31:27 -0400
commitf4f2253f78a010e8ba652c405e611e5524fc19f7 (patch)
tree32ff51ceb78e7ee9091fbcfb19eaf55f2206d9c8 /util
parentea5a4f8b5cea8d90491e6568d208dd656676bf61 (diff)
downloadmc-f4f2253f78a010e8ba652c405e611e5524fc19f7.tar.gz
Fix bad instruction generation.
- Fixed name for setl (we called it setlt) - Disallowed generation of movzbb and similar.
Diffstat (limited to 'util')
-rw-r--r--util/muse.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/util/muse.c b/util/muse.c
index 6262410..b3f203e 100644
--- a/util/muse.c
+++ b/util/muse.c
@@ -26,6 +26,7 @@ static void usage(char *prog)
printf("\t-I path\tAdd 'path' to use search path\n");
printf("\t-d\tPrint debug dumps\n");
printf("\t-o\tOutput to outfile\n");
+ printf("\t-s\tShow the contents of usefiles `inputs`\n");
}
@@ -34,8 +35,6 @@ int main(int argc, char **argv)
int opt;
int i;
Stab *globls;
- Node *rdback;
- FILE *tmp;
FILE *f;
while ((opt = getopt(argc, argv, "d::ho:I:")) != -1) {
@@ -44,6 +43,9 @@ int main(int argc, char **argv)
outfile = optarg;
break;
case 'h':
+ usage(argv[0]);
+ exit(0);
+ break;
case 'd':
debug = 1;
while (optarg && *optarg)
@@ -59,6 +61,16 @@ int main(int argc, char **argv)
}
}
+ if (debugopt['s']) {
+ for (i = optind; i < argc; i++) {
+ globls = mkstab();
+ f = fopen(argv[i], "r");
+ readuse(file, globls);
+ dumpstab(globls, stdout);
+ }
+ exit(0);
+ }
+
for (i = optind; i < argc; i++) {
globls = mkstab();
tyinit(globls);
@@ -69,20 +81,6 @@ int main(int argc, char **argv)
yyparse();
infer(file);
- /* before we do anything to the parse */
- if (debugopt['p']) {
- /* test storing tree to file */
- tmp = fopen("a.pkl", "w");
- pickle(file, tmp);
- fclose(tmp);
-
- /* and reading it back */
- tmp = fopen("a.pkl", "r");
- rdback = unpickle(tmp);
- dump(rdback, stdout);
- fclose(tmp);
- dump(file, stdout);
- }
if (!outfile)
die("need output file name right now. FIX THIS.");
f = fopen(outfile, "w");