path: root/ir/be/bearch.h
diff options
authorChristoph Mallon <>2018-03-02 08:52:51 +0100
committerChristoph Mallon <>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')
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);