mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
Emit code for jump tables.
With this, the entirety of the ruamoko tree builds (though the progs will be broken in various ways: mostly unrelocated references).
This commit is contained in:
parent
a281033920
commit
ee9045c377
1 changed files with 12 additions and 5 deletions
|
@ -268,11 +268,17 @@ statement_branch (sblock_t *sblock, expr_t *e)
|
||||||
s->opa = new_operand (op_label);
|
s->opa = new_operand (op_label);
|
||||||
s->opa->o.label = &e->e.expr.e1->e.label;
|
s->opa->o.label = &e->e.expr.e1->e.label;
|
||||||
} else {
|
} else {
|
||||||
opcode = convert_op (e->e.expr.op);
|
if (e->e.expr.op == 'g') {
|
||||||
s = new_statement (opcode, e);
|
s = new_statement ("<JUMPB>", e);
|
||||||
sblock = statement_subexpr (sblock, e->e.expr.e1, &s->opa);
|
sblock = statement_subexpr (sblock, e->e.expr.e1, &s->opa);
|
||||||
s->opb = new_operand (op_label);
|
sblock = statement_subexpr (sblock, e->e.expr.e2, &s->opb);
|
||||||
s->opb->o.label = &e->e.expr.e2->e.label;
|
} else {
|
||||||
|
opcode = convert_op (e->e.expr.op);
|
||||||
|
s = new_statement (opcode, e);
|
||||||
|
sblock = statement_subexpr (sblock, e->e.expr.e1, &s->opa);
|
||||||
|
s->opb = new_operand (op_label);
|
||||||
|
s->opb->o.label = &e->e.expr.e2->e.label;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sblock_add_statement (sblock, s);
|
sblock_add_statement (sblock, s);
|
||||||
|
@ -875,6 +881,7 @@ statement_expr (sblock_t *sblock, expr_t *e)
|
||||||
case 'c':
|
case 'c':
|
||||||
sblock = expr_call (sblock, e, 0);
|
sblock = expr_call (sblock, e, 0);
|
||||||
break;
|
break;
|
||||||
|
case 'g':
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'n':
|
case 'n':
|
||||||
case IFBE:
|
case IFBE:
|
||||||
|
|
Loading…
Reference in a new issue