mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +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->o.label = &e->e.expr.e1->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;
|
||||
if (e->e.expr.op == 'g') {
|
||||
s = new_statement ("<JUMPB>", e);
|
||||
sblock = statement_subexpr (sblock, e->e.expr.e1, &s->opa);
|
||||
sblock = statement_subexpr (sblock, e->e.expr.e2, &s->opb);
|
||||
} 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);
|
||||
|
@ -875,6 +881,7 @@ statement_expr (sblock_t *sblock, expr_t *e)
|
|||
case 'c':
|
||||
sblock = expr_call (sblock, e, 0);
|
||||
break;
|
||||
case 'g':
|
||||
case 'i':
|
||||
case 'n':
|
||||
case IFBE:
|
||||
|
|
Loading…
Reference in a new issue