summaryrefslogtreecommitdiff
path: root/ir_hierarchical_visitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ir_hierarchical_visitor.cpp')
-rw-r--r--ir_hierarchical_visitor.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/ir_hierarchical_visitor.cpp b/ir_hierarchical_visitor.cpp
index 63ce8784ad..0d520b127f 100644
--- a/ir_hierarchical_visitor.cpp
+++ b/ir_hierarchical_visitor.cpp
@@ -268,3 +268,17 @@ ir_hierarchical_visitor::run(exec_list *instructions)
break;
}
}
+
+
+void
+visit_tree(ir_instruction *ir,
+ void (*callback)(class ir_instruction *ir, void *data),
+ void *data)
+{
+ ir_hierarchical_visitor v;
+
+ v.callback = callback;
+ v.data = data;
+
+ ir->accept(&v);
+}