diff options
Diffstat (limited to 'src/glsl/opt_function_inlining.cpp')
-rw-r--r-- | src/glsl/opt_function_inlining.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/glsl/opt_function_inlining.cpp b/src/glsl/opt_function_inlining.cpp index 2e7831dcbdb..8fef358cc97 100644 --- a/src/glsl/opt_function_inlining.cpp +++ b/src/glsl/opt_function_inlining.cpp @@ -126,7 +126,7 @@ ir_call::generate_inline(ir_instruction *next_ir) parameters = new ir_variable *[num_parameters]; /* Generate storage for the return value. */ - if (this->callee->return_type) { + if (!this->callee->return_type->is_void()) { retval = new(ctx) ir_variable(this->callee->return_type, "_ret_val", ir_var_auto); next_ir->insert_before(retval); @@ -209,10 +209,7 @@ ir_call::generate_inline(ir_instruction *next_ir) } /* Now push those new instructions in. */ - foreach_iter(exec_list_iterator, iter, new_instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); - next_ir->insert_before(ir); - } + next_ir->insert_before(&new_instructions); /* Copy back the value of any 'out' parameters from the function body * variables to our own. |