shithub: mc

Download patch

ref: 3e8d3b9970076ffb3f34aa1deb8ecf9081031131
parent: 96f5d2d5bc1b212d843f8b8aa41ec6ed7c3382b7
author: Ori Bernstein <[email protected]>
date: Tue Jun 19 21:21:53 EDT 2012

Continue to reduce debug dump size.

--- a/8/main.c
+++ b/8/main.c
@@ -30,9 +30,9 @@
     printf("\t-d\tPrint debug dumps. Recognized options: f r p i\n");
     printf("\t\t\tno options: print most common debug information\n");
     printf("\t\t\tf: additionally log folded trees\n");
-    printf("\t\t\tr: additionally log reduced pre-cfg trees\n");
-    printf("\t\t\tp: additionally log tree immediately before parsing\n");
-    printf("\t\t\ti: additionally log tree after type inference\n");
+    printf("\t\t\tl: additionally log lowered pre-cfg trees\n");
+    printf("\t\t\tT: additionally log tree immediately\n");
+    printf("\t\t\tr: additionally log register allocation activity\n");
     printf("\t-o\tOutput to outfile\n");
     printf("\t-S\tGenerate assembly instead of object code\n");
 }
@@ -89,11 +89,11 @@
         yyparse();
 
         /* before we do anything to the parse */
-        if (debugopt['p'])
+        if (debugopt['T'])
             dump(file, stdout);
         infer(file);
         /* after all processing */
-        if (debugopt['i'])
+        if (debug)
             dump(file, stdout);
 
         swapsuffix(buf, 1024, argv[i], ".myr", ".s");
--- a/8/ra.c
+++ b/8/ra.c
@@ -539,7 +539,7 @@
     size_t i, j;
     int has;
 
-    if (debug) {
+    if (debugopt['r']) {
 	printf("Combine ");
 	locprint(stdout, locmap[u]);
 	printf(" ==> ");
@@ -709,7 +709,7 @@
 	found = 0;
 	for (i = 0; i < K; i++) {
 	    if (!taken[i]) {
-		if (debug) {
+		if (debugopt['r']) {
 		    locprint(stdout, n);
 		    printf(" ==> %s\n", regnames[regmap[i][n->mode]]);
 		}
@@ -749,7 +749,7 @@
 	liveness(s);
 	build(s);
 	mkworklist(s);
-	if (debug)
+	if (debugopt['r'])
 	    dumpasm(s, stdout);
 	do {
 	    if (s->nwlsimp)
--- a/8/reduce.c
+++ b/8/reduce.c
@@ -703,7 +703,7 @@
     assert(n->type == Ndecl);
     s->stksz += size(n);
     if (debug)
-        printf("DECLARE %s(%ld) at %zd\n", declname(n), n->decl.did, s->stksz);
+        printf("declare %s(%ld) at %zd\n", declname(n), n->decl.did, s->stksz);
     htput(s->locs, n, (void*)s->stksz);
 }
 
@@ -711,7 +711,7 @@
 {
     assert(n->type == Ndecl);
     if (debug)
-        printf("DECLARE %s(%ld) at %zd\n", declname(n), n->decl.did, -(s->argsz + 8));
+        printf("declare %s(%ld) at %zd\n", declname(n), n->decl.did, -(s->argsz + 8));
     htput(s->locs, n, (void*)-(s->argsz + 8));
     s->argsz += size(n);
 }
@@ -812,12 +812,12 @@
     for (i = 0; i < s->nstmts; i++) {
         if (s->stmts[i]->type != Nexpr)
             continue;
-        if (debug) {
+        if (debugopt['f']) {
             printf("FOLD FROM ----------\n");
             dump(s->stmts[i], stdout);
         }
         s->stmts[i] = fold(s->stmts[i]);
-        if (debug) {
+        if (debugopt['f']) {
             printf("FOLD TO ------------\n");
             dump(s->stmts[i], stdout);
             printf("END ----------------\n");