Temp expressions now use operands instead of defs.

This commit is contained in:
Bill Currie 2011-01-21 11:26:43 +09:00
parent 2998e578fb
commit 4a24393d8d
3 changed files with 8 additions and 5 deletions

View file

@ -85,7 +85,7 @@ typedef struct {
typedef struct {
struct expr_s *expr;
struct def_s *def; ///< The def for the temporary variable, if
struct operand_s *op; ///< The operand for the temporary variable, if
///< allocated
struct type_s *type; ///< The type of the temporary variable.
int users; ///< Reference count. Source of much hair loss.

View file

@ -354,8 +354,8 @@ free_tempdefs (void)
d->name);
}
size = type_size (d->type) - 1;
if (d->expr)
d->expr->e.temp.def = 0;
//if (d->expr)
// d->expr->e.temp.def = 0;
if (!d->freed) {
d->next = free_temps[size];

View file

@ -379,8 +379,11 @@ expr_symbol (sblock_t *sblock, expr_t *e, operand_t **op)
static sblock_t *
expr_temp (sblock_t *sblock, expr_t *e, operand_t **op)
{
*op = new_operand (op_temp);
(*op)->type = e->e.temp.type->type;
if (!e->e.temp.op) {
e->e.temp.op = new_operand (op_temp);
e->e.temp.op->type = e->e.temp.type->type;
}
*op = e->e.temp.op;
return sblock;
}