[Mesa-dev] [PATCH v2] glsl2: Empty functions can be inlined.

Tilman Sauerbeck tilman at code-monkey.de
Fri Sep 17 09:50:07 PDT 2010


Signed-off-by: Tilman Sauerbeck <tilman at code-monkey.de>
---
This is nicer.

 src/glsl/ir_function_can_inline.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ir_function_can_inline.cpp b/src/glsl/ir_function_can_inline.cpp
index 8bb8e0d..52af9f7 100644
--- a/src/glsl/ir_function_can_inline.cpp
+++ b/src/glsl/ir_function_can_inline.cpp
@@ -64,7 +64,7 @@ can_inline(ir_call *call)
    v.run((exec_list *) &callee->body);
 
    ir_instruction *last = (ir_instruction *)callee->body.get_tail();
-   if (last && !last->as_return())
+   if (!last || !last->as_return())
       v.num_returns++;
 
    return v.num_returns == 1;
-- 
1.7.2.3



More information about the mesa-dev mailing list