diff options
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/gcc/elna-generic.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/gcc/elna-generic.cc b/gcc/gcc/elna-generic.cc index 3b43f5e..60ed82b 100644 --- a/gcc/gcc/elna-generic.cc +++ b/gcc/gcc/elna-generic.cc @@ -1165,6 +1165,31 @@ namespace elna::gcc defer(leave_scope()); } + void generic_visitor::visit(boot::block_statement *statement) + { + const location_t block_location = get_location(&statement->name.position()); + tree end_label = create_artificial_label(block_location); + + enter_scope(); + this->symbols->enter(statement->name.name(), end_label); + visit_statements(statement->statements); + append_statement(leave_scope()); + + // The label sits outside the binding, so that a break leaving the block + // runs the defers registered in it. + append_statement(build1(LABEL_EXPR, void_type_node, end_label)); + this->current_expression = NULL_TREE; + } + + void generic_visitor::visit(boot::break_statement *statement) + { + tree end_label = this->symbols->lookup(statement->label.name()); + + TREE_USED(end_label) = 1; + this->current_expression = build1_loc(get_location(&statement->position()), + GOTO_EXPR, void_type_node, end_label); + } + void generic_visitor::visit(boot::empty_statement *) { } |
