aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-21 09:38:39 +0100
committerlemon <lsof@mailbox.org>2025-11-21 09:38:39 +0100
commit211a9fc2510556bf5efb58789509325e49dbdc26 (patch)
tree7304520c61e8b6cf39b50c0844b0177236acb221 /ir
parente4f8fc6306cc14edd600d7691142e21af711f603 (diff)
ir/dump: print block predecessors
Diffstat (limited to 'ir')
-rw-r--r--ir/dump.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ir/dump.c b/ir/dump.c
index 48ef921..3d4338b 100644
--- a/ir/dump.c
+++ b/ir/dump.c
@@ -211,7 +211,15 @@ dumpblk(struct function *fn, struct block *blk)
{
static const char *jnames[] = { 0, "b", "ret", "trap" };
int i;
- bfmt(out, " @%d:\n", blk->id);
+ bfmt(out, " @%d:", blk->id);
+ if (blk->npred) {
+ bfmt(out, " \t; preds:");
+ for (i = 0; i < blk->npred; ++i) {
+ if (i) ioputc(out, ',');
+ bfmt(out, " @%d", blkpred(blk, i)->id);
+ }
+ }
+ ioputc(out, '\n');
for (i = 0; i < blk->phi.n; ++i) {
struct instr *phi = &instrtab[blk->phi.p[i]];
union ref *refs = phitab.p[phi->l.i];
@@ -225,7 +233,7 @@ dumpblk(struct function *fn, struct block *blk)
bfmt(out, "@%d ", blkpred(blk, i)->id);
dumpref(0, refs[i]);
}
- bfmt(out, "\n");
+ ioputc(out, '\n');
}
for (i = 0; i < blk->ins.n; ++i) {
bfmt(out, "%-4d ", blk->inumstart + 1 + i);