summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bearch.h
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-03-02 08:52:51 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2018-03-03 08:47:46 +0100
commit75d1c706daa017c2a04e84aae3ba73e360ca0a2e (patch)
treecc52a9d75fbf1c5069632082a2cfac998ddf42ed /ir/be/bearch.h
parent1e04ef5c3622c6ae8d205398fe42bf3a08520d9e (diff)
be: Generalize set_irn_col() to arch_set_irn_register_idx() and use it elsewhere, too.
There is no need to pass the register class as parameter, because the node knows the register class.
Diffstat (limited to 'ir/be/bearch.h')
-rw-r--r--ir/be/bearch.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ir/be/bearch.h b/ir/be/bearch.h
index 37544d5..5ecaaa8 100644
--- a/ir/be/bearch.h
+++ b/ir/be/bearch.h
@@ -393,4 +393,11 @@ arch_register_req_t *be_create_cls_req(ir_graph *irg, arch_register_class_t cons
arch_register_req_t const *be_create_reg_req(ir_graph *irg, arch_register_t const *reg, bool ignore);
+static inline void arch_set_irn_register_idx(ir_node *const irn, unsigned const idx)
+{
+ arch_register_class_t const *const cls = arch_get_irn_register_req(irn)->cls;
+ arch_register_t const *const reg = arch_register_for_index(cls, idx);
+ arch_set_irn_register(irn, reg);
+}
+
#endif