]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
for void returning functions we can use store_return to avoid a useless store after it
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 15:42:22 +0000 (17:42 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 15:42:22 +0000 (17:42 +0200)
ir.c

diff --git a/ir.c b/ir.c
index 26aec5c25157f7545a827184da11314405f5078a..cc0aa10078f481db03959ebf6353a4509e014082 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -1225,7 +1225,7 @@ ir_instr* ir_block_create_call(ir_block *self, const char *label, ir_value *func
     in = ir_instr_new(self, INSTR_CALL0);
     if (!in)
         return NULL;
-    out = ir_value_out(self->owner, label, store_value, func->outtype);
+    out = ir_value_out(self->owner, label, (func->outtype == TYPE_VOID) ? store_return : store_value, func->outtype);
     if (!out) {
         ir_instr_delete(in);
         return NULL;