ia32: Remove the ia32_x87_attr_t from ia32_asm_attr_t.
[libfirm] / ir / be / ia32 / ia32_new_nodes.c
index 3448041..c1f553c 100644 (file)
@@ -796,15 +796,12 @@ static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
 
 static void init_ia32_x87_attributes(ir_node *res)
 {
-       ir_graph        *irg      = get_irn_irg(res);
-       ia32_irg_data_t *irg_data = ia32_get_irg_data(irg);
 #ifndef NDEBUG
        ia32_attr_t *attr  = get_ia32_attr(res);
        attr->attr_type   |= IA32_ATTR_ia32_x87_attr_t;
-#else
-       (void) res;
 #endif
-       irg_data->do_x87_sim = 1;
+       ir_graph *const irg = get_irn_irg(res);
+       ia32_request_x87_sim(irg);
 }
 
 static void init_ia32_asm_attributes(ir_node *res)
@@ -812,9 +809,10 @@ static void init_ia32_asm_attributes(ir_node *res)
 #ifndef NDEBUG
        ia32_attr_t *attr  = get_ia32_attr(res);
        attr->attr_type   |= IA32_ATTR_ia32_asm_attr_t;
-#else
-       (void) res;
 #endif
+
+       ir_graph *const irg = get_irn_irg(res);
+       ia32_request_x87_sim(irg); /* asm might have fp operands. */
 }
 
 static void init_ia32_immediate_attributes(ir_node *res, ir_entity *symconst,
@@ -878,16 +876,13 @@ static void init_ia32_climbframe_attributes(ir_node *res, unsigned count)
 static void init_ia32_switch_attributes(ir_node *node,
                                         const ir_switch_table *table)
 {
-       unsigned n_outs = arch_get_irn_n_outs(node);
-       unsigned o;
-
        ia32_switch_attr_t *attr = (ia32_switch_attr_t*) get_irn_generic_attr(node);
 #ifndef NDEBUG
        attr->attr.attr_type |= IA32_ATTR_ia32_switch_attr_t;
 #endif
        attr->table = table;
 
-       for (o = 0; o < n_outs; ++o) {
+       be_foreach_out(node, o) {
                arch_set_irn_register_req_out(node, o, arch_no_register_req);
        }
 }