From 93d251251ff926718b81fd62fba88dfa66d469e9 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 5 Sep 2026 23:44:04 +0200 Subject: Generate repeat-until condition outside body scope --- gcc/gcc/elna-generic.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gcc') diff --git a/gcc/gcc/elna-generic.cc b/gcc/gcc/elna-generic.cc index fb68136..b786688 100644 --- a/gcc/gcc/elna-generic.cc +++ b/gcc/gcc/elna-generic.cc @@ -891,22 +891,22 @@ namespace elna::gcc void generic_visitor::visit(boot::repeat_statement *statement) { - enter_scope(); tree loop_label = create_artificial_label(get_location(&statement->position())); tree goto_loop = build1(GOTO_EXPR, void_type_node, loop_label); append_statement(build1(LABEL_EXPR, void_type_node, loop_label)); - for (auto *body_statement : statement->body) - { - body_statement->accept(this); - } + enter_scope(); + visit_statements(statement->body); + + tree repeat_binding = leave_scope(); + append_statement(repeat_binding); + statement->condition().accept(this); tree condition_statement = build3(COND_EXPR, void_type_node, this->current_expression, NULL_TREE, goto_loop); - append_statement(condition_statement); - tree repeat_binding = leave_scope(); - append_statement(repeat_binding); + append_statement(condition_statement); + this->current_expression = NULL_TREE; } void generic_visitor::visit(boot::for_statement *statement) -- cgit v1.2.3