diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-05-19 13:20:12 +0200 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-05-26 15:23:25 -0700 |
commit | c7b1046a9fa6da916f11fb9e43d61fd772470183 (patch) | |
tree | ccc8b84f24edbfa38b5eb2fe3c8610274a48b52c /ir_expression_flattening.cpp | |
parent | f3a002b503542fe2544025c6a42d552fdc4907c2 (diff) |
Refactor ir_dereference support for ir_visitor
Move the accept method for visitors from ir_dereference to the derived
classes.
Diffstat (limited to 'ir_expression_flattening.cpp')
-rw-r--r-- | ir_expression_flattening.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/ir_expression_flattening.cpp b/ir_expression_flattening.cpp index 9494786d4e..1e0244988a 100644 --- a/ir_expression_flattening.cpp +++ b/ir_expression_flattening.cpp @@ -70,7 +70,9 @@ public: virtual void visit(ir_function *); virtual void visit(ir_expression *); virtual void visit(ir_swizzle *); - virtual void visit(ir_dereference *); + virtual void visit(ir_dereference_variable *); + virtual void visit(ir_dereference_array *); + virtual void visit(ir_dereference_record *); virtual void visit(ir_assignment *); virtual void visit(ir_constant *); virtual void visit(ir_call *); @@ -162,11 +164,21 @@ ir_expression_flattening_visitor::visit(ir_swizzle *ir) void -ir_expression_flattening_visitor::visit(ir_dereference *ir) +ir_expression_flattening_visitor::visit(ir_dereference_variable *ir) +{ + ir->var->accept(this); +} + +void +ir_expression_flattening_visitor::visit(ir_dereference_array *ir) +{ + ir->selector.array_index->accept(this); + ir->var->accept(this); +} + +void +ir_expression_flattening_visitor::visit(ir_dereference_record *ir) { - if (ir->mode == ir_dereference::ir_reference_array) { - ir->selector.array_index->accept(this); - } ir->var->accept(this); } |