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

Luca Barbieri luca at luca-barbieri.com
Mon Sep 6 20:52:07 PDT 2010


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.

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 */
-- 
1.7.0.4



More information about the mesa-dev mailing list