the find_pointer_type interface still needs a mode because we might have pointers...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 9 Jan 2010 01:26:19 +0000 (01:26 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 9 Jan 2010 01:26:19 +0000 (01:26 +0000)
small C99 fix

[r26937]

include/libfirm/lowering.h
ir/ir/irgmod.c
ir/lower/lower_calls.c

index a4465b1..9f0c623 100644 (file)
@@ -63,7 +63,7 @@ typedef struct {
         * A function returning a pointer type for a given type.
         * If this pointer is NULL, a new pointer type is always created.
         */
-       ir_type *(*find_pointer_type)(ir_type *e_type, int alignment);
+       ir_type *(*find_pointer_type)(ir_type *e_type, ir_mode *mode, int alignment);
 
        /**
         * If the LF_SMALL_CMP_IN_REGS flag is set, this function will be called
index 2f61e62..5af1b94 100644 (file)
@@ -197,12 +197,12 @@ void part_block(ir_node *node) {
        ir_node *phi, *jmp, *next, *block;
        ir_graph *rem = current_ir_graph;
 
-       current_ir_graph = get_irn_irg(node);
-
        /* Turn off optimizations so that blocks are not merged again. */
        int rem_opt = get_opt_optimize();
        set_optimize(0);
 
+       current_ir_graph = get_irn_irg(node);
+
        /* Transform the control flow */
        old_block = get_nodes_block(node);
        mbh       = get_Block_MacroBlock(old_block);
index 6f71e0f..6eb9f88 100644 (file)
@@ -129,7 +129,7 @@ static ir_type *create_modified_mtd_type(const lower_params_t *lp, ir_type *mtp)
                                else {
                                        /* this compound will be allocated on callers stack and its
                                           address will be transmitted as a hidden parameter. */
-                                       ptr_tp = lp->find_pointer_type(res_tp, lp->def_ptr_alignment);
+                                       ptr_tp = lp->find_pointer_type(res_tp, get_modeP_data(), lp->def_ptr_alignment);
                                        params[nn_params]    = ptr_tp;
                                        param_map[nn_params] = -1 - i;
                                        ++nn_params;
@@ -164,7 +164,7 @@ static ir_type *create_modified_mtd_type(const lower_params_t *lp, ir_type *mtp)
                        res_tp = get_method_res_type(mtp, i);
 
                        if (is_compound_type(res_tp)) {
-                               params[nn_params] = lp->find_pointer_type(res_tp, lp->def_ptr_alignment);
+                               params[nn_params] = lp->find_pointer_type(res_tp, get_modeP_data(), lp->def_ptr_alignment);
                                param_map[nn_params] = -1 - i;
                                ++nn_params;
                        } else {