diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-09-05 23:44:04 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-09-05 23:44:04 +0200 |
| commit | 93d251251ff926718b81fd62fba88dfa66d469e9 (patch) | |
| tree | b4b06a137b1807bce4f98653ef6ec0c4a2aaa37a /gcc | |
| parent | 6eaec8726f716b2ab6b48c8cd3d7fee6aaf86977 (diff) | |
| download | elna-93d251251ff926718b81fd62fba88dfa66d469e9.tar.gz | |
Generate repeat-until condition outside body scope
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/gcc/elna-generic.cc | 16 |
1 files changed, 8 insertions, 8 deletions
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) |
