Commit 8162ac73 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Move 'be_create_reg_req()' from benode to bearch.

parent afd6d427
......@@ -158,6 +158,19 @@ int be_default_is_valid_clobber(char const *const clobber)
return false;
}
arch_register_req_t const *be_create_reg_req(struct obstack *const obst, arch_register_t const *const reg, bool const ignore)
{
arch_register_class_t const *const cls = reg->cls;
unsigned *const limited = rbitset_obstack_alloc(obst, cls->n_regs);
rbitset_set(limited, reg->index);
arch_register_req_t *const req = OALLOCZ(obst, arch_register_req_t);
req->cls = cls;
req->limited = limited;
req->width = 1;
req->ignore = ignore;
return req;
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch)
void be_init_arch(void)
{
......
......@@ -388,4 +388,6 @@ void arch_copy_irn_out_info(ir_node *dst, unsigned dst_pos, ir_node const *src);
int be_default_is_valid_clobber(char const *clobber);
arch_register_req_t const *be_create_reg_req(struct obstack *obst, arch_register_t const *reg, bool ignore);
#endif
......@@ -356,22 +356,6 @@ unsigned be_get_MemPerm_entity_arity(const ir_node *irn)
return get_irn_arity(irn);
}
const arch_register_req_t *be_create_reg_req(struct obstack *obst,
const arch_register_t *reg,
bool ignore)
{
arch_register_class_t const *cls = reg->cls;
unsigned *limited
= rbitset_obstack_alloc(obst, cls->n_regs);
rbitset_set(limited, reg->index);
arch_register_req_t *req = OALLOCZ(obst, arch_register_req_t);
req->cls = cls;
req->limited = limited;
req->width = 1;
req->ignore = ignore;
return req;
}
ir_node *be_get_IncSP_pred(ir_node *irn)
{
assert(be_is_IncSP(irn));
......
......@@ -165,10 +165,6 @@ unsigned be_get_MemPerm_entity_arity(const ir_node *irn);
arch_register_req_t const **be_allocate_in_reqs(ir_graph *irg, unsigned n);
const arch_register_req_t *be_create_reg_req(struct obstack *obst,
const arch_register_t *reg,
bool ignore);
/**
* Set the register requirements for a phi node.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment