diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-07-10 17:06:21 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-07-10 17:06:21 +0200 |
| commit | b7dd49c1d5832ac7d82edba27316884ab53e614c (patch) | |
| tree | 24afc27b83974c9322088e5469d2d1894c0eb314 /gcc | |
| parent | 36440faa345bf842c348711325312c2b02e4cc23 (diff) | |
| download | elna-b7dd49c1d5832ac7d82edba27316884ab53e614c.tar.gz | |
Report if the base type of a record is not a record
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/gcc/elna-generic.cc | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/gcc/gcc/elna-generic.cc b/gcc/gcc/elna-generic.cc index a3d022d..9c8990b 100644 --- a/gcc/gcc/elna-generic.cc +++ b/gcc/gcc/elna-generic.cc @@ -253,7 +253,7 @@ namespace elna::gcc { procedure->accept(this); } - if (unit->body.has_value()) + if (unit->entry_point.has_value()) { tree declaration_type = build_function_type_list(elna_int_type_node, elna_int_type_node, @@ -282,7 +282,7 @@ namespace elna::gcc DECL_ARGUMENTS(fndecl) = chainon(DECL_ARGUMENTS(fndecl), declaration_tree); parameter_type = TREE_CHAIN(parameter_type); } - visit_statements(unit->body.value()); + visit_statements(unit->entry_point.value()); tree set_result = build2(INIT_EXPR, void_type_node, DECL_RESULT(fndecl), build_int_cst_type(integer_type_node, 0)); tree return_stmt = build1(RETURN_EXPR, void_type_node, set_result); @@ -302,11 +302,11 @@ namespace elna::gcc } } - void generic_visitor::visit(boot::procedure_declaration *definition) + void generic_visitor::visit(boot::procedure_declaration *declaration) { - tree fndecl = this->symbols->lookup(definition->identifier.name); + tree fndecl = this->symbols->lookup(declaration->identifier.name); - if (!definition->body.has_value()) + if (!declaration->body.has_value()) { return; } @@ -314,22 +314,22 @@ namespace elna::gcc DECL_STRUCT_FUNCTION(fndecl)->language = ggc_cleared_alloc<language_function>(); enter_scope(); - this->bag.enter(this->bag.lookup(definition->identifier.name)->is_procedure()->scope); + this->bag.enter(this->bag.lookup(declaration->identifier.name)->is_procedure()->scope); tree argument_chain = DECL_ARGUMENTS(fndecl); for (; argument_chain != NULL_TREE; argument_chain = TREE_CHAIN(argument_chain)) { this->symbols->enter(IDENTIFIER_POINTER(DECL_NAME(argument_chain)), argument_chain); } - for (boot::constant_declaration *const constant : definition->body.value().constants()) + for (boot::constant_declaration *const constant : declaration->body.value().constants()) { constant->accept(this); } - for (boot::variable_declaration *const variable : definition->body.value().variables()) + for (boot::variable_declaration *const variable : declaration->body.value().variables()) { variable->accept(this); } - visit_statements(definition->body.value().body()); + visit_statements(declaration->body.value().statements()); tree mapping = leave_scope(); this->bag.leave(); @@ -689,10 +689,10 @@ namespace elna::gcc } } - void generic_visitor::visit(boot::constant_declaration *definition) + void generic_visitor::visit(boot::constant_declaration *declaration) { - location_t definition_location = get_location(&definition->position()); - definition->body().accept(this); + location_t definition_location = get_location(&declaration->position()); + declaration->initializer().accept(this); if (assert_constant(definition_location)) { @@ -704,15 +704,15 @@ namespace elna::gcc return; } tree definition_tree = build_decl(definition_location, CONST_DECL, - get_identifier(definition->identifier.name.c_str()), TREE_TYPE(this->current_expression)); - auto result = this->symbols->enter(definition->identifier.name, definition_tree); + get_identifier(declaration->identifier.name.c_str()), TREE_TYPE(this->current_expression)); + auto result = this->symbols->enter(declaration->identifier.name, definition_tree); if (result) { DECL_INITIAL(definition_tree) = this->current_expression; TREE_CONSTANT(definition_tree) = 1; TREE_READONLY(definition_tree) = 1; - TREE_PUBLIC(definition_tree) = definition->identifier.exported; + TREE_PUBLIC(definition_tree) = declaration->identifier.exported; if (!lang_hooks.decls.global_bindings_p()) { @@ -724,7 +724,7 @@ namespace elna::gcc else { error_at(definition_location, "Variable '%s' already declared in this scope", - definition->identifier.name.c_str()); + declaration->identifier.name.c_str()); } this->current_expression = NULL_TREE; } @@ -743,9 +743,9 @@ namespace elna::gcc declaration_tree = declare_variable(variable_identifier.name, *variable_symbol, this->symbols); } // Set initializer if given. - if (declaration->body != nullptr) + if (declaration->initializer != nullptr) { - declaration->body->accept(this); + declaration->initializer->accept(this); if (is_assignable_from(TREE_TYPE(declaration_tree), this->current_expression)) { DECL_INITIAL(declaration_tree) = this->current_expression; @@ -1047,7 +1047,7 @@ namespace elna::gcc tree endif_label_decl = create_artificial_label(UNKNOWN_LOCATION); tree goto_endif = build1(GOTO_EXPR, void_type_node, endif_label_decl); - make_if_branch(statement->body(), goto_endif); + make_if_branch(statement->branch(), goto_endif); for (const auto branch : statement->branches) { @@ -1105,7 +1105,7 @@ namespace elna::gcc void generic_visitor::visit(boot::while_statement *statement) { - location_t prerequisite_location = get_location(&statement->body().prerequisite().position()); + location_t prerequisite_location = get_location(&statement->branch().prerequisite().position()); tree prerequisite_label_decl = build_label_decl("while_do", prerequisite_location); auto prerequisite_label_expr = build1_loc(prerequisite_location, LABEL_EXPR, void_type_node, prerequisite_label_decl); @@ -1114,7 +1114,7 @@ namespace elna::gcc tree branch_end_expression = build1_loc(UNKNOWN_LOCATION, LABEL_EXPR, void_type_node, branch_end_declaration); append_statement(prerequisite_label_expr); - make_if_branch(statement->body(), goto_check); + make_if_branch(statement->branch(), goto_check); for (const auto branch : statement->branches) { |
