Support one hardcoded import

This commit is contained in:
2025-07-10 00:43:17 +02:00
parent 181b19eefe
commit f02b2c49e5
14 changed files with 210 additions and 111 deletions

View File

@ -29,16 +29,14 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "diagnostic.h"
#include "realmpfr.h"
#include "stor-layout.h"
#include "varasm.h"
#include "fold-const.h"
#include "langhooks.h"
namespace elna::gcc
{
generic_visitor::generic_visitor(std::shared_ptr<symbol_table> symbol_table,
std::shared_ptr<boot::symbol_table> info_table)
: symbols(symbol_table), info_table(info_table)
generic_visitor::generic_visitor(std::shared_ptr<symbol_table> symbol_table, elna::boot::symbol_bag bag)
: symbols(symbol_table), bag(bag)
{
}
@ -321,7 +319,7 @@ namespace elna::gcc
DECL_STRUCT_FUNCTION(fndecl)->language = ggc_cleared_alloc<language_function>();
enter_scope();
this->info_table = this->info_table->lookup(definition->identifier.identifier)->is_procedure()->symbols;
this->bag.enter(this->bag.lookup(definition->identifier.identifier)->is_procedure()->symbols);
tree argument_chain = DECL_ARGUMENTS(fndecl);
for (; argument_chain != NULL_TREE; argument_chain = TREE_CHAIN(argument_chain))
@ -339,7 +337,7 @@ namespace elna::gcc
visit_statements(definition->body.value().body());
tree mapping = leave_scope();
this->info_table = this->info_table->scope();
this->bag.leave();
BLOCK_SUPERCONTEXT(BIND_EXPR_BLOCK(mapping)) = fndecl;
DECL_INITIAL(fndecl) = BIND_EXPR_BLOCK(mapping);
@ -746,7 +744,7 @@ namespace elna::gcc
void generic_visitor::visit(boot::variable_declaration *declaration)
{
this->current_expression = get_inner_alias(
this->info_table->lookup(declaration->identifier.identifier)->is_variable()->symbol,
this->bag.lookup(declaration->identifier.identifier)->is_variable()->symbol,
this->symbols);
location_t declaration_location = get_location(&declaration->position());