X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbemain.c;h=74f8294e32c16db909b5e41f5c1dfa0d30e23705;hb=40db13dafa724caf3f38f76539cf107cd4c1a376;hp=6f626333421d26955957c3d2ec5f605e933a07c0;hpb=08bbce22c14cb73b1550debc6754228b0cc5a14d;p=libfirm diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 6f6263334..74f8294e3 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -33,7 +33,7 @@ #include "obst.h" #include "bitset.h" - +#include "statev.h" #include "irprog.h" #include "irgopt.h" #include "irgraph.h" @@ -456,7 +456,6 @@ static void initialize_birg(be_irg_t *birg, ir_graph *irg, be_main_env_t *env) irg->be_data = birg; memset(birg, 0, sizeof(*birg)); - birg->irg = irg; birg->main_env = env; obstack_init(&birg->obst); birg->lv = be_liveness_new(irg); @@ -481,7 +480,6 @@ static void initialize_birg(be_irg_t *birg, ir_graph *irg, be_main_env_t *env) /* Ensure, that the ir_edges are computed. */ assure_edges(irg); - add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_BACKEND); be_info_init_irg(irg); dump(DUMP_INITIAL, irg, "prepared"); @@ -496,7 +494,6 @@ static const char *get_timer_name(be_timer_id_t id) case T_CODEGEN: return "codegen"; case T_RA_PREPARATION: return "ra_preparation"; case T_SCHED: return "sched"; - case T_SPLIT: return "split"; case T_CONSTR: return "constr"; case T_FINISH: return "finish"; case T_EMIT: return "emit"; @@ -506,7 +503,6 @@ static const char *get_timer_name(be_timer_id_t id) case T_LIVE: return "live"; case T_EXECFREQ: return "execfreq"; case T_SSA_CONSTR: return "ssa_constr"; - case T_RA_PROLOG: return "ra_prolog"; case T_RA_EPILOG: return "ra_epilog"; case T_RA_CONSTR: return "ra_constr"; case T_RA_SPILL: return "ra_spill"; @@ -631,10 +627,11 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) } /* For all graphs */ - for (i = 0; i < num_birgs; ++i) { - be_irg_t *birg = &birgs[i]; - ir_graph *irg = birg->irg; - optimization_state_t state; + for (i = 0; i < num_irgs; ++i) { + ir_graph *const irg = get_irp_irg(i); + ir_entity *const entity = get_irg_entity(irg); + if (get_entity_linkage(entity) & IR_LINKAGE_NO_CODEGEN) + continue; /* set the current graph (this is important for several firm functions) */ current_ir_graph = irg; @@ -658,7 +655,8 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) be_timer_pop(T_VERIFY); /* get a code generator for this graph. */ - arch_env->impl->init_graph(irg); + if (arch_env->impl->init_graph) + arch_env->impl->init_graph(irg); /* some transformations need to be done before abi introduce */ if (arch_env->impl->before_abi != NULL) @@ -712,6 +710,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) /* introduce patterns to assure constraints */ be_timer_push(T_CONSTR); /* we switch off optimizations here, because they might cause trouble */ + optimization_state_t state; save_optimization_state(&state); set_optimize(0); set_opt_cse(0); @@ -789,12 +788,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) dump(DUMP_FINAL, irg, "end"); - if (!arch_env->custom_abi) { - be_timer_push(T_ABI); - be_abi_free(irg); - be_timer_pop(T_ABI); - } - restore_optimization_state(&state); be_timer_pop(T_OTHER);