From: Kenneth Graunke Date: Thu, 18 Aug 2011 20:52:28 +0000 (-0700) Subject: glsl: Make ir_validate actually visit ir_if nodes. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c8ea1eed66e9da82fb2b49b1e7f6d7f6064dbc4;p=mesa.git glsl: Make ir_validate actually visit ir_if nodes. There is no ir_hierarchical_visitor::visit(ir_if *) method, since ir_if is not a leaf node. Instead, there are visit_enter and visit_leave methods. Use visit_enter arbitrarily (either would work fine, though visit_enter will catch errors sooner). Found thanks to a warning emitted by Clang. Reviewed-by: Ian Romanick Signed-off-by: Kenneth Graunke --- diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index b3ca72ef0c2..2d1c6097c57 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -59,7 +59,8 @@ public: virtual ir_visitor_status visit(ir_variable *v); virtual ir_visitor_status visit(ir_dereference_variable *ir); - virtual ir_visitor_status visit(ir_if *ir); + + virtual ir_visitor_status visit_enter(ir_if *ir); virtual ir_visitor_status visit_leave(ir_loop *ir); virtual ir_visitor_status visit_enter(ir_function *ir); @@ -102,7 +103,7 @@ ir_validate::visit(ir_dereference_variable *ir) } ir_visitor_status -ir_validate::visit(ir_if *ir) +ir_validate::visit_enter(ir_if *ir) { if (ir->condition->type != glsl_type::bool_type) { printf("ir_if condition %s type instead of bool.\n",