Complement r22830.
[libfirm] / ir / be / mips / bearch_mips.c
index e863c6c..70fa32d 100644 (file)
@@ -23,9 +23,7 @@
  * @author  Matthias Braun, Mehdi
  * @version $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "pseudo_irg.h"
 #include "irgwalk.h"
@@ -192,8 +190,6 @@ static arch_irn_class_t mips_classify(const ir_node *irn)
 
        if (is_cfop(irn)) {
                return arch_irn_class_branch;
-       } else if (is_mips_irn(irn)) {
-               return arch_irn_class_normal;
        }
 
        return 0;
@@ -413,13 +409,11 @@ static void *mips_cg_init(be_irg_t *birg)
 {
        const arch_env_t *arch_env = be_get_birg_arch_env(birg);
        mips_isa_t       *isa      = (mips_isa_t *) arch_env;
-       mips_code_gen_t  *cg       = xmalloc(sizeof(*cg));
-       memset(cg, 0, sizeof(*cg));
+       mips_code_gen_t  *cg       = XMALLOCZ(mips_code_gen_t);
 
        cg->impl     = &mips_code_gen_if;
        cg->irg      = be_get_birg_irg(birg);
        cg->reg_set  = new_set(mips_cmp_irn_reg_assoc, 1024);
-       cg->arch_env = arch_env;
        cg->isa      = isa;
        cg->birg     = birg;
 
@@ -466,7 +460,7 @@ static arch_env_t *mips_init(FILE *file_handle) {
                return NULL;
        inited = 1;
 
-       isa = xcalloc(1, sizeof(isa[0]));
+       isa = XMALLOC(mips_isa_t);
        memcpy(isa, &mips_isa_template, sizeof(isa[0]));
 
        be_emit_init(file_handle);
@@ -538,7 +532,7 @@ typedef struct {
 
 static void *mips_abi_init(const be_abi_call_t *call, const arch_env_t *arch_env, ir_graph *irg)
 {
-       mips_abi_env_t *env    = xmalloc(sizeof(env[0]));
+       mips_abi_env_t *env    = XMALLOC(mips_abi_env_t);
        be_abi_call_flags_t fl = be_abi_call_get_flags(call);
        env->flags             = fl.bits;
        env->irg               = irg;
@@ -662,7 +656,7 @@ static void mips_abi_epilogue(void *self, ir_node *block, ir_node **mem, pmap *r
 
        fp = new_r_Proj(irg, block, load, mode_Iu, pn_mips_lw_res);
        *mem = new_r_Proj(irg, block, load, mode_Iu, pn_mips_lw_M);
-       arch_set_irn_register(env->arch_env, fp, &mips_gp_regs[REG_FP]);
+       arch_set_irn_register(fp, &mips_gp_regs[REG_FP]);
 
        be_abi_reg_map_set(reg_map, &mips_gp_regs[REG_FP], fp);
        be_abi_reg_map_set(reg_map, &mips_gp_regs[REG_SP], sp);