+/* call related code */
+ir_instr* ir_block_create_call(ir_block *self, const char *label, ir_value *func)
+{
+ ir_value *out;
+ ir_instr *in;
+ in = ir_instr_new(self, INSTR_CALL0);
+ if (!in)
+ return NULL;
+ out = ir_value_out(self->owner, label, store_return, func->outtype);
+ if (!out) {
+ ir_instr_delete(in);
+ return NULL;
+ }
+ if (!ir_instr_op(in, 0, out, true) ||
+ !ir_instr_op(in, 1, func, false) ||
+ !ir_block_instr_add(self, in))
+ {
+ ir_instr_delete(in);
+ ir_value_delete(out);
+ return NULL;
+ }
+ return in;
+}
+
+ir_value* ir_call_value(ir_instr *self)
+{
+ return self->_ops[0];
+}
+
+bool ir_call_param(ir_instr* self, ir_value *v)
+{
+ if (!ir_instr_params_add(self, v))
+ return false;
+ if (!ir_value_reads_add(v, self)) {
+ if (!ir_instr_params_remove(self, self->params_count-1))
+ GMQCC_SUPPRESS_EMPTY_BODY;
+ return false;
+ }
+ return true;
+}
+