From 6192434ac3bf621d600515589552100c8f5b8418 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 8 Apr 2010 13:40:52 -0700 Subject: [PATCH] Add inlining support for array dereferences. --- ir_function_inlining.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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); } } -- 2.30.2