summaryrefslogtreecommitdiffhomepage
path: root/ir/be/benode.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2015-08-18 22:05:36 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2015-08-19 10:17:27 +0200
commit60c29ab0b2fa158ad0d05b20e23853dfca93b8d1 (patch)
tree34ae0562008f2b6a00fde6e554706049e2e999e4 /ir/be/benode.c
parentbaeded4f6357b939b02f974000d67b20964c7668 (diff)
be: Use one common function to copy the node attributes in the backend.
All backends had identical implementations. Now rematerialization works out of the box for new backends.
Diffstat (limited to 'ir/be/benode.c')
-rw-r--r--ir/be/benode.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ir/be/benode.c b/ir/be/benode.c
index dbef7bb..d02902c 100644
--- a/ir/be/benode.c
+++ b/ir/be/benode.c
@@ -607,15 +607,8 @@ static void dump_node(FILE *f, const ir_node *irn, dump_reason_t reason)
}
}
-/**
- * ir_op-Operation:
- * Copies the backend specific attributes from old node to new node.
- */
-static void copy_attr(ir_graph *const irg, ir_node const *const old_node, ir_node *const new_node)
+void be_copy_attr(ir_graph *const irg, ir_node const *const old_node, ir_node *const new_node)
{
- assert(is_be_node(old_node));
- assert(is_be_node(new_node));
-
void const *const old_attr = get_irn_generic_attr_const(old_node);
void *const new_attr = get_irn_generic_attr(new_node);
memcpy(new_attr, old_attr, get_op_attr_size(get_irn_op(old_node)));
@@ -640,7 +633,7 @@ static ir_op *new_be_op(unsigned code, const char *name, op_pin_state p,
{
ir_op *res = new_ir_op(code, name, p, flags, opar, 0, attr_size);
set_op_dump(res, dump_node);
- set_op_copy_attr(res, copy_attr);
+ set_op_copy_attr(res, be_copy_attr);
set_op_tag(res, be_op_tag);
return res;
}