mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Implement unary expression statements.
This commit is contained in:
parent
45de7327dc
commit
022fde666f
1 changed files with 14 additions and 2 deletions
|
@ -589,6 +589,9 @@ expr_cast (sblock_t *sblock, expr_t *e, operand_t **op)
|
||||||
static sblock_t *
|
static sblock_t *
|
||||||
expr_uexpr (sblock_t *sblock, expr_t *e, operand_t **op)
|
expr_uexpr (sblock_t *sblock, expr_t *e, operand_t **op)
|
||||||
{
|
{
|
||||||
|
const char *opcode;
|
||||||
|
statement_t *s;
|
||||||
|
|
||||||
switch (e->e.expr.op) {
|
switch (e->e.expr.op) {
|
||||||
case '&':
|
case '&':
|
||||||
sblock = expr_address (sblock, e, op);
|
sblock = expr_address (sblock, e, op);
|
||||||
|
@ -603,8 +606,17 @@ expr_uexpr (sblock_t *sblock, expr_t *e, operand_t **op)
|
||||||
sblock = expr_cast (sblock, e, op);
|
sblock = expr_cast (sblock, e, op);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//FIXME implement unary expressions
|
opcode = convert_op (e->e.expr.op);
|
||||||
;
|
if (!opcode)
|
||||||
|
internal_error (e, "ice ice baby");
|
||||||
|
s = new_statement (opcode, e);
|
||||||
|
sblock = statement_subexpr (sblock, e->e.expr.e1, &s->opa);
|
||||||
|
if (!*op) {
|
||||||
|
*op = new_operand (op_temp);
|
||||||
|
(*op)->type = low_level_type (e->e.expr.type);
|
||||||
|
}
|
||||||
|
s->opc = *op;
|
||||||
|
sblock_add_statement (sblock, s);
|
||||||
}
|
}
|
||||||
return sblock;
|
return sblock;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue