Commit 493826e2 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Assert that the register can be assigned to the given node in arch_set_irn_register{,_out}().

parent 543a4b68
......@@ -81,17 +81,23 @@ const arch_register_t *arch_get_irn_register_in(const ir_node *node, int pos)
return arch_get_irn_register(op);
}
static inline void set_out_info_reg(reg_out_info_t *const out, arch_register_t const *const reg)
{
assert(arch_reg_is_allocatable(out->req, reg));
out->reg = reg;
}
void arch_set_irn_register_out(ir_node *node, unsigned pos,
const arch_register_t *reg)
{
reg_out_info_t *out = get_out_info_n(node, pos);
out->reg = reg;
set_out_info_reg(out, reg);
}
void arch_set_irn_register(ir_node *node, const arch_register_t *reg)
{
reg_out_info_t *out = get_out_info(node);
out->reg = reg;
set_out_info_reg(out, reg);
}
bool arch_reg_is_allocatable(const arch_register_req_t *req,
......
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