Remove the attribute const arch_env_t *arch_env from struct ia32_code_gen_t. We...
[libfirm] / ir / be / benode.c
index feef784..2f4c3f0 100644 (file)
@@ -27,9 +27,7 @@
  * Backend node support for generic backend nodes.
  * This file provides Perm, Copy, Spill and Reload nodes.
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdlib.h>
 
@@ -1031,20 +1029,19 @@ int be_get_IncSP_align(const ir_node *irn)
        return a->align;
 }
 
-ir_node *be_spill(const arch_env_t *arch_env, ir_node *block, ir_node *irn)
+ir_node *be_spill(ir_node *block, ir_node *irn)
 {
        ir_graph                    *irg       = get_irn_irg(block);
        ir_node                     *frame     = get_irg_frame(irg);
        const arch_register_class_t *cls       = arch_get_irn_reg_class(irn, -1);
        const arch_register_class_t *cls_frame = arch_get_irn_reg_class(frame, -1);
        ir_node                     *spill;
-       (void)arch_env;
 
        spill = be_new_Spill(cls, cls_frame, irg, block, frame, irn);
        return spill;
 }
 
-ir_node *be_reload(const arch_env_t *arch_env, const arch_register_class_t *cls, ir_node *insert, ir_mode *mode, ir_node *spill)
+ir_node *be_reload(const arch_register_class_t *cls, ir_node *insert, ir_mode *mode, ir_node *spill)
 {
        ir_node  *reload;
        ir_node  *bl    = is_Block(insert) ? insert : get_nodes_block(insert);
@@ -1057,7 +1054,7 @@ ir_node *be_reload(const arch_env_t *arch_env, const arch_register_class_t *cls,
        reload = be_new_Reload(cls, cls_frame, irg, bl, frame, spill, mode);
 
        if (is_Block(insert)) {
-               insert = sched_skip(insert, 0, sched_skip_cf_predicator, (void *) arch_env);
+               insert = sched_skip(insert, 0, sched_skip_cf_predicator, NULL);
                sched_add_after(insert, reload);
        } else {
                sched_add_before(insert, reload);
@@ -1252,9 +1249,8 @@ typedef struct {
        arch_irn_flags_t       flags;
 } phi_attr_t;
 
-struct {
-       arch_env_t  *arch_env;
-       pmap        *phi_attrs;
+static struct {
+       pmap *phi_attrs;
 } phi_handler;
 
 #define get_phi_handler_from_ops(h)      container_of(h, phi_handler_t, irn_ops)
@@ -1343,11 +1339,9 @@ const arch_register_req_t *phi_get_irn_reg_req(const ir_node *irn, int pos)
        return &attr->req;
 }
 
-void be_set_phi_reg_req(const arch_env_t *arch_env, ir_node *node,
-                        const arch_register_req_t *req)
+void be_set_phi_reg_req(ir_node *node, const arch_register_req_t *req)
 {
        phi_attr_t *attr;
-       (void) arch_env;
 
        assert(mode_is_datab(get_irn_mode(node)));
 
@@ -1355,11 +1349,9 @@ void be_set_phi_reg_req(const arch_env_t *arch_env, ir_node *node,
        memcpy(&attr->req, req, sizeof(req[0]));
 }
 
-void be_set_phi_flags(const arch_env_t *arch_env, ir_node *node,
-                      arch_irn_flags_t flags)
+void be_set_phi_flags(ir_node *node, arch_irn_flags_t flags)
 {
        phi_attr_t *attr;
-       (void) arch_env;
 
        assert(mode_is_datab(get_irn_mode(node)));
 
@@ -1433,9 +1425,8 @@ static const arch_irn_ops_t phi_irn_ops = {
        NULL,    /* perform_memory_operand  */
 };
 
-void be_phi_handler_new(be_main_env_t *env)
+void be_phi_handler_new(void)
 {
-       phi_handler.arch_env  = env->arch_env;
        phi_handler.phi_attrs = pmap_create();
        op_Phi->ops.be_ops    = &phi_irn_ops;
 }