Fixed initialization of option tables
[libfirm] / ir / be / bechordal_main.c
index e42804d..d570aff 100644 (file)
@@ -1,18 +1,34 @@
-/**
- * @file   bechordal_main.c
- * @date   29.11.2005
- * @author Sebastian Hack
- * @cvs-id $Id$
+/*
+ * Copyright (C) 1995-2007 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.
  *
- * Copyright (C) 2005-2006 Universitaet Karlsruhe
- * Released under the GPL
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
  *
- * Driver for the chordal register allocator.
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief       Driver for the chordal register allocator.
+ * @author      Sebastian Hack
+ * @date        29.11.2005
+ * @version     $Id$
  */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
+#include <stdlib.h>
 #include <time.h>
 
 #include "obst.h"
@@ -41,6 +57,7 @@
 #include "debug.h"
 #include "xmalloc.h"
 #include "execfreq.h"
+#include "iredges_t.h"
 
 #include "bechordal_t.h"
 #include "beabi.h"
@@ -57,6 +74,8 @@
 #include "bestat.h"
 #include "bemodule.h"
 #include "be_t.h"
+#include "bera.h"
+#include "beirg_t.h"
 
 #include "bespillbelady.h"
 #include "bespillmorgan.h"
@@ -79,6 +98,8 @@ static be_ra_chordal_opts_t options = {
        BE_CH_DUMP_NONE,
        BE_CH_LOWER_PERM_SWAP,
        BE_CH_VRFY_WARN,
+       "",
+       ""
 };
 
 typedef struct _post_spill_env_t {
@@ -151,7 +172,7 @@ static const lc_opt_table_entry_t be_chordal_options[] = {
        LC_OPT_ENT_ENUM_PTR ("perm",          "perm lowering options", &lower_perm_var),
        LC_OPT_ENT_ENUM_MASK("dump",          "select dump phases", &dump_var),
        LC_OPT_ENT_ENUM_PTR ("vrfy",          "verify options", &be_ch_vrfy_var),
-       { NULL }
+       LC_OPT_LAST
 };
 
 static void dump(unsigned mask, ir_graph *irg,
@@ -544,6 +565,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
        be_options_t        *main_opts = main_env->options;
        int                 j, m;
        be_chordal_env_t    chordal_env;
+       struct obstack      obst;
 
        BE_TIMER_INIT(main_opts);
        BE_TIMER_PUSH(ra_timer.t_other);
@@ -552,6 +574,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
        be_assure_dom_front(birg);
        be_assure_liveness(birg);
 
+       chordal_env.obst          = &obst;
        chordal_env.opts          = &options;
        chordal_env.irg           = irg;
        chordal_env.birg          = birg;
@@ -559,7 +582,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
        chordal_env.ifg           = NULL;
        chordal_env.ignore_colors = NULL;
 
-       obstack_init(&chordal_env.obst);
+       obstack_init(&obst);
 
        BE_TIMER_POP(ra_timer.t_prolog);
 
@@ -612,8 +635,8 @@ static void be_ra_chordal_main(be_irg_t *birg)
        lower_nodes_after_ra(birg, options.lower_perm_opt & BE_CH_LOWER_PERM_COPY ? 1 : 0);
        dump(BE_CH_DUMP_LOWER, irg, NULL, "-belower-after-ra", dump_ir_block_graph_sched);
 
-       obstack_free(&chordal_env.obst, NULL);
-       be_invalidate_liveness(birg);
+       obstack_free(&obst, NULL);
+       be_liveness_invalidate(be_get_birg_liveness(birg));
        BE_TIMER_POP(ra_timer.t_epilog);
 
        BE_TIMER_POP(ra_timer.t_other);