From 55adbebc62a6a819a005adf48f367e7f378c7349 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Tue, 7 Sep 2010 00:22:34 +0200 Subject: [PATCH] glsl: add ir_control_flow_visitor This is just a subclass of ir_visitor with empty implementations of all the visit methods for non-control flow nodes. 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/glsl/ir_visitor.h b/src/glsl/ir_visitor.h index b87d7373180..7dd35fe1dc3 100644 --- a/src/glsl/ir_visitor.h +++ b/src/glsl/ir_visitor.h @@ -64,4 +64,21 @@ public: /*@}*/ }; +/* NOTE: function calls may never return due to discards inside them + * This is usually not an issue, but if it is, keep it in mind + */ +class ir_control_flow_visitor : public ir_visitor { +public: + virtual void visit(class ir_variable *) {} + 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 *) {} +}; + #endif /* IR_VISITOR_H */ -- 2.30.2