Allow only one return
This commit is contained in:
@ -294,6 +294,7 @@ namespace gcc
|
||||
if (definition->body != nullptr)
|
||||
{
|
||||
definition->body->accept(this);
|
||||
visit_return(definition->returning);
|
||||
tree mapping = leave_scope();
|
||||
|
||||
BLOCK_SUPERCONTEXT(BIND_EXPR_BLOCK(mapping)) = fndecl;
|
||||
@ -334,7 +335,7 @@ namespace gcc
|
||||
{
|
||||
BLOCK_SUPERCONTEXT(it) = new_block;
|
||||
}
|
||||
tree bind_expr = build3(BIND_EXPR, void_type_node, variables, chain_defer(), new_block);
|
||||
tree bind_expr = build3(BIND_EXPR, void_type_node, variables, f_binding_level->statement_list, new_block);
|
||||
this->symbol_map = this->symbol_map->scope();
|
||||
|
||||
f_binding_level = f_binding_level->level_chain;
|
||||
@ -1174,10 +1175,8 @@ namespace gcc
|
||||
}
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::return_statement *statement)
|
||||
void generic_visitor::visit_return(boot::expression *const return_expression)
|
||||
{
|
||||
boot::expression *return_expression = statement->return_expression();
|
||||
|
||||
if (return_expression == nullptr)
|
||||
{
|
||||
return;
|
||||
@ -1191,12 +1190,5 @@ namespace gcc
|
||||
|
||||
this->current_expression = NULL_TREE;
|
||||
}
|
||||
|
||||
void generic_visitor::visit(boot::defer_statement *statement)
|
||||
{
|
||||
enter_scope();
|
||||
visit_statements(statement->statements);
|
||||
defer(leave_scope());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user