#include "gmqcc.h"
#include "ir.h"
-#include "platform.h"
/***********************************************************************
* Type sizes used at multiple points in the IR codegen
ir_instr *in;
if (!ir_check_unreachable(self))
return false;
+
self->final = true;
+
self->is_return = true;
in = ir_instr_new(ctx, self, INSTR_RETURN);
if (!in)
case VINSTR_NEG_F:
return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_F, NULL, operand, ot);
case VINSTR_NEG_V:
- return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_V, NULL, operand, ot);
+ return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_V, self->owner->owner->nil, operand, ot);
default:
ot = operand->vtype;
ir_value *global;
char name[128];
- platform_snprintf(name, sizeof(name), "EXTPARM#%i", (int)(vec_size(ir->extparam_protos)));
+ util_snprintf(name, sizeof(name), "EXTPARM#%i", (int)(vec_size(ir->extparam_protos)));
global = ir_value_var(name, store_global, TYPE_VECTOR);
vec_push(ir->extparam_protos, global);
return;
}
oprintf("%sfunction %s\n", ind, f->name);
- platform_strncat(ind, "\t", IND_BUFSZ-1);
+ util_strncat(ind, "\t", IND_BUFSZ-1);
if (vec_size(f->locals))
{
oprintf("%s%i locals:\n", ind, (int)vec_size(f->locals));
{
size_t i;
oprintf("%s:%s\n", ind, b->label);
- platform_strncat(ind, "\t", IND_BUFSZ-1);
+ util_strncat(ind, "\t", IND_BUFSZ-1);
if (b->instr && b->instr[0])
oprintf("%s (%i) [entry]\n", ind, (int)(b->instr[0]->eid-1));
return;
}
- platform_strncat(ind, "\t", IND_BUFSZ-1);
+ util_strncat(ind, "\t", IND_BUFSZ-1);
if (in->_ops[0] && (in->_ops[1] || in->_ops[2])) {
ir_value_dump(in->_ops[0], oprintf);