Fixed some obviously wrong conditions.
[libfirm] / ir / ir / irnode.c
index f626fd9..19a36e9 100644 (file)
@@ -288,6 +288,7 @@ void set_irn_n(ir_node *node, int n, ir_node *in) {
        assert(n < get_irn_arity(node));
        assert(in && in->kind == k_ir_node);
 
+#ifdef INTERPROCEDURAL_VIEW
        if ((n == -1) && (get_irn_opcode(node) == iro_Filter)) {
                /* Change block pred in both views! */
                node->in[n + 1] = in;
@@ -295,7 +296,6 @@ void set_irn_n(ir_node *node, int n, ir_node *in) {
                node->attr.filter.in_cg[n + 1] = in;
                return;
        }
-#ifdef INTERPROCEDURAL_VIEW
        if (get_interprocedural_view()) { /* handle Filter and Block specially */
                if (get_irn_opcode(node) == iro_Filter) {
                        assert(node->attr.filter.in_cg);
@@ -520,7 +520,6 @@ symconst_attr *get_irn_symconst_attr(ir_node *node) {
 
 call_attr *get_irn_call_attr(ir_node *node) {
        assert(is_Call(node));
-       node->attr.call.type = skip_tid(node->attr.call.type);
        return &node->attr.call;
 }
 
@@ -783,6 +782,7 @@ ir_node *get_Block_MacroBlock(const ir_node *block) {
 /* Sets the macro block header of a block. */
 void set_Block_MacroBlock(ir_node *block, ir_node *mbh) {
        assert(is_Block(block));
+       mbh = skip_Id(mbh);
        assert(is_Block(mbh));
        set_irn_n(block, -1, mbh);
 }
@@ -1145,7 +1145,6 @@ int (is_Const_all_one)(const ir_node *node) {
 ir_type *
 get_Const_type(ir_node *node) {
        assert(is_Const(node));
-       node->attr.con.tp = skip_tid(node->attr.con.tp);
        return node->attr.con.tp;
 }
 
@@ -1179,7 +1178,7 @@ get_SymConst_type(const ir_node *node) {
        ir_node *irn = (ir_node *)node;
        assert(is_SymConst(node) &&
               (SYMCONST_HAS_TYPE(get_SymConst_kind(node))));
-       return irn->attr.symc.sym.type_p = skip_tid(irn->attr.symc.sym.type_p);
+       return irn->attr.symc.sym.type_p;
 }
 
 void
@@ -1238,7 +1237,6 @@ set_SymConst_symbol(ir_node *node, union symconst_symbol sym) {
 ir_type *
 get_SymConst_value_type(ir_node *node) {
        assert(is_SymConst(node));
-       if (node->attr.symc.tp) node->attr.symc.tp = skip_tid(node->attr.symc.tp);
        return node->attr.symc.tp;
 }
 
@@ -1376,7 +1374,7 @@ set_Call_param(ir_node *node, int pos, ir_node *param) {
 ir_type *
 get_Call_type(ir_node *node) {
        assert(is_Call(node));
-       return node->attr.call.type = skip_tid(node->attr.call.type);
+       return node->attr.call.type;
 }
 
 void
@@ -1449,7 +1447,7 @@ set_Builtin_param(ir_node *node, int pos, ir_node *param) {
 ir_type *
 get_Builtin_type(ir_node *node) {
        assert(is_Builtin(node));
-       return node->attr.builtin.type = skip_tid(node->attr.builtin.type);
+       return node->attr.builtin.type;
 }
 
 void
@@ -1652,7 +1650,6 @@ void set_Conv_strict(ir_node *node, int strict_flag) {
 ir_type *
 get_Cast_type(ir_node *node) {
        assert(is_Cast(node));
-       node->attr.cast.type = skip_tid(node->attr.cast.type);
        return node->attr.cast.type;
 }
 
@@ -1978,7 +1975,7 @@ set_Alloc_size(ir_node *node, ir_node *size) {
 ir_type *
 get_Alloc_type(ir_node *node) {
        assert(is_Alloc(node));
-       return node->attr.alloc.type = skip_tid(node->attr.alloc.type);
+       return node->attr.alloc.type;
 }
 
 void
@@ -2039,7 +2036,7 @@ set_Free_size(ir_node *node, ir_node *size) {
 ir_type *
 get_Free_type(ir_node *node) {
        assert(is_Free(node));
-       return node->attr.free.type = skip_tid(node->attr.free.type);
+       return node->attr.free.type;
 }
 
 void
@@ -2372,7 +2369,7 @@ void set_CopyB_src(ir_node *node, ir_node *src) {
 
 ir_type *get_CopyB_type(ir_node *node) {
        assert(is_CopyB(node));
-       return node->attr.copyb.type = skip_tid(node->attr.copyb.type);
+       return node->attr.copyb.type;
 }
 
 void set_CopyB_type(ir_node *node, ir_type *data_type) {
@@ -2384,7 +2381,7 @@ void set_CopyB_type(ir_node *node, ir_type *data_type) {
 ir_type *
 get_InstOf_type(ir_node *node) {
        assert(node->op == op_InstOf);
-       return node->attr.instof.type = skip_tid(node->attr.instof.type);
+       return node->attr.instof.type;
 }
 
 void
@@ -2751,7 +2748,7 @@ ir_node *get_fragile_op_mem(ir_node *node) {
        case iro_Alloc :
        case iro_Bound :
        case iro_CopyB :
-               return get_irn_n(node, pn_Generic_M_regular);
+               return get_irn_n(node, pn_Generic_M);
        case iro_Bad   :
        case iro_Unknown:
                return node;