[Mesa-dev] [PATCH] glsl: Make ir_validate actually visit ir_if nodes.

Ian Romanick idr at freedesktop.org
Mon Aug 22 00:28:57 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/20/2011 12:37 AM, Kenneth Graunke wrote:
> 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.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>  src/glsl/ir_validate.cpp |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
> index b3ca72e..2d1c609 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",

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5SBTkACgkQX1gOwKyEAw99nwCfbI+zB1SQX4IES6+NgOd98wgn
ie0AoId9kId4u1vACj0fvni9LPKyx9yD
=SJ/I
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list