Generate new_bd_* instead of new_rd_* functions in the backend. The nodes are always...
[libfirm] / ir / be / besched.c
index a2d1234..0a84ac4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -23,9 +23,7 @@
  * @author      Sebastian Hack
  * @version     $Id$
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #ifdef HAVE_STDLIB_H
 # include <stdlib.h>
@@ -39,6 +37,7 @@
 #include "iredges_t.h"
 #include "ircons.h"
 #include "irextbb.h"
+#include "irgmod.h"
 #include "debug.h"
 
 #include "bemodule.h"
@@ -47,6 +46,7 @@
 #include "beutil.h"
 #include "belistsched.h"
 
+FIRM_IMPL1(have_sched_info, int, const ir_graph *)
 FIRM_IMPL1(sched_get_time_step, int, const ir_node *)
 FIRM_IMPL1(sched_has_next, int, const ir_node *)
 FIRM_IMPL1(sched_has_prev, int, const ir_node *)
@@ -55,12 +55,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(sched_add_after, ir_node *, ir_node *, ir_node *)
-FIRM_IMPL2(sched_add_before, ir_node *, ir_node *, ir_node *)
-FIRM_IMPL1_VOID(sched_init_block, ir_node *)
-FIRM_IMPL1_VOID(sched_reset, 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(sched_comes_after, int, const ir_node *, const ir_node *)
-FIRM_IMPL1_VOID(sched_remove, ir_node *)
+FIRM_IMPL1_VOID(sched_remove, const ir_node *)
 
 size_t sched_irn_data_offset = 0;
 
@@ -85,7 +85,7 @@ void be_sched_dump(FILE *f, ir_graph *irg)
 /* Init the scheduling stuff. */
 void be_init_sched(void)
 {
-       sched_irn_data_offset = register_additional_node_data(sizeof(sched_info_t));
+       sched_irn_data_offset = firm_register_additional_node_data(sizeof(sched_info_t));
 }
 
 BE_REGISTER_MODULE_CONSTRUCTOR(be_init_sched);
@@ -103,9 +103,10 @@ void sched_renumber(const ir_node *block)
        }
 }
 
-int sched_skip_cf_predicator(const ir_node *irn, void *data) {
-       arch_env_t *ae = data;
-       return arch_irn_class_is(ae, irn, branch);
+int sched_skip_cf_predicator(const ir_node *irn, void *data)
+{
+       (void)data;
+       return arch_irn_class_is(irn, branch);
 }
 
 int sched_skip_phi_predicator(const ir_node *irn, void *data) {
@@ -116,7 +117,7 @@ int sched_skip_phi_predicator(const ir_node *irn, void *data) {
 /* Skip nodes in a schedule. */
 ir_node *sched_skip(ir_node *from, int forward, sched_predicator_t *predicator, void *data)
 {
-       const ir_node *bl = get_block(from);
+       const ir_node *bl = get_block_const(from);
        ir_node *curr;
 
        if (forward) {
@@ -170,7 +171,7 @@ static void remove_dead_nodes_walker(ir_node *block, void *data)
                if(env->lv)
                        be_liveness_remove(env->lv, node);
                sched_remove(node);
-               be_kill_node(node);
+               kill_node(node);
        }
 }