Mesa (master): glsl: Statically cast parameter exec_node to ir_variable.

Kenneth Graunke kwg at kemper.freedesktop.org
Mon Jan 13 19:47:31 UTC 2014


Module: Mesa
Branch: master
Commit: 02ff2a275892aa180c84fa2fbb5b44409218c0f3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=02ff2a275892aa180c84fa2fbb5b44409218c0f3

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Jan 10 16:13:54 2014 -0800

glsl: Statically cast parameter exec_node to ir_variable.

Formal function parameters are always ir_variable objects, not an
arbitrary ir_instruction.  So there's no need to dynamically cast here.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/builtin_functions.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index 5b8463a..662ff4c 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -2399,7 +2399,7 @@ builtin_builder::call(ir_function *f, ir_variable *ret, exec_list params)
    exec_list actual_params;
 
    foreach_list(node, &params) {
-      ir_variable *var = ((ir_instruction *) node)->as_variable();
+      ir_variable *var = (ir_variable *) node;
       actual_params.push_tail(var_ref(var));
    }
 




More information about the mesa-commit mailing list