ir_hierarchical_visitor::ir_hierarchical_visitor()
{
+ this->base_ir = NULL;
this->callback = NULL;
this->data = NULL;
+ this->in_assignee = false;
+}
+
+ir_visitor_status
+ir_hierarchical_visitor::visit(ir_rvalue *ir)
+{
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
+
+ return visit_continue;
}
ir_visitor_status
return visit_continue;
}
+ir_visitor_status
+ir_hierarchical_visitor::visit_enter(ir_discard *ir)
+{
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_hierarchical_visitor::visit_leave(ir_discard *ir)
+{
+ (void) ir;
+ return visit_continue;
+}
+
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_if *ir)
{
void
ir_hierarchical_visitor::run(exec_list *instructions)
{
- foreach_list(n, instructions) {
- ir_instruction *ir = (ir_instruction *) n;
-
- if (ir->accept(this) != visit_continue)
- break;
- }
+ visit_list_elements(this, instructions);
}