Changed API a little
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Thu, 26 Jan 2006 16:25:42 +0000 (16:25 +0000)
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Thu, 26 Jan 2006 16:25:42 +0000 (16:25 +0000)
ir/be/bearch.c
ir/be/bearch.h

index 013376c..9b3303c 100644 (file)
@@ -85,8 +85,7 @@ const arch_register_req_t *arch_get_register_req(const arch_env_t *env,
   return ops->impl->get_irn_reg_req(ops, req, irn, pos);
 }
 
-int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn,
-    int pos, const arch_register_class_t *cls, bitset_t *bs)
+int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn, int pos, bitset_t *bs)
 {
   arch_register_req_t local_req;
   const arch_irn_ops_t *ops = get_irn_ops(env, irn);
@@ -98,7 +97,7 @@ int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn,
   }
 
   if(arch_register_req_is(req, limited)) {
-         req->limited(irn, pos, bs);
+         req->limited(req->limited_env, bs);
          return bitset_popcnt(bs);
   }
 
@@ -127,7 +126,7 @@ int arch_reg_is_allocatable(const arch_env_t *env, const ir_node *irn,
 
        if(arch_register_req_is(&req, limited)) {
                bitset_t *bs = bitset_alloca(req.cls->n_regs);
-               req.limited(irn, pos, bs);
+               req.limited(req.limited_env, bs);
                return bitset_is_set(bs, arch_register_get_index(reg));
        }
 
index 9c0e924..4f59173 100644 (file)
@@ -155,7 +155,7 @@ typedef struct _arch_register_req_t {
        arch_register_req_type_t type;          /**< The type of the constraint. */
        const arch_register_class_t *cls;       /**< The register class this constraint belongs to. */
 
-       void (*limited)(const ir_node *irn, int pos, bitset_t *bs);
+       void (*limited)(void *limited_env, bitset_t *bs);
                                           /**< In case of the 'limited'
                                             constraint, this function
                                             must put all allowable
@@ -163,6 +163,8 @@ typedef struct _arch_register_req_t {
                                             return the number of registers
                                             in the bitset. */
 
+       void *limited_env;                    /**< This is passed to limited. */
+
        ir_node *other;                                           /**< In case of "should be equal"
                                                                                    or should be different, this gives
                                                                                        the node to whose register this
@@ -281,15 +283,13 @@ extern int arch_is_register_operand(const arch_env_t *env,
  * @param env The environment.
  * @param irn The node.
  * @param pos The postition of the node's operand.
- * @param cls The register class.
  * @param bs  The bitset all allocatable registers shall be put into.
  *            Note, that you can also pass NULL here. If you don't,
  *            make sure, the bitset is as large as the register class
  *            has registers.
  * @return    The amount of registers allocatable for that operand.
  */
-extern int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn,
-    int pos, const arch_register_class_t *cls, bitset_t *bs);
+extern int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn, int pos, bitset_t *bs);
 
 /**
  * Check, if a register is assignable to an operand of a node.
@@ -348,8 +348,8 @@ extern arch_irn_class_t arch_irn_classify(const arch_env_t *env, const ir_node *
  */
 extern arch_irn_flags_t arch_irn_get_flags(const arch_env_t *env, const ir_node *irn);
 
-#define arch_irn_is_ignore(env, irn) \
-       (arch_irn_get_flags(env, irn) == arch_irn_flags_ignore)
+#define arch_irn_is_ignore(env, irn) 0
+       // ((arch_irn_get_flags(env, irn) & arch_irn_flags_ignore) != 0)
 
 #define arch_irn_has_reg_class(env, irn, pos, cls) \
   ((cls) == arch_get_irn_reg_class(env, irn, pos))