From 081360df6a06979852de977a4d4e56f3c4481a81 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 9 Apr 2016 09:38:20 -0400 Subject: nicer debug info --- fold.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fold.c b/fold.c index a66755e..c8466e4 100644 --- a/fold.c +++ b/fold.c @@ -167,7 +167,7 @@ fold(Fn *fn) Blk *b, **pb; Phi *p, **pp; Ins *i; - int n, l; + int n, l, d; val = emalloc(fn->ntmp * sizeof val[0]); edge = emalloc(fn->nblk * sizeof edge[0]); @@ -244,12 +244,14 @@ fold(Fn *fn) else printref(CON(val[n]), fn, stderr); } - fprintf(stderr, "\n\n> Dead blocks:\n\t"); + fprintf(stderr, "\n%10s: ", "dead!"); } /* 2. trim dead code, replace constants */ + d = 0; for (pb=&fn->start; (b=*pb);) { if (b->visit == 0) { + d = 1; if (debug['F']) fprintf(stderr, "%s ", b->name); // blkdel(pb); @@ -289,6 +291,8 @@ fold(Fn *fn) } if (debug['F']) { + if (!d) + fprintf(stderr, "(none)"); fprintf(stderr, "\n\n> After folding:\n"); printfn(fn, stderr); } -- cgit 1.4.1