Several BugFixes and updates:
[libfirm] / ir / be / firm / bearch_firm.c
index 0ee753d..2a2b74d 100644 (file)
@@ -1,15 +1,32 @@
+/*
+ * 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.
+ */
 
 /**
- * ISA implementation for Firm IR nodes.
+ * @file
+ * @brief   ISA implementation for Firm IR nodes.
+ * @author  Daniel Grund
+ * @version $Id$
  */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#ifdef WITH_LIBCORE
-#include <libcore/lc_opts.h>
-#endif
-
 #include "bitset.h"
 #include "obst.h"
 
@@ -23,7 +40,7 @@
 #include "irtools.h"
 
 #include "../be_t.h"
-#include "../bearch.h"
+#include "../bearch_t.h"
 #include "../besched.h"
 #include "../beutil.h"
 #include "../beabi.h"
@@ -254,20 +271,17 @@ static void firm_get_call_abi(const void *self, ir_type *method_type, be_abi_cal
 static const arch_register_req_t firm_std_reg_req = {
   arch_register_req_type_normal,
   &reg_classes[CLS_DATAB],
-  NULL,
-  NULL
+  0,
+  0
 };
 
 static const arch_register_req_t *
-firm_get_irn_reg_req(const void *self,
-    arch_register_req_t *req, const ir_node *irn, int pos)
+firm_get_irn_reg_req(const void *self, const ir_node *irn, int pos)
 {
   if(is_firm_be_mode(get_irn_mode(irn)))
-    memcpy(req, &firm_std_reg_req, sizeof(*req));
-  else
-    req = NULL;
+         return &firm_std_reg_req;
 
-  return req;
+  return NULL;
 }
 
 struct irn_reg_assoc {
@@ -362,7 +376,7 @@ static ir_entity *firm_get_frame_entity(const void *self, const ir_node *irn)
        return NULL;
 }
 
-static void firm_set_frame_entity(const void *self, const ir_node *irn, ir_entity *ent)
+static void firm_set_frame_entity(const void *self, ir_node *irn, ir_entity *ent)
 {
 }
 
@@ -572,7 +586,7 @@ static void firm_codegen_done(void *self)
        free(self);
 }
 
-static void *firm_cg_init(const be_irg_t *birg);
+static void *firm_cg_init(be_irg_t *birg);
 
 static const arch_code_generator_if_t firm_code_gen_if = {
        firm_cg_init,
@@ -585,11 +599,11 @@ static const arch_code_generator_if_t firm_code_gen_if = {
        firm_codegen_done
 };
 
-static void *firm_cg_init(const be_irg_t *birg)
+static void *firm_cg_init(be_irg_t *birg)
 {
        firm_code_gen_t *cg = xmalloc(sizeof(*cg));
        cg->impl = &firm_code_gen_if;
-       cg->irg  = birg->irg;
+       cg->irg  = be_get_birg_irg(birg);
        return cg;
 }