X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fberaextern.c;h=0153afbd0bbc4432ac66f17c85b300f80527e7ad;hb=9e45062f03f139df6068019c3f4733d809cf9e2c;hp=8a9d45ea91e93228c18151b3dd516bff5393b67e;hpb=48bb3d05a2605481bf32b4fb20dbb41c4898e24e;p=libfirm diff --git a/ir/be/beraextern.c b/ir/be/beraextern.c index 8a9d45ea9..0153afbd0 100644 --- a/ir/be/beraextern.c +++ b/ir/be/beraextern.c @@ -58,10 +58,11 @@ alloc ::= node-nr reg-nr . #include "config.h" #endif -#ifdef WIN32 -#include -#else -#include +#ifdef HAVE_MALLOC_H + #include +#endif +#ifdef HAVE_ALLOCA_H + #include #endif #include @@ -102,7 +103,6 @@ typedef struct _var_info_t var_info_t; * Environment with all the needed stuff */ typedef struct _be_raext_env_t { - firm_dbg_module_t *dbg; arch_env_t *aenv; const arch_register_class_t *cls; ir_graph *irg; @@ -112,6 +112,7 @@ typedef struct _be_raext_env_t { set *vars; /**< contains all var_info_t */ int n_cls_vars; /**< length of the array cls_vars */ var_info_t **cls_vars; /**< only the var_infos for current cls. needed for double iterating */ + DEBUG_ONLY(firm_dbg_module_t *dbg;) } be_raext_env_t; @@ -497,7 +498,7 @@ static void extract_vars_of_cls(be_raext_env_t *raenv) { int count = 0; var_info_t *vi; - raenv->cls_vars = malloc(set_count(raenv->vars) * sizeof(*raenv->cls_vars)); + raenv->cls_vars = xmalloc(set_count(raenv->vars) * sizeof(*raenv->cls_vars)); assert(raenv->cls_vars); set_foreach(raenv->vars, vi) @@ -626,7 +627,7 @@ static void dump_affinities_walker(ir_node *irn, void *env) { /* copies have affinities */ if (arch_irn_classify(raenv->aenv, irn) == arch_irn_class_copy) { - ir_node *other = get_irn_n(irn, be_pos_Copy_orig); + ir_node *other = be_get_Copy_op(irn); if (! arch_irn_is(raenv->aenv, other, ignore)) { vi2 = get_var_info(other); @@ -938,8 +939,7 @@ static void be_ra_extern_main(const be_irg_t *bi) { raenv.aenv = env->arch_env; raenv.dom_info = be_compute_dominance_frontiers(irg); raenv.vars = new_set(compare_var_infos, 64); - raenv.dbg = firm_dbg_register("ir.be.raextern"); - firm_dbg_set_mask(raenv.dbg, DBG_LEVEL); + FIRM_DBG_REGISTER(raenv.dbg, "firm.be.raextern"); /* Insert copies for constraints */ handle_constraints(&raenv);