X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast2firm.c;h=e41150c5141db76995c27b180f5394b628ce15de;hb=5de879168ae94a7bca2e3d7a0bec4de4345e4737;hp=702730e048857f163d9535040ae42a9163f80498;hpb=1ebec24529279490893d3aab77ee82d3673edba1;p=cparser diff --git a/ast2firm.c b/ast2firm.c index 702730e..e41150c 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -129,7 +129,7 @@ static void enqueue_inner_function(entity_t *entity) ARR_APP1(entity_t*, inner_functions, entity); } -ir_node *uninitialized_local_var(ir_graph *irg, ir_mode *mode, int pos) +static ir_node *uninitialized_local_var(ir_graph *irg, ir_mode *mode, int pos) { const entity_t *entity = get_irg_loc_description(irg, pos); @@ -1763,7 +1763,7 @@ static ir_node *process_builtin_call(const call_expression_t *call) type_t *type = skip_typeref(builtin->base.type); assert(is_type_pointer(type)); - type_t *function_type = skip_typeref(type->pointer.points_to); + type_t *function_type = skip_typeref(type->pointer.points_to); switch (builtin->entity->function.btk) { case bk_gnu_builtin_alloca: { @@ -1832,7 +1832,6 @@ static ir_node *process_builtin_call(const call_expression_t *call) } } case bk_gnu_builtin_return_address: { - expression_t *const expression = call->arguments->expression; ir_node *in[2]; @@ -1963,6 +1962,7 @@ static ir_node *call_expression_to_firm(const call_expression_t *const call) return process_builtin_call(call); } +#if 0 if (irentity == rts_entities[rts_alloca]) { /* handle alloca() call */ expression_t *argument = call->arguments->expression; @@ -1980,6 +1980,7 @@ static ir_node *call_expression_to_firm(const call_expression_t *const call) return res; } +#endif } } ir_node *callee = expression_to_firm(function); @@ -4272,7 +4273,7 @@ static void create_dynamic_initializer_sub(ir_initializer_t *initializer, return; } case IR_INITIALIZER_COMPOUND: { - assert(is_compound_type(type)); + assert(is_compound_type(type) || is_Array_type(type)); int n_members; if (is_Array_type(type)) { assert(has_array_upper_bound(type, 0)); @@ -5934,7 +5935,7 @@ static void create_function(entity_t *entity) set_type_size_bytes(frame_type, offset); set_type_alignment_bytes(frame_type, align_all); - irg_vrfy(irg); + irg_verify(irg, VERIFY_ENFORCE_SSA); current_function = old_current_function; if (current_trampolines != NULL) { @@ -6078,6 +6079,7 @@ void translation_unit_to_firm(translation_unit_t *unit) { /* initialize firm arithmetic */ tarval_set_integer_overflow_mode(TV_OVERFLOW_WRAP); + ir_set_uninitialized_local_variable_func(uninitialized_local_var); /* just to be sure */ continue_label = NULL;