aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc/elna-generic.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/gcc/elna-generic.cc b/gcc/gcc/elna-generic.cc
index 5749bbc..928ca8d 100644
--- a/gcc/gcc/elna-generic.cc
+++ b/gcc/gcc/elna-generic.cc
@@ -202,6 +202,28 @@ namespace elna::gcc
this->current_expression = build_constructor(record_type, tree_arguments);
}
+ void generic_visitor::visit(boot::array_constructor_expression *expression)
+ {
+ tree array_type = get_inner_alias(expression->type_decoration, this->symbols);
+
+ if (TREE_CODE(array_type) != ARRAY_TYPE)
+ {
+ this->current_expression = error_mark_node;
+ return;
+ }
+ tree domain = TYPE_DOMAIN(array_type);
+ tree index = TYPE_MIN_VALUE(domain);
+ vec<constructor_elt, va_gc> *tree_arguments = nullptr;
+
+ for (boot::expression *const element : expression->elements)
+ {
+ element->accept(this);
+ CONSTRUCTOR_APPEND_ELT(tree_arguments, index, this->current_expression);
+ index = int_const_binop(PLUS_EXPR, index, size_one_node);
+ }
+ this->current_expression = build_constructor(array_type, tree_arguments);
+ }
+
void generic_visitor::visit(boot::unit *unit)
{
for (boot::import_declaration *const declaration : unit->imports)