-static void TEMPLATE_set_irn_reg(ir_node *irn, const arch_register_t *reg)
-{
- int pos = 0;
-
- if (is_Proj(irn)) {
- pos = TEMPLATE_translate_proj_pos(irn);
- irn = skip_Proj(irn);
- }
-
- if (is_TEMPLATE_irn(irn)) {
- const arch_register_t **slots;
-
- slots = get_TEMPLATE_slots(irn);
- slots[pos] = reg;
- }
- else {
- /* here we set the registers for the Phi nodes */
- TEMPLATE_set_firm_reg(irn, reg, cur_reg_set);
- }
-}
-
-static const arch_register_t *TEMPLATE_get_irn_reg(const ir_node *irn)
-{
- int pos = 0;
- const arch_register_t *reg = NULL;
-
- if (is_Proj(irn)) {
- pos = TEMPLATE_translate_proj_pos(irn);
- irn = skip_Proj_const(irn);
- }
-
- if (is_TEMPLATE_irn(irn)) {
- const arch_register_t * const *slots;
- slots = get_TEMPLATE_slots_const(irn);
- reg = slots[pos];
- }
- else {
- reg = TEMPLATE_get_firm_reg(irn, cur_reg_set);
- }
-
- return reg;
-}
-