case DECLARATION_KIND_ENUM_ENTRY: {
ir_mode *const mode = get_ir_mode(type);
- if (ref->is_outer_ref) {
- /* reference to an outer variable */
- panic("Outer variable reference not implemented");
- } else {
- return new_Const(mode, declaration->v.enum_val);
- }
+ return new_Const(mode, declaration->v.enum_val);
}
case DECLARATION_KIND_LOCAL_VARIABLE: {
set_irn_link(ijmp, ijmp_list);
ijmp_list = ijmp;
} else {
- if (statement->outer_fkt_jmp) {
- /* TODO: this is a outer function jmp */
- panic("outer function jump not implemented");
- } else {
- ir_node *block = get_label_block(statement->label);
- ir_node *jmp = new_Jmp();
- add_immBlock_pred(block, jmp);
- }
+ ir_node *block = get_label_block(statement->label);
+ ir_node *jmp = new_Jmp();
+ add_immBlock_pred(block, jmp);
}
set_cur_block(NULL);
}
declaration_t *last_declaration; /**< last declaration in this scope. */
scope_t *parent; /**< points to the parent scope. */
unsigned depth; /**< while parsing, the depth of this scope in the scope stack. */
- bool is_parameter; /**< Set if this scope is a parameter scope. */
};
struct expression_base_t {
struct reference_expression_t {
expression_base_t base;
declaration_t *declaration;
- bool is_outer_ref; /**< Set, if this referenced a variable
- outside of an inner function */
};
struct call_argument_t {
declaration_t *label; /**< The destination label. */
expression_t *expression; /**< The expression for an assigned goto. */
goto_statement_t *next; /**< links all goto statements of a function */
- bool outer_fkt_jmp; /**< Set if this goto jump to an outer function. */
};
struct case_label_statement_t {
if (declaration != NULL) {
declaration->scope.declarations = parameters;
declaration->scope.last_declaration = last;
- declaration->scope.is_parameter = true;
}
construct_function_type_t *construct_function_type =
assert(declaration != previous_declaration);
if (previous_declaration != NULL &&
- previous_declaration->parent_scope->is_parameter &&
+ previous_declaration->parent_scope == ¤t_function->scope &&
scope->depth == previous_declaration->parent_scope->depth + 1) {
errorf(&declaration->source_position,
"declaration '%#T' redeclares the parameter '%#T' (declared %P)",
is_type_valid(orig_type) && !is_type_function(orig_type)) {
/* access of a variable from an outer function */
declaration->address_taken = true;
- ref->is_outer_ref = true;
current_function->need_closure = true;
}
next_token();
statement->gotos.label = get_label(symbol);
-
- if (statement->gotos.label->parent_scope->depth < current_function->scope.depth) {
- statement->gotos.outer_fkt_jmp = true;
- }
}
/* remember the goto's in a list for later checking */