glsl2: Empty functions can be inlined.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Tilman Sauerbeck
2010-09-17 18:50:07 +02:00
committed by Kenneth Graunke
parent da3db66c08
commit 19f8f32a96

View File

@@ -63,8 +63,11 @@ can_inline(ir_call *call)
v.run((exec_list *) &callee->body);
/* If the function is empty (no last instruction) or does not end with a
* return statement, we need to count the implicit return.
*/
ir_instruction *last = (ir_instruction *)callee->body.get_tail();
if (last && !last->as_return())
if (last == NULL || !last->as_return())
v.num_returns++;
return v.num_returns == 1;