summaryrefslogtreecommitdiff
path: root/ir_hv_accept.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ir_hv_accept.cpp')
-rw-r--r--ir_hv_accept.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/ir_hv_accept.cpp b/ir_hv_accept.cpp
index 43422e84aa..08f5394314 100644
--- a/ir_hv_accept.cpp
+++ b/ir_hv_accept.cpp
@@ -170,18 +170,34 @@ ir_swizzle::accept(ir_hierarchical_visitor *v)
ir_visitor_status
-ir_dereference::accept(ir_hierarchical_visitor *v)
+ir_dereference_variable::accept(ir_hierarchical_visitor *v)
+{
+ return v->visit(this);
+}
+
+
+ir_visitor_status
+ir_dereference_array::accept(ir_hierarchical_visitor *v)
{
ir_visitor_status s = v->visit_enter(this);
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
- if (this->mode == ir_reference_array) {
- s = this->selector.array_index->accept(v);
- if (s != visit_continue)
- return (s == visit_continue_with_parent) ? visit_continue : s;
- }
+ s = this->selector.array_index->accept(v);
+ if (s != visit_continue)
+ return (s == visit_continue_with_parent) ? visit_continue : s;
+ s = this->var->accept(v);
+ return (s == visit_stop) ? s : v->visit_leave(this);
+}
+
+
+ir_visitor_status
+ir_dereference_record::accept(ir_hierarchical_visitor *v)
+{
+ ir_visitor_status s = v->visit_enter(this);
+ if (s != visit_continue)
+ return (s == visit_continue_with_parent) ? visit_continue : s;
s = this->var->accept(v);
return (s == visit_stop) ? s : v->visit_leave(this);