Remove type visiting in generic visitor
This commit is contained in:
@@ -77,7 +77,7 @@ namespace elna::gcc
|
||||
|
||||
if (!VOID_TYPE_P(TREE_VALUE(current_parameter)))
|
||||
{
|
||||
error_at(call_location, "too few arguments, expected %i, got %lu",
|
||||
error_at(call_location, "Too few arguments, expected %i, got %lu",
|
||||
list_length(TYPE_ARG_TYPES(symbol_type)) - 1, arguments.size());
|
||||
this->current_expression = error_mark_node;
|
||||
}
|
||||
@@ -1179,46 +1179,6 @@ namespace elna::gcc
|
||||
this->current_expression = NULL_TREE;
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::named_type_expression *type)
|
||||
{
|
||||
this->current_expression = TREE_TYPE(this->symbols->lookup(type->name));
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::array_type_expression *)
|
||||
{
|
||||
gcc_unreachable();
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::pointer_type_expression *type)
|
||||
{
|
||||
type->base().accept(this);
|
||||
|
||||
if (this->current_expression != NULL_TREE && this->current_expression != error_mark_node)
|
||||
{
|
||||
this->current_expression = build_global_pointer_type(this->current_expression);
|
||||
}
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::record_type_expression *)
|
||||
{
|
||||
gcc_unreachable();
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::union_type_expression *)
|
||||
{
|
||||
gcc_unreachable();
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::procedure_type_expression *)
|
||||
{
|
||||
gcc_unreachable();
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::enumeration_type_expression *)
|
||||
{
|
||||
gcc_unreachable();
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::defer_statement *statement)
|
||||
{
|
||||
enter_scope();
|
||||
|
@@ -74,7 +74,7 @@ static elna::boot::dependency elna_parse_file(dependency_state& state, const cha
|
||||
fatal_error(UNKNOWN_LOCATION, "Cannot open filename %s: %m", filename);
|
||||
}
|
||||
linemap_add(line_table, LC_ENTER, 0, filename, 1);
|
||||
elna::boot::dependency outcome = elna::boot::read_sources(entry_point, filename);
|
||||
elna::boot::dependency outcome = elna::boot::read_source(entry_point, filename);
|
||||
|
||||
if (outcome.has_errors())
|
||||
{
|
||||
@@ -92,12 +92,11 @@ static elna::boot::dependency elna_parse_file(dependency_state& state, const cha
|
||||
}
|
||||
outcome_bag.add_import(state.cache.find(sub_path)->second);
|
||||
}
|
||||
elna::boot::name_analysis_visitor name_analysis_visitor(filename, outcome_bag);
|
||||
outcome.tree->accept(&name_analysis_visitor);
|
||||
elna::boot::error_list semantic_errors = analyze_semantics(filename, outcome.tree, outcome_bag);
|
||||
|
||||
if (name_analysis_visitor.has_errors())
|
||||
if (!semantic_errors.empty())
|
||||
{
|
||||
elna::gcc::report_errors(name_analysis_visitor.errors());
|
||||
elna::gcc::report_errors(semantic_errors);
|
||||
}
|
||||
state.cache.insert({ filename, outcome_bag });
|
||||
elna::gcc::rewrite_symbol_table(module_table, state.custom);
|
||||
|
Reference in New Issue
Block a user