summaryrefslogtreecommitdiffhomepage
path: root/ir/be/benode.h
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.h
parent36e39904b65e1c5f726333f65350afb8758c4ade (diff)
be: Factor out common code to handle switch tables.
Diffstat (limited to 'ir/be/benode.h')
-rw-r--r--ir/be/benode.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/ir/be/benode.h b/ir/be/benode.h
index f6d38d1..1b3f7fd 100644
--- a/ir/be/benode.h
+++ b/ir/be/benode.h
@@ -39,6 +39,11 @@ typedef struct be_asm_attr_t {
void *operands;
} be_asm_attr_t;
+typedef struct be_switch_attr_t {
+ ir_switch_table const *table;
+ ir_entity const *table_entity;
+} be_switch_attr_t;
+
extern ir_op *op_be_Asm;
extern ir_op *op_be_Copy;
extern ir_op *op_be_CopyKeep;
@@ -243,4 +248,11 @@ static inline be_asm_attr_t const *get_be_asm_attr_const(ir_node const *const as
*/
void be_copy_attr(ir_graph *irg, ir_node const *old_node, ir_node *new_node);
+void be_switch_attr_init(ir_node *node, be_switch_attr_t *attr, ir_switch_table const *table, ir_entity const *table_entity);
+
+static inline int be_switch_attrs_equal(be_switch_attr_t const *const a, be_switch_attr_t const *const b)
+{
+ return a->table == b->table && a->table_entity == b->table_entity;
+}
+
#endif