- simplified
[libfirm] / ir / ir / iropt.c
index 7f36a0c..25d0cd8 100644 (file)
@@ -3954,7 +3954,7 @@ static ir_node *transform_node_Proj_Cond(ir_node *proj) {
                                /* we have a constant switch */
                                long num = get_Proj_proj(proj);
 
-                               if (num != get_Cond_defaultProj(n)) { /* we cannot optimize default Proj's yet */
+                               if (num != get_Cond_default_proj(n)) { /* we cannot optimize default Proj's yet */
                                        if (get_tarval_long(tb) == num) {
                                                /* Do NOT create a jump here, or we will have 2 control flow ops
                                                 * in a block. This case is optimized away in optimize_cf(). */
@@ -5720,7 +5720,7 @@ static ir_node *transform_node_Call(ir_node *call) {
        ident    *id;
        dbg_info *db;
        int      i, n_res, n_param;
-       variadicity var;
+       ir_variadicity var;
 
        if (! is_Proj(callee))
                return call;
@@ -5768,7 +5768,8 @@ static ir_node *transform_node_Call(ir_node *call) {
        if (var == variadicity_variadic) {
                set_method_first_variadic_param_index(ctp, get_method_first_variadic_param_index(mtp) + 1);
        }
-       set_method_calling_convention(ctp, get_method_calling_convention(mtp));
+       /* When we resolve a trampoline, the function must be called by a this-call */
+       set_method_calling_convention(ctp, get_method_calling_convention(mtp) | cc_this_call);
        set_method_additional_properties(ctp, get_method_additional_properties(mtp));
 
        adr = get_Builtin_param(callee, 1);
@@ -6001,7 +6002,7 @@ static int node_cmp_attr_Div(ir_node *a, ir_node *b) {
        const divmod_attr *ma = get_irn_divmod_attr(a);
        const divmod_attr *mb = get_irn_divmod_attr(b);
        return ma->exc.pin_state != mb->exc.pin_state ||
-                  ma->res_mode      != mb->res_mode ||
+                  ma->resmode       != mb->resmode ||
                   ma->no_remainder  != mb->no_remainder;
 }  /* node_cmp_attr_Div */
 
@@ -6010,7 +6011,7 @@ static int node_cmp_attr_DivMod(ir_node *a, ir_node *b) {
        const divmod_attr *ma = get_irn_divmod_attr(a);
        const divmod_attr *mb = get_irn_divmod_attr(b);
        return ma->exc.pin_state != mb->exc.pin_state ||
-                  ma->res_mode      != mb->res_mode;
+                  ma->resmode       != mb->resmode;
 }  /* node_cmp_attr_DivMod */
 
 /** Compares the attributes of two Mod nodes. */
@@ -6018,7 +6019,7 @@ static int node_cmp_attr_Mod(ir_node *a, ir_node *b) {
        const divmod_attr *ma = get_irn_divmod_attr(a);
        const divmod_attr *mb = get_irn_divmod_attr(b);
        return ma->exc.pin_state != mb->exc.pin_state ||
-                  ma->res_mode      != mb->res_mode;
+                  ma->resmode       != mb->resmode;
 }  /* node_cmp_attr_Mod */
 
 /** Compares the attributes of two Quot nodes. */
@@ -6026,7 +6027,7 @@ static int node_cmp_attr_Quot(ir_node *a, ir_node *b) {
        const divmod_attr *ma = get_irn_divmod_attr(a);
        const divmod_attr *mb = get_irn_divmod_attr(b);
        return ma->exc.pin_state != mb->exc.pin_state ||
-                  ma->res_mode      != mb->res_mode;
+                  ma->resmode       != mb->resmode;
 }  /* node_cmp_attr_Quot */
 
 /** Compares the attributes of two Confirm nodes. */
@@ -6090,6 +6091,14 @@ static int node_cmp_attr_ASM(ir_node *a, ir_node *b) {
        return 0;
 }  /* node_cmp_attr_ASM */
 
+/** Compares the inexistent attributes of two Dummy nodes. */
+static int node_cmp_attr_Dummy(ir_node *a, ir_node *b)
+{
+       (void) a;
+       (void) b;
+       return 1;
+}
+
 /**
  * Set the default node attribute compare operation for an ir_op_ops.
  *
@@ -6128,6 +6137,7 @@ static ir_op_ops *firm_set_default_node_cmp_attr(ir_opcode code, ir_op_ops *ops)
        CASE(Quot);
        CASE(Bound);
        CASE(Builtin);
+       CASE(Dummy);
        /* FIXME CopyB */
        default:
          /* leave NULL */;