aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-09-27 11:23:17 +0200
committerEugen Wissner <belka@caraus.de>2026-09-27 11:23:17 +0200
commitc57a24b9fe37e233e7ec0e2e65405738d9c09c6e (patch)
tree99b5f4dc22d27d8159c3ba76f2cf3a455ed37fb6 /gcc
parentd048b633dd02014f8bff1b512ce4d5ae2b8b7903 (diff)
downloadelna-c57a24b9fe37e233e7ec0e2e65405738d9c09c6e.tar.gz
Reuse container visiting logic
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc/elna-generic.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/gcc/gcc/elna-generic.cc b/gcc/gcc/elna-generic.cc
index 464124a..fcc4c64 100644
--- a/gcc/gcc/elna-generic.cc
+++ b/gcc/gcc/elna-generic.cc
@@ -342,10 +342,7 @@ namespace elna::gcc
void generic_visitor::visit(boot::unit *unit)
{
- for (boot::declaration *const unit_declaration : unit->declarations)
- {
- unit_declaration->accept(this);
- }
+ visit_all(this, unit->declarations);
if (unit->entry_point.has_value())
{
const std::shared_ptr<boot::procedure_info> entry_point = this->bag.lookup("")->is_procedure();
@@ -491,10 +488,7 @@ namespace elna::gcc
{
this->symbols->enter(IDENTIFIER_POINTER(DECL_NAME(argument_chain)), argument_chain);
}
- for (boot::variable_declaration *const variable : declaration->body.value().variables)
- {
- variable->accept(this);
- }
+ visit_all(this, declaration->body.value().variables);
visit_statements(declaration->body.value().statements);
if (declaration->body.value().return_expression != nullptr)
@@ -1165,10 +1159,7 @@ namespace elna::gcc
void generic_visitor::visit_block(boot::block& body)
{
this->bag.enter(body.symbols);
- for (boot::variable_declaration *const variable : body.variables)
- {
- variable->accept(this);
- }
+ visit_all(this, body.variables);
visit_statements(body.statements);
this->bag.leave();
}