ia32: Clean up ia32_get_op_estimated_cost().
[libfirm] / ir / be / belistsched.c
index 142dd1b..ef60c61 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
@@ -22,7 +8,6 @@
  * @brief       Primitive list scheduling with different node selectors.
  * @author      Sebastian Hack
  * @date        20.10.2004
- * @version     $Id$
  */
 #include "config.h"
 
 
 #include "obst.h"
 #include "list.h"
-#include "iterator.h"
 
 #include "iredges_t.h"
 #include "irgwalk.h"
 #include "irnode_t.h"
 #include "irmode_t.h"
 #include "irdump.h"
-#include "irprintf_t.h"
+#include "irprintf.h"
 #include "array.h"
 #include "debug.h"
 #include "irtools.h"
 #include "belistsched.h"
 #include "bearch.h"
 #include "bestat.h"
-#include "beirg.h"
 
 #include "lc_opts.h"
 #include "lc_opts_enum.h"
 
-DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL);
+DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 
 /**
  * Scheduling environment for the whole graph.
@@ -114,7 +97,7 @@ static void add_to_sched(block_sched_env_t *env, ir_node *irn);
 static void node_ready(block_sched_env_t *env, ir_node *pred, ir_node *irn)
 {
        if (is_Proj(irn)
-           || (arch_irn_get_flags(irn) & arch_irn_flags_not_scheduled)) {
+           || (arch_get_irn_flags(irn) & arch_irn_flags_not_scheduled)) {
                selected(env, irn);
                DB((dbg, LEVEL_3, "\tmaking immediately available: %+F\n", irn));
        } else if (be_is_Keep(irn) || be_is_CopyKeep(irn)) {
@@ -165,8 +148,6 @@ static void try_make_ready(block_sched_env_t *env, ir_node *pred, ir_node *irn)
 
 static void selected(block_sched_env_t *env, ir_node *node)
 {
-       const ir_edge_t *edge;
-
        /* notify the selector about the finally selected node. */
        if (env->selector->node_selected)
                env->selector->node_selected(env->selector_block_env, node);
@@ -193,7 +174,7 @@ static void selected(block_sched_env_t *env, ir_node *node)
  */
 static void add_to_sched(block_sched_env_t *env, ir_node *irn)
 {
-       assert(! (arch_irn_get_flags(irn) & arch_irn_flags_not_scheduled));
+       assert(! (arch_get_irn_flags(irn) & arch_irn_flags_not_scheduled));
 
        sched_add_before(env->block, irn);
 
@@ -222,7 +203,6 @@ static void list_sched_block(ir_node *block, void *env_ptr)
        const list_sched_selector_t *selector = env->selector;
 
        block_sched_env_t be;
-       const ir_edge_t *edge;
        ir_nodeset_t *cands = &be.cands;
 
        /* Initialize the block's list head that will hold the schedule. */
@@ -266,6 +246,8 @@ static void list_sched_block(ir_node *block, void *env_ptr)
                add_to_sched(&be, irn);
        }
 
+       ir_nodeset_destroy(cands);
+
        if (selector->finish_block)
                selector->finish_block(be.selector_block_env);
 }
@@ -302,7 +284,7 @@ void be_list_sched_graph(ir_graph *irg, const list_sched_selector_t *selector)
        free(env.scheduled);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_listsched);
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_listsched)
 void be_init_listsched(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.sched");