be: Remove the indirection via chordal_scan_insn() to be_scan_insn().
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 24 Nov 2012 13:00:57 +0000 (14:00 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 24 Nov 2012 13:00:57 +0000 (14:00 +0100)
ir/be/bechordal.c
ir/be/bechordal_common.c
ir/be/bechordal_common.h
ir/be/beinsn.c
ir/be/beinsn_t.h
ir/be/bepbqpcoloring.c

index 4dbc02e..b8a5982 100644 (file)
@@ -179,7 +179,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env,
        //int match_res, cost;
        be_chordal_env_t *env  = alloc_env->chordal_env;
        void *base             = obstack_base(env->obst);
-       be_insn_t *insn        = chordal_scan_insn(env, irn);
+       be_insn_t *insn        = be_scan_insn(env, irn);
        ir_node *res           = insn->next_insn;
        bipartite_t *bp;
 
index 563fe87..aafebe6 100644 (file)
@@ -205,17 +205,6 @@ void create_borders(ir_node *block, void *env_ptr)
        bitset_free(live);
 }
 
-
-be_insn_t *chordal_scan_insn(be_chordal_env_t *env, ir_node *irn)
-{
-       be_insn_env_t ie;
-
-       ie.allocatable_regs = env->allocatable_regs;
-       ie.obst             = env->obst;
-       ie.cls              = env->cls;
-       return be_scan_insn(&ie, irn);
-}
-
 ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
 {
        be_insn_t *insn       = *the_insn;
@@ -259,7 +248,7 @@ ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
         * the live sets may change.
         */
        obstack_free(env->obst, insn);
-       *the_insn = insn = chordal_scan_insn(env, insn->irn);
+       *the_insn = insn = be_scan_insn(env, insn->irn);
 
        /*
         * Copy the input constraints of the insn to the Perm as output
index e079f20..15fd9bd 100644 (file)
@@ -48,12 +48,4 @@ void create_borders(ir_node *block, void *env_ptr);
  */
 ir_node *pre_process_constraints(be_chordal_env_t *_env, be_insn_t **the_insn);
 
-/**
- * Create a be_insn_t for an IR node.
- * @param env The chordal environment.
- * @param irn The node.
- * @return the be_insn for the IR node
- */
-be_insn_t *chordal_scan_insn(be_chordal_env_t *env, ir_node *irn);
-
 #endif /* BECHORDAL_COMMON_H_ */
index 1d489b6..2d29b50 100644 (file)
 #include "irnode_t.h"
 #include "iredges.h"
 
+#include "bechordal_t.h"
 #include "besched.h"
 #include "beinsn_t.h"
 #include "beirg.h"
 #include "beabi.h"
 #include "raw_bitset.h"
 
-/**
- * Create a be_insn_t for an IR node.
- *
- * @param env      the insn construction environment
- * @param irn      the irn for which the be_insn should be build
- *
- * @return the be_insn for the IR node
- */
-be_insn_t *be_scan_insn(const be_insn_env_t *env, ir_node *irn)
+be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn)
 {
        struct obstack *obst = env->obst;
        be_operand_t o;
index 24e6138..40aca02 100644 (file)
 #include "obst.h"
 
 #include "bearch.h"
+#include "bechordal.h"
 #include "beirg.h"
 
 typedef struct be_operand_t  be_operand_t;
 typedef struct be_insn_t     be_insn_t;
-typedef struct be_insn_env_t be_insn_env_t;
 
 struct be_operand_t {
        ir_node *irn;                   /**< Firm node of the insn this operand belongs to */
@@ -59,15 +59,14 @@ struct be_insn_t {
        unsigned pre_colored     : 1;  /**< all defined values already have a register assigned */
 };
 
-struct be_insn_env_t {
-       struct obstack              *obst;
-       const arch_register_class_t *cls;
-       bitset_t                    *allocatable_regs;
-};
-
-#define be_insn_n_defs(insn) ((insn)->use_start)
-#define be_insn_n_uses(insn) ((insn)->n_ops - (insn)->use_start)
-
-be_insn_t *be_scan_insn(const be_insn_env_t *env, ir_node *irn);
+/**
+ * Create a be_insn_t for an IR node.
+ *
+ * @param env      the insn construction environment
+ * @param irn      the irn for which the be_insn should be build
+ *
+ * @return the be_insn for the IR node
+ */
+be_insn_t *be_scan_insn(be_chordal_env_t const *env, ir_node *irn);
 
 #endif /* FIRM_BE_BEINSN_T_H */
index 36dad0a..c0f5a78 100644 (file)
@@ -595,7 +595,7 @@ static void insert_perms(ir_node *block, void *data)
        ir_node          *irn;
 
        for (irn = sched_first(block); !sched_is_end(irn);) {
-               be_insn_t *insn = chordal_scan_insn(env, irn);
+               be_insn_t *insn = be_scan_insn(env, irn);
                irn             = insn->next_insn;
 
                if (!insn->has_constraints)