summaryrefslogtreecommitdiffhomepage
path: root/ir/be/becopyopt_t.h
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2011-12-02 13:38:46 +0100
committerMatthias Braun <matze@braunis.de>2011-12-05 12:51:25 +0100
commitb741c12f11b20c9566fc8704c1f4294609991142 (patch)
tree913ba5c1977a37071c199cf06d3a49acc51ef736 /ir/be/becopyopt_t.h
parent0ba6d24830420634f69caa4c0b947bbdd8955346 (diff)
becopyilp: code cleanups
(no changes in functionality)
Diffstat (limited to 'ir/be/becopyopt_t.h')
-rw-r--r--ir/be/becopyopt_t.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/ir/be/becopyopt_t.h b/ir/be/becopyopt_t.h
index 7deb291..af4642e 100644
--- a/ir/be/becopyopt_t.h
+++ b/ir/be/becopyopt_t.h
@@ -57,8 +57,17 @@ struct copy_opt_t {
#define ASSERT_OU_AVAIL(co) assert((co)->units.next && "Representation as optimization-units not build")
#define ASSERT_GS_AVAIL(co) assert((co)->nodes && "Representation as graph not build")
-#define get_irn_col(irn) arch_register_get_index(arch_get_irn_register(irn))
-#define set_irn_col(co, irn, col) arch_set_irn_register(irn, arch_register_for_index((co)->cls, col))
+static inline unsigned get_irn_col(const ir_node *node)
+{
+ return arch_register_get_index(arch_get_irn_register(node));
+}
+
+static inline void set_irn_col(const arch_register_class_t *cls, ir_node *node,
+ unsigned color)
+{
+ const arch_register_t *reg = arch_register_for_index(cls, color);
+ arch_set_irn_register(node, reg);
+}
#define list_entry_units(lh) list_entry(lh, unit_t, units)