print_type_ext(entity->declaration.type, entity->base.symbol,
&entity->function.parameters);
- if (entity->function.statement != NULL) {
+ if (entity->function.body != NULL) {
print_char('\n');
- print_indented_statement(entity->function.statement);
+ print_indented_statement(entity->function.body);
print_char('\n');
return;
}
case ENTITY_VARIABLE:
return entity->declaration.storage_class != STORAGE_CLASS_EXTERN;
case ENTITY_FUNCTION:
- return entity->function.statement != NULL;
+ return entity->function.body != NULL;
case ENTITY_PARAMETER:
case ENTITY_COMPOUND_MEMBER:
return false;
/* already an entity defined? */
ir_entity *irentity = entitymap_get(&entitymap, symbol);
- bool const has_body = entity->function.statement != NULL;
+ bool const has_body = entity->function.body != NULL;
if (irentity != NULL) {
goto entity_created;
}
return;
case STORAGE_CLASS_EXTERN:
if (entity->kind == ENTITY_FUNCTION) {
- assert(entity->function.statement == NULL);
+ assert(entity->function.body == NULL);
(void)get_function_entity(entity, NULL);
} else {
create_global_variable(entity);
case STORAGE_CLASS_AUTO:
case STORAGE_CLASS_REGISTER:
if (entity->kind == ENTITY_FUNCTION) {
- if (entity->function.statement != NULL) {
+ if (entity->function.body != NULL) {
ir_type *owner = get_irg_frame_type(current_ir_graph);
(void)get_function_entity(entity, owner);
entity->declaration.kind = DECLARATION_KIND_INNER_FUNCTION;
count += count_local_variables(function->parameters.entities, NULL);
/* count local variables declared in body */
- walk_statements(function->statement, count_local_variables_in_stmt, &count);
+ walk_statements(function->body, count_local_variables_in_stmt, &count);
return count;
}
assert(entity->kind == ENTITY_FUNCTION);
ir_entity *function_entity = get_function_entity(entity, current_outer_frame);
- if (entity->function.statement == NULL)
+ if (entity->function.body == NULL)
return;
inner_functions = NULL;
initialize_function_parameters(entity);
current_static_link = entity->function.static_link;
- statement_to_firm(entity->function.statement);
+ statement_to_firm(entity->function.body);
ir_node *end_block = get_irg_end_block(irg);
builtin_kind_t btk;
scope_t parameters;
- statement_t *statement;
+ statement_t *body;
symbol_t *actual_name; /**< gnu extension __REDIRECT */
/* ast2firm info */
warn_unused_entity(WARN_UNUSED_PARAMETER, scope->entities, NULL);
}
if (is_warn_on(WARN_UNUSED_VARIABLE)) {
- walk_statements(current_function->statement, check_unused_variables,
- NULL);
+ walk_statements(current_function->body, check_unused_variables, NULL);
}
}
environment_push(parameter);
}
- if (function->statement != NULL) {
+ if (function->body != NULL) {
parser_error_multiple_definition(entity, HERE);
eat_block();
} else {
label_anchor = &label_first;
statement_t *const body = parse_compound_statement(false);
- function->statement = body;
+ function->body = body;
first_err = true;
check_labels();
check_declarations();
continue;
why = WARN_UNUSED_FUNCTION;
- s = entity->function.statement != NULL ? "defined" : "declared";
+ s = entity->function.body != NULL ? "defined" : "declared";
} else {
why = WARN_UNUSED_VARIABLE;
s = "defined";
static void prepare_main_collect2(entity_t *const entity)
{
- PUSH_SCOPE(&entity->function.statement->compound.scope);
+ PUSH_SCOPE(&entity->function.body->compound.scope);
// create call to __main
symbol_t *symbol = symbol_table_insert("__main");
expr_statement->base.source_position = builtin_source_position;
expr_statement->expression.expression = call;
- statement_t *statement = entity->function.statement;
- assert(statement->kind == STATEMENT_COMPOUND);
- compound_statement_t *compounds = &statement->compound;
+ statement_t *const body = entity->function.body;
+ assert(body->kind == STATEMENT_COMPOUND);
+ compound_statement_t *compounds = &body->compound;
expr_statement->base.next = compounds->statements;
compounds->statements = expr_statement;
return;
case ENTITY_FUNCTION:
walk_type(entity->declaration.type, env);
- if (entity->function.statement != NULL)
- walk_statement(entity->function.statement, env);
+ if (entity->function.body != NULL)
+ walk_statement(entity->function.body, env);
return;
case ENTITY_COMPOUND_MEMBER:
case ENTITY_PARAMETER:
static void write_function(const entity_t *entity)
{
- if (entity->function.statement != NULL) {
+ if (entity->function.body != NULL) {
fprintf(stderr, "Warning: can't convert function bodies (at %s)\n",
entity->base.symbol->string);
}
static void write_function(const entity_t *entity)
{
- if (entity->function.statement != NULL) {
+ if (entity->function.body != NULL) {
fprintf(stderr, "Warning: can't convert function bodies (at %s)\n",
entity->base.symbol->string);
return;