Skip to content
Snippets Groups Projects
Commit 22dcee8d authored by Tilman Sauerbeck's avatar Tilman Sauerbeck Committed by Ian Romanick
Browse files

glsl2: Empty functions can be inlined.


Signed-off-by: default avatarTilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 19f8f32a)
parent 1b622bfb
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment