X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbecopyopt_t.h;h=af4642e5b9ea58c0248f1fdb2dc1659a81cf46f0;hb=5474a1c188c9d59eea2c915515980cd9cbab58d8;hp=7deb2916aa9fe3a6b378c4be2bd247d225c8409c;hpb=b6de8e65b56fb153061505d65d10548f40daf8f5;p=libfirm diff --git a/ir/be/becopyopt_t.h b/ir/be/becopyopt_t.h index 7deb2916a..af4642e5b 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)