support TYPE_FIELD in stores; storeP to do a different kind of type checking

This commit is contained in:
Wolfgang Bumiller 2012-05-01 12:05:47 +02:00
parent 340daeabc4
commit 5f0800bef6

20
ir.c
View file

@ -608,6 +608,9 @@ bool ir_block_create_store(ir_block *self, ir_value *target, ir_value *what)
case TYPE_STRING:
op = INSTR_STORE_S;
break;
case TYPE_FIELD:
op = INSTR_STORE_FLD;
break;
#if 0
case TYPE_INTEGER:
if (what->vtype == TYPE_INTEGER)
@ -634,16 +637,14 @@ bool ir_block_create_storep(ir_block *self, ir_value *target, ir_value *what)
{
int op = 0;
int vtype;
if (target->vtype == TYPE_VARIANT)
vtype = what->vtype;
else
vtype = target->vtype;
if (vtype != what->vtype)
{
/* Cannot implicitly convert when storing through a pointer */
if (target->vtype != TYPE_POINTER)
return false;
}
/* storing using pointer - target is a pointer, type must be
* inferred from source
*/
vtype = what->vtype;
switch (vtype) {
case TYPE_FLOAT:
@ -658,6 +659,9 @@ bool ir_block_create_storep(ir_block *self, ir_value *target, ir_value *what)
case TYPE_STRING:
op = INSTR_STOREP_S;
break;
case TYPE_FIELD:
op = INSTR_STOREP_FLD;
break;
#if 0
case TYPE_INTEGER:
op = INSTR_STOREP_I;