mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Fix IR checker
This commit is contained in:
parent
bab62d42c9
commit
5aad53388d
@ -137,7 +137,7 @@ bool ir_check(ir_ctx *ctx)
|
||||
}
|
||||
case IR_OPND_CONTROL_DEP:
|
||||
if (use >= i
|
||||
&& !(insn->op == IR_LOOP_BEGIN && j > 1)) {
|
||||
&& !(insn->op == IR_LOOP_BEGIN)) {
|
||||
fprintf(stderr, "ir_base[%d].ops[%d] invalid forward reference (%d)\n", i, j, use);
|
||||
ok = 0;
|
||||
}
|
||||
@ -166,7 +166,7 @@ bool ir_check(ir_ctx *ctx)
|
||||
/* pass (function returns void) */
|
||||
} else if (insn->op == IR_BEGIN && j == 1) {
|
||||
/* pass (start of unreachable basic block) */
|
||||
} else if (insn->op == IR_LOOP_BEGIN && j > 1) {
|
||||
} else if (insn->op == IR_LOOP_BEGIN || insn->op == IR_MERGE) {
|
||||
/* TODO: something wrong ??? */
|
||||
} else if (IR_OPND_KIND(flags, j) != IR_OPND_CONTROL_REF) {
|
||||
fprintf(stderr, "ir_base[%d].ops[%d] missing reference (%d)\n", i, j, use);
|
||||
|
Loading…
Reference in New Issue
Block a user