Skip parameter names in procedure type expressions
This commit is contained in:
@@ -21,9 +21,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "stringpool.h"
|
||||
#include "elna/gcc/elna-tree.h"
|
||||
|
||||
namespace elna
|
||||
{
|
||||
namespace gcc
|
||||
namespace elna::gcc
|
||||
{
|
||||
void init_ttree()
|
||||
{
|
||||
@@ -66,4 +64,3 @@ namespace gcc
|
||||
return symbol_table;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -19,9 +19,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "elna/gcc/elna-tree.h"
|
||||
#include "elna/gcc/elna1.h"
|
||||
|
||||
namespace elna
|
||||
{
|
||||
namespace gcc
|
||||
namespace elna::gcc
|
||||
{
|
||||
location_t get_location(const boot::position *position)
|
||||
{
|
||||
@@ -144,4 +142,3 @@ namespace gcc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,9 +34,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "fold-const.h"
|
||||
#include "langhooks.h"
|
||||
|
||||
namespace elna
|
||||
{
|
||||
namespace gcc
|
||||
namespace elna::gcc
|
||||
{
|
||||
tree get_inner_alias(const boot::type& type, std::shared_ptr<symbol_table> symbols)
|
||||
{
|
||||
@@ -317,7 +315,7 @@ namespace gcc
|
||||
tree fndecl = build_fn_decl(definition->identifier.c_str(), declaration_type);
|
||||
this->symbols->enter(definition->identifier, fndecl);
|
||||
|
||||
if (definition->heading().no_return)
|
||||
if (definition->heading().return_type.no_return)
|
||||
{
|
||||
TREE_THIS_VOLATILE(fndecl) = 1;
|
||||
}
|
||||
@@ -336,19 +334,22 @@ namespace gcc
|
||||
function_args_iterator parameter_type;
|
||||
function_args_iter_init(¶meter_type, declaration_type);
|
||||
|
||||
for (const boot::variable_declaration *parameter : definition->heading().parameters)
|
||||
std::vector<std::string>::const_iterator parameter_name = definition->parameter_names.cbegin();
|
||||
|
||||
for (std::shared_ptr<boot::type_expression> parameter : definition->heading().parameters)
|
||||
{
|
||||
tree declaration_tree = build_decl(get_location(¶meter->position()), PARM_DECL,
|
||||
get_identifier(parameter->identifier.c_str()), function_args_iter_cond(¶meter_type));
|
||||
get_identifier(parameter_name->c_str()), function_args_iter_cond(¶meter_type));
|
||||
DECL_CONTEXT(declaration_tree) = fndecl;
|
||||
DECL_ARG_TYPE(declaration_tree) = function_args_iter_cond(¶meter_type);
|
||||
|
||||
if (definition->body != nullptr)
|
||||
{
|
||||
this->symbols->enter(parameter->identifier, declaration_tree);
|
||||
this->symbols->enter(*parameter_name, declaration_tree);
|
||||
}
|
||||
argument_chain = chainon(argument_chain, declaration_tree);
|
||||
function_args_iter_next(¶meter_type);
|
||||
++parameter_name;
|
||||
}
|
||||
DECL_ARGUMENTS(fndecl) = argument_chain;
|
||||
TREE_PUBLIC(fndecl) = definition->exported;
|
||||
@@ -779,15 +780,14 @@ namespace gcc
|
||||
|
||||
for (std::size_t i = 0; i < type.parameters.size(); ++i)
|
||||
{
|
||||
boot::type_expression& parameter_type = type.parameters.at(i)->variable_type();
|
||||
parameter_type.accept(this);
|
||||
type.parameters.at(i)->accept(this);
|
||||
parameter_types[i] = this->current_expression;
|
||||
}
|
||||
tree return_type = void_type_node;
|
||||
|
||||
if (type.return_type != nullptr)
|
||||
if (type.return_type.type != nullptr)
|
||||
{
|
||||
type.return_type->accept(this);
|
||||
type.return_type.type->accept(this);
|
||||
return_type = this->current_expression;
|
||||
}
|
||||
this->current_expression = NULL_TREE;
|
||||
@@ -1226,4 +1226,3 @@ namespace gcc
|
||||
defer(leave_scope());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,9 +24,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "fold-const.h"
|
||||
#include "diagnostic-core.h"
|
||||
|
||||
namespace elna
|
||||
{
|
||||
namespace gcc
|
||||
namespace elna::gcc
|
||||
{
|
||||
bool is_pointer_type(tree type)
|
||||
{
|
||||
@@ -210,4 +208,3 @@ namespace gcc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user