From: Eric Anholt Date: Thu, 8 Apr 2010 20:40:52 +0000 (-0700) Subject: Add inlining support for array dereferences. X-Git-Tag: 062012170305~10660^2~625^2~389 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6192434ac3bf621d600515589552100c8f5b8418;p=profile%2Fivi%2Fmesa.git Add inlining support for array dereferences. --- diff --git a/ir_function_inlining.cpp b/ir_function_inlining.cpp index b6434b8..40f8251 100644 --- a/ir_function_inlining.cpp +++ b/ir_function_inlining.cpp @@ -200,8 +200,21 @@ ir_function_cloning_visitor::visit(ir_dereference *ir) this->result = new ir_dereference(this->result); } + } else if (ir->mode == ir_dereference::ir_reference_array) { + ir_instruction *variable; + ir_rvalue *index; + + ir->var->accept(this); + variable = this->result; + + ir->selector.array_index->accept(this); + index = this->result->as_rvalue(); + + this->result = new ir_dereference(variable, index); } else { - this->result = NULL; + assert(ir->mode == ir_dereference::ir_reference_record); + /* FINISHME: inlining of structure references */ + assert(0); } }