bechordal: Merge the macro chordal_has_class() and the function has_reg_class().
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 24 Nov 2012 12:23:20 +0000 (13:23 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 24 Nov 2012 12:23:20 +0000 (13:23 +0100)
ir/be/bechordal_common.c
ir/be/bechordal_common.h
ir/be/bechordal_t.h
ir/be/bessadestr.c

index e4cab1b..563fe87 100644 (file)
@@ -49,11 +49,6 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 /* Make a fourcc for border checking. */
 #define BORDER_FOURCC   FOURCC('B', 'O', 'R', 'D')
 
-int has_reg_class(const be_chordal_env_t *env, const ir_node *irn)
-{
-       return arch_irn_consider_in_reg_alloc(env->cls, irn);
-}
-
 static inline border_t *border_add(be_chordal_env_t *env, struct list_head *head,
                        ir_node *irn, unsigned step, unsigned pressure,
                        unsigned is_def, unsigned is_real)
index 1801b8c..e079f20 100644 (file)
  */
 void create_borders(ir_node *block, void *env_ptr);
 
-/**
- * Check, if an irn is of the register class currently under processing.
- * @param env The chordal environment.
- * @param irn The node.
- * @return 1, if the node is of that register class, 0 if not.
- */
-int has_reg_class(const be_chordal_env_t *env, const ir_node *irn);
-
 /**
  * Insert perm nodes
  * @param env The chordal environment.
index c547675..476583f 100644 (file)
@@ -77,8 +77,16 @@ static inline struct list_head *_get_block_border_head(const be_chordal_env_t *i
 #define border_next(b)                      (list_entry((b)->list.next, border_t, list))
 #define border_prev(b)                      (list_entry((b)->list.prev, border_t, list))
 
-#define chordal_has_class(chordal_env, irn) \
-       arch_irn_consider_in_reg_alloc(chordal_env->cls, irn)
+/**
+ * Check, if an irn is of the register class currently under processing.
+ * @param env The chordal environment.
+ * @param irn The node.
+ * @return whether the node is of that register class.
+ */
+static inline bool has_reg_class(be_chordal_env_t const *const env, ir_node const *const irn)
+{
+       return arch_irn_consider_in_reg_alloc(env->cls, irn);
+}
 
 void be_ra_chordal_color(be_chordal_env_t *chordal_env);
 
index 46a7c98..8af7c48 100644 (file)
@@ -66,7 +66,7 @@ static void clear_link(ir_node *irn, void *data)
 static void collect_phis_walker(ir_node *irn, void *data)
 {
        be_chordal_env_t *env = (be_chordal_env_t*)data;
-       if (is_Phi(irn) && chordal_has_class(env, irn)) {
+       if (is_Phi(irn) && has_reg_class(env, irn)) {
                ir_node *bl = get_nodes_block(irn);
                set_irn_link(irn, get_irn_link(bl));
                set_irn_link(bl, irn);