moved external headers into include dir
[libfirm] / ir / be / mips / mips_scheduler.c
index 435b6cf..bd81457 100644 (file)
  * PURPOSE.
  */
 
-/* Mips implementation of list scheduler selector */
-/* $Id$ */
+/**
+ * @file
+ * @brief   Mips implementation of list scheduler selector
+ * @author  Matthias Braun, Mehdi
+ * @version $Id$
+ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -30,7 +34,7 @@
 #include "mips_scheduler.h"
 
 #include "../besched_t.h"
-#include "../be.h"
+#include "be.h"
 #include "../beabi.h"
 #include "iredges.h"
 #include "ircons.h"
@@ -197,6 +201,20 @@ static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set, nodes
 
 #endif
 
+static
+int mips_to_appear_in_schedule(void *block_env, const ir_node *node)
+{
+       if(!is_mips_irn(node))
+               return -1;
+
+       if(is_mips_zero(node))
+               return 0;
+
+       return 1;
+}
+
+list_sched_selector_t  mips_selector;
+
 /**
  * Returns the reg_pressure scheduler with to_appear_in_schedule() overloaded
  */
@@ -212,7 +230,10 @@ const list_sched_selector_t *mips_get_list_sched_selector(const void *self, list
        mips_sched_selector.finish_graph = mips_scheduler_finish_graph;
        //return &mips_sched_selector;
 #endif
-       return selector;
+       memcpy(&mips_selector, selector, sizeof(mips_selector));
+       mips_selector.to_appear_in_schedule = mips_to_appear_in_schedule;
+
+       return &mips_selector;
 }
 
 const ilp_sched_selector_t *mips_get_ilp_sched_selector(const void *self) {