summaryrefslogtreecommitdiffhomepage
path: root/ir/be/besched.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-12-02 12:11:34 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2012-12-02 12:11:34 +0100
commitfef8dc3eff6468d7d65485af8e1ac9884c504e1a (patch)
tree505c4275ba0f4738b321ff552fbf8fab52e527e9 /ir/be/besched.c
parentd7f28dfa0e3b0c117eb4234190aac91b7cc9e65c (diff)
besched: Add and use sched_replace().
Diffstat (limited to 'ir/be/besched.c')
-rw-r--r--ir/be/besched.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ir/be/besched.c b/ir/be/besched.c
index 2546ef1..197371c 100644
--- a/ir/be/besched.c
+++ b/ir/be/besched.c
@@ -143,7 +143,23 @@ void sched_remove(ir_node *irn)
info->prev = NULL;
}
+void sched_replace(ir_node *const old, ir_node *const irn)
+{
+ assert(sched_is_scheduled(old));
+ assert(!sched_is_scheduled(irn));
+
+ sched_info_t *const old_info = get_irn_sched_info(old);
+ sched_info_t *const irn_info = get_irn_sched_info(irn);
+ *irn_info = *old_info;
+ old_info->prev = NULL;
+ old_info->next = NULL;
+
+ ir_node *const prev = irn_info->prev;
+ ir_node *const next = irn_info->next;
+ get_irn_sched_info(prev)->next = irn;
+ get_irn_sched_info(next)->prev = irn;
+}
static be_module_list_entry_t *schedulers;
static schedule_func scheduler;