[Mesa-dev] [PATCH 1/3] glsl: add ir_partial_visitor

Ian Romanick idr at freedesktop.org
Mon Sep 6 21:15:58 PDT 2010


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

Luca Barbieri wrote:
> This is just a subclass of ir_visitor with empty implementations of all
> the visit methods.
> 
> Used to avoid duplicating that in ir_visitor subclasses.

NAK.  The methods are missing intentionally.  Refer to any documentation
on the visitor design pattern.

> ir_hierarchical_visitor is another way to solve this, but is less natural
> for some applications.
> ---
>  src/glsl/ir_visitor.h |   21 +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/src/glsl/ir_visitor.h b/src/glsl/ir_visitor.h
> index b87d737..642a4cc 100644
> --- a/src/glsl/ir_visitor.h
> +++ b/src/glsl/ir_visitor.h
> @@ -64,4 +64,25 @@ public:
>     /*@}*/
>  };
>  
> +class ir_partial_visitor : public ir_visitor {
> +public:
> +   virtual void visit(class ir_variable *) {}
> +   virtual void visit(class ir_function_signature *) {}
> +   virtual void visit(class ir_function *) {}
> +   virtual void visit(class ir_expression *) {}
> +   virtual void visit(class ir_texture *) {}
> +   virtual void visit(class ir_swizzle *) {}
> +   virtual void visit(class ir_dereference_variable *) {}
> +   virtual void visit(class ir_dereference_array *) {}
> +   virtual void visit(class ir_dereference_record *) {}
> +   virtual void visit(class ir_assignment *) {}
> +   virtual void visit(class ir_constant *) {}
> +   virtual void visit(class ir_call *) {}
> +   virtual void visit(class ir_return *) {}
> +   virtual void visit(class ir_discard *) {}
> +   virtual void visit(class ir_if *) {}
> +   virtual void visit(class ir_loop *) {}
> +   virtual void visit(class ir_loop_jump *) {}
> +};
> +
>  #endif /* IR_VISITOR_H */
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyFvHoACgkQX1gOwKyEAw9KewCfR/HrGJGmQOz3N72Ici4pqibG
B1AAn2QTHkWo+uHJWnUvbhMlojjqXJUI
=YHb6
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list