Fixed initialization of option tables
[libfirm] / ir / be / beinsn.c
index 7840410..1215cf7 100644 (file)
@@ -1,3 +1,28 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/**
+ * @file
+ * @brief       A data structure to treat nodes and node-proj collections uniformly.
+ * @author      Sebastian Hack
+ * @version     $Id$
+ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -8,6 +33,7 @@
 
 #include "besched_t.h"
 #include "beinsn_t.h"
+#include "beirg_t.h"
 #include "beabi.h"
 #include "raw_bitset.h"
 
@@ -112,9 +138,11 @@ be_insn_t *be_scan_insn(const be_insn_env_t *env, ir_node *irn)
        return insn;
 }
 
-be_insn_env_t *be_insn_env_init(be_insn_env_t *ie, const be_irg_t *birg, const arch_register_class_t *cls, struct obstack *obst)
+be_insn_env_t *be_insn_env_init(be_insn_env_t *ie, const be_irg_t *birg,
+                                const arch_register_class_t *cls,
+                                struct obstack *obst)
 {
-       ie->aenv = birg->main_env->arch_env;
+       ie->aenv = be_get_birg_arch_env(birg);
        ie->cls  = cls;
        ie->obst = obst;
        ie->ignore_colors = bitset_obstack_alloc(obst, cls->n_regs);