set names for ia32 default pns
[libfirm] / ir / be / ia32 / ia32_new_nodes.c
index e716c58..02cf29e 100644 (file)
@@ -540,6 +540,19 @@ void set_ia32_am_scale(ir_node *node, int scale) {
        attr->data.am_scale = scale;
 }
 
+void ia32_copy_am_attrs(ir_node *to, const ir_node *from)
+{
+       set_ia32_ls_mode(to, get_ia32_ls_mode(from));
+       set_ia32_am_scale(to, get_ia32_am_scale(from));
+       set_ia32_am_sc(to, get_ia32_am_sc(from));
+       if(is_ia32_am_sc_sign(from))
+               set_ia32_am_sc_sign(to);
+       add_ia32_am_offs_int(to, get_ia32_am_offs_int(from));
+       set_ia32_frame_ent(to, get_ia32_frame_ent(from));
+       if (is_ia32_use_frame(from))
+               set_ia32_use_frame(to);
+}
+
 /**
  * Sets the uses_frame flag.
  */
@@ -1002,10 +1015,9 @@ void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
                           const be_execution_unit_t ***execution_units,
                           int n_res, unsigned latency)
 {
-       ir_graph       *irg  = get_irn_irg(node);
-       struct obstack *obst = get_irg_obstack(irg);
-       ia32_attr_t    *attr = get_ia32_attr(node);
-       arch_register_t**slots;
+       ir_graph        *irg  = get_irn_irg(node);
+       struct obstack  *obst = get_irg_obstack(irg);
+       ia32_attr_t     *attr = get_ia32_attr(node);
 
        set_ia32_flags(node, flags);
        set_ia32_in_req_all(node, in_reqs);
@@ -1020,8 +1032,9 @@ void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
        attr->out_flags = NEW_ARR_D(int, obst, n_res);
        memset(attr->out_flags, 0, n_res * sizeof(attr->out_flags[0]));
 
-       attr->slots = slots = NEW_ARR_D(arch_register_t*, obst, n_res);
-       memset(slots, 0, n_res * sizeof(slots[0]));
+       attr->slots = NEW_ARR_D(const arch_register_t*, obst, n_res);
+       /* void* cast to suppress an incorrect warning on MSVC */
+       memset((void*)attr->slots, 0, n_res * sizeof(attr->slots[0]));
 }
 
 void