diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-09-07 00:22:34 +0200 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-09-13 13:03:09 -0700 |
commit | 55adbebc62a6a819a005adf48f367e7f378c7349 (patch) | |
tree | 4ccbc73c0b929052c823c8f7767999e4cd3319d2 /src | |
parent | 6b5575baaa16563f1ea1ad1821254ce6c412283f (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/ir_visitor.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glsl/ir_visitor.h b/src/glsl/ir_visitor.h index b87d737318..7dd35fe1dc 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 */ |