summaryrefslogtreecommitdiff
path: root/opt
diff options
context:
space:
mode:
authorOri Bernstein <orib@google.com>2012-06-11 13:14:23 -0400
committerOri Bernstein <orib@google.com>2012-06-11 13:14:23 -0400
commitac3035a2c5d8b9580a81852ec9493831b6e13e27 (patch)
treee1f48531bad48909c844b51ae94d99a31605dc33 /opt
parent637aad1be46d7ed9dfafd103dd57a4cbdcba9ca0 (diff)
downloadmc-ac3035a2c5d8b9580a81852ec9493831b6e13e27.tar.gz
Only change the separator if we print something.
This eliminates spurious commas.
Diffstat (limited to 'opt')
-rw-r--r--opt/df.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/opt/df.c b/opt/df.c
index 9106df0..8981328 100644
--- a/opt/df.c
+++ b/opt/df.c
@@ -117,6 +117,7 @@ void dumpcfg(Cfg *cfg, FILE *fd)
for (j = 0; j < cfg->nbb; j++) {
bb = cfg->bb[j];
+ fprintf(fd, "\n");
fprintf(fd, "Bb: %d\n", bb->id);
/* in edges */
@@ -133,13 +134,15 @@ void dumpcfg(Cfg *cfg, FILE *fd)
fprintf(fd, "Out: ");
sep = "";
for (i = 0; i < bsmax(bb->out); i++) {
- if (bshas(bb->in, i))
+ if (bshas(bb->in, i)) {
fprintf(fd, "%d%s", i, sep);
- sep = ",";
+ sep = ",";
+ }
}
fprintf(fd, "\n");
for (i = 0; i < bb->nnl; i++)
dump(bb->nl[i], fd);
+ fprintf(fd, "\n");
}
}