ir_builder_create_call to take return type from the ir_value

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-06-29 12:55:35 +02:00
parent 5348708da4
commit 67fa4ce07b
3 changed files with 4 additions and 4 deletions

2
ast.c
View file

@ -1210,7 +1210,7 @@ bool ast_call_codegen(ast_call *self, ast_function *func, bool lvalue, ir_value
goto error; goto error;
} }
callinstr = ir_block_create_call(func->curblock, ast_function_label(func, "call"), funval, funval->outtype); callinstr = ir_block_create_call(func->curblock, ast_function_label(func, "call"), funval);
if (!callinstr) if (!callinstr)
goto error; goto error;

4
ir.c
View file

@ -1031,14 +1031,14 @@ bool ir_phi_add(ir_instr* self, ir_block *b, ir_value *v)
} }
/* call related code */ /* call related code */
ir_instr* ir_block_create_call(ir_block *self, const char *label, ir_value *func, int ot) ir_instr* ir_block_create_call(ir_block *self, const char *label, ir_value *func)
{ {
ir_value *out; ir_value *out;
ir_instr *in; ir_instr *in;
in = ir_instr_new(self, INSTR_CALL0); in = ir_instr_new(self, INSTR_CALL0);
if (!in) if (!in)
return NULL; return NULL;
out = ir_value_out(self->owner, label, store_value, ot); out = ir_value_out(self->owner, label, store_value, func->outtype);
if (!out) { if (!out) {
ir_instr_delete(in); ir_instr_delete(in);
return NULL; return NULL;

2
ir.h
View file

@ -198,7 +198,7 @@ ir_value* ir_block_create_div(ir_block*, const char *label, ir_value *l, ir_valu
ir_instr* ir_block_create_phi(ir_block*, const char *label, int vtype); ir_instr* ir_block_create_phi(ir_block*, const char *label, int vtype);
ir_value* ir_phi_value(ir_instr*); ir_value* ir_phi_value(ir_instr*);
bool GMQCC_WARN ir_phi_add(ir_instr*, ir_block *b, ir_value *v); bool GMQCC_WARN ir_phi_add(ir_instr*, ir_block *b, ir_value *v);
ir_instr* ir_block_create_call(ir_block*, const char *label, ir_value *func, int otype); ir_instr* ir_block_create_call(ir_block*, const char *label, ir_value *func);
ir_value* ir_call_value(ir_instr*); ir_value* ir_call_value(ir_instr*);
bool GMQCC_WARN ir_call_param(ir_instr*, ir_value*); bool GMQCC_WARN ir_call_param(ir_instr*, ir_value*);