Mesa (shader-work): glsl: add ir_control_flow_visitor
Luca Barbieri
lb at kemper.freedesktop.org
Thu Sep 9 18:38:07 UTC 2010
Module: Mesa
Branch: shader-work
Commit: 54846b7423155ab7dc8e69de399553a29e0319de
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=54846b7423155ab7dc8e69de399553a29e0319de
Author: Luca Barbieri <luca at luca-barbieri.com>
Date: Tue Sep 7 00:22:34 2010 +0200
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 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/glsl/ir_visitor.h b/src/glsl/ir_visitor.h
index b87d737..7dd35fe 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 */
More information about the mesa-commit
mailing list