summaryrefslogtreecommitdiffstats
path: root/ir_function_inlining.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-04-08 13:40:52 -0700
committerEric Anholt <[email protected]>2010-04-08 13:42:41 -0700
commit6192434ac3bf621d600515589552100c8f5b8418 (patch)
tree63818249c5528bad989ad9a08545d8280886e876 /ir_function_inlining.cpp
parentcad9766118d269725ef33b4e9588d674d5225010 (diff)
Add inlining support for array dereferences.
Diffstat (limited to 'ir_function_inlining.cpp')
-rw-r--r--ir_function_inlining.cpp15
1 files changed, 14 insertions, 1 deletions
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);
}
}