Partially implement casts.

This commit is contained in:
Bill Currie 2011-01-23 11:53:08 +09:00
parent bf626c9e00
commit a79b6f0a6c

View file

@ -421,6 +421,17 @@ expr_expr (sblock_t *sblock, expr_t *e, operand_t **op)
return sblock;
}
static sblock_t *
expr_cast (sblock_t *sblock, expr_t *e, operand_t **op)
{
if (!*op) {
(*op) = new_operand (op_temp);
(*op)->type = e->e.expr.type->type;
}
sblock = statement_subexpr (sblock, e->e.expr.e1, op);
return sblock;
}
static sblock_t *
expr_uexpr (sblock_t *sblock, expr_t *e, operand_t **op)
{
@ -432,8 +443,7 @@ expr_uexpr (sblock_t *sblock, expr_t *e, operand_t **op)
sblock = expr_deref (sblock, e, op);
break;
case 'C':
//FIXME
sblock = statement_subexpr (sblock, e->e.expr.e1, op);
sblock = expr_cast (sblock, e, op);
break;
default:
;