Declare an additional name analysis visitor
This commit is contained in:
@ -764,7 +764,7 @@ namespace elna::gcc
|
||||
this->current_expression = NULL_TREE;
|
||||
if (!result)
|
||||
{
|
||||
error_at(declaration_location, "variable '%s' already declared in this scope",
|
||||
error_at(declaration_location, "Variable '%s' already declared in this scope",
|
||||
declaration->identifier.identifier.c_str());
|
||||
}
|
||||
else if (lang_hooks.decls.global_bindings_p())
|
||||
|
20
gcc/elna1.cc
20
gcc/elna1.cc
@ -84,16 +84,26 @@ static void elna_parse_file(const char *filename)
|
||||
{
|
||||
for (const std::unique_ptr<elna::boot::program>& module_tree : outcome.modules)
|
||||
{
|
||||
elna::boot::declaration_visitor declaration_visitor(filename, info_table);
|
||||
|
||||
elna::boot::declaration_visitor declaration_visitor(filename);
|
||||
declaration_visitor.visit(module_tree.get());
|
||||
|
||||
if (declaration_visitor.errors().empty())
|
||||
{
|
||||
elna::gcc::do_semantic_analysis(info_table, symbol_table);
|
||||
elna::boot::name_analysis_visitor name_analysis_visitor(filename, info_table,
|
||||
std::move(declaration_visitor.unresolved));
|
||||
name_analysis_visitor.visit(module_tree.get());
|
||||
|
||||
elna::gcc::generic_visitor generic_visitor{ symbol_table, info_table };
|
||||
generic_visitor.visit(module_tree.get());
|
||||
if (name_analysis_visitor.errors().empty())
|
||||
{
|
||||
elna::gcc::do_semantic_analysis(info_table, symbol_table);
|
||||
|
||||
elna::gcc::generic_visitor generic_visitor{ symbol_table, info_table };
|
||||
generic_visitor.visit(module_tree.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
elna::gcc::report_errors(name_analysis_visitor.errors());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user