]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.c
Ignore generating a return instruction in accumulated functions, eventually we'll...
[xonotic/gmqcc.git] / ir.c
diff --git a/ir.c b/ir.c
index 9967d7d8dbd91649a62c55b69772a91fa3c6e2de..fbb79f2e6cd0e03005cb7c5167fe229279e485bc 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -1583,7 +1583,13 @@ bool ir_block_create_return(ir_block *self, lex_ctx_t ctx, ir_value *v)
     ir_instr *in;
     if (!ir_check_unreachable(self))
         return false;
+
     self->final = true;
+
+    /* can eliminate the return instructions for accumulation */
+    if (self->owner->flags & IR_FLAG_ACCUMULATE)
+        return true;
+
     self->is_return = true;
     in = ir_instr_new(ctx, self, INSTR_RETURN);
     if (!in)