summaryrefslogtreecommitdiffhomepage
path: root/ir/be/benode.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-11-28 10:24:18 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2016-11-28 10:43:27 +0100
commit3c638b452cb30940cb53dc140fb0ac813b9dd502 (patch)
treeec9bdc8bd30acb87309d158b76243285429e28c8 /ir/be/benode.c
parent36e39904b65e1c5f726333f65350afb8758c4ade (diff)
be: Factor out common code to handle switch tables.
Diffstat (limited to 'ir/be/benode.c')
-rw-r--r--ir/be/benode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ir/be/benode.c b/ir/be/benode.c
index b94027e..b078819 100644
--- a/ir/be/benode.c
+++ b/ir/be/benode.c
@@ -597,6 +597,15 @@ void be_copy_attr(ir_graph *const irg, ir_node const *const old_node, ir_node *c
}
}
+void be_switch_attr_init(ir_node *const node, be_switch_attr_t *const attr, ir_switch_table const *const table, ir_entity const *const table_entity)
+{
+ attr->table = table;
+ attr->table_entity = table_entity;
+ be_foreach_out(node, o) {
+ arch_set_irn_register_req_out(node, o, arch_exec_req);
+ }
+}
+
bool is_be_node(const ir_node *irn)
{
return get_op_tag(get_irn_op(irn)) == be_op_tag;