Adapted to previous commit.
[libfirm] / ir / be / besched.c
index 6b311bd..a99113e 100644 (file)
  * @author      Sebastian Hack
  * @version     $Id$
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
 
 #include "impl.h"
 #include "irprintf.h"
 #include "debug.h"
 
 #include "bemodule.h"
-#include "bearch_t.h"
-#include "besched_t.h"
+#include "bearch.h"
+#include "besched.h"
 #include "beutil.h"
 #include "belistsched.h"
+#include "belive.h"
 
 FIRM_IMPL1(have_sched_info, int, const ir_graph *)
 FIRM_IMPL1(sched_get_time_step, int, const ir_node *)
@@ -57,12 +54,12 @@ FIRM_IMPL1(sched_prev, ir_node *, const ir_node *)
 FIRM_IMPL1(sched_is_scheduled, int, const ir_node *)
 FIRM_IMPL1(sched_first, ir_node *, const ir_node *)
 FIRM_IMPL1(sched_last, ir_node *, const ir_node *)
-FIRM_IMPL2_VOID(sched_add_after, const ir_node *, const ir_node *)
-FIRM_IMPL2_VOID(sched_add_before, const ir_node *, const ir_node *)
-FIRM_IMPL1_VOID(sched_init_block, const ir_node *)
-FIRM_IMPL1_VOID(sched_reset, const ir_node *)
+FIRM_IMPL2_VOID(sched_add_after, ir_node *, ir_node *)
+FIRM_IMPL2_VOID(sched_add_before, ir_node *, ir_node *)
+FIRM_IMPL1_VOID(sched_init_block, ir_node *)
+FIRM_IMPL1_VOID(sched_remove, ir_node *)
+FIRM_IMPL1_VOID(sched_reset, ir_node *)
 FIRM_IMPL2(sched_comes_after, int, const ir_node *, const ir_node *)
-FIRM_IMPL1_VOID(sched_remove, const ir_node *)
 
 size_t sched_irn_data_offset = 0;
 
@@ -108,7 +105,7 @@ void sched_renumber(const ir_node *block)
 int sched_skip_cf_predicator(const ir_node *irn, void *data)
 {
        (void)data;
-       return arch_irn_class_is(irn, branch);
+       return is_cfop(irn);
 }
 
 int sched_skip_phi_predicator(const ir_node *irn, void *data) {
@@ -192,24 +189,3 @@ void be_remove_dead_nodes_from_schedule(be_irg_t *birg)
        // walk schedule and remove non-marked nodes
        irg_block_walk_graph(irg, remove_dead_nodes_walker, NULL, &env);
 }
-
-static void *sched_irn_init(ir_phase *ph, const ir_node *irn, void *old)
-{
-       sched_info_t *info = old ? old : phase_alloc(ph, sizeof(*info));
-
-       info->idx  = get_irn_idx(irn);
-       INIT_LIST_HEAD(&info->list);
-       info->scheduled = 0;
-       info->time_step = 0;
-       return info;
-}
-
-void be_sched_init_phase(ir_graph *irg)
-{
-       init_irg_phase(irg, PHASE_BE_SCHED, 0, sched_irn_init);
-}
-
-void be_sched_free_phase(ir_graph *irg)
-{
-       free_irg_phase(irg, PHASE_BE_SCHED);
-}