From: Eric Anholt Date: Thu, 8 Apr 2010 20:40:52 +0000 (-0700) Subject: Add inlining support for array dereferences. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6192434ac3bf621d600515589552100c8f5b8418;p=mesa.git Add inlining support for array dereferences. --- diff --git a/ir_function_inlining.cpp b/ir_function_inlining.cpp index b6434b80544..40f82513095 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); } }