X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fopt_blocks.c;h=0154be69d5c30eefdfa3fa34d3e4b3b687044dc6;hb=7547cf525ad54f59d2dc3f39d4b257911c94989b;hp=5c0aa04db2dec3b9d35c8c66aa688a8e80e7611a;hpb=a1e9069afa4fa1e16e2d176bcd7905d6a1ed4677;p=libfirm diff --git a/ir/opt/opt_blocks.c b/ir/opt/opt_blocks.c index 5c0aa04db..0154be69d 100644 --- a/ir/opt/opt_blocks.c +++ b/ir/opt/opt_blocks.c @@ -63,7 +63,7 @@ struct opcode_key_t { union { long proj; /**< For Proj nodes, its proj number */ ir_entity *ent; /**< For Sel nodes, its entity */ - tarval *tv; /**< For Const nodes, its tarval */ + ir_tarval *tv; /**< For Const nodes, its tarval */ symconst_symbol sym; /**< For SymConst nodes, its symbol .*/ void *addr; /**< Alias all addresses. */ int intVal; /**< For Conv/Div nodes: strict/remainderless. */ @@ -962,7 +962,7 @@ static void partition_for_end_block(ir_node *end_block, environment_t *env) } /* collect all no-return blocks */ - end = get_irg_end(current_ir_graph); + end = get_irg_end(get_irn_irg(end_block)); for (i = get_End_n_keepalives(end) - 1; i >= 0; --i) { ir_node *ka = get_End_keepalive(end, i); ir_node *block; @@ -1081,7 +1081,7 @@ static void check_for_cf_meet(ir_node *block, void *ctx) int i, k, n; pred_t *preds; - if (block == get_irg_end_block(current_ir_graph)) { + if (block == get_irg_end_block(get_irn_irg(block))) { /* always create a partition for the end block */ partition_for_end_block(block, env); return; @@ -1198,15 +1198,11 @@ static void add_roots(ir_graph *irg, environment_t *env) /* Combines congruent end blocks into one. */ int shape_blocks(ir_graph *irg) { - ir_graph *rem; environment_t env; partition_t *part; block_t *bl; int res, n; - rem = current_ir_graph; - current_ir_graph = irg; - /* register a debug mask */ FIRM_DBG_REGISTER(dbg, "firm.opt.blocks"); @@ -1284,7 +1280,6 @@ int shape_blocks(ir_graph *irg) DEL_ARR_F(env.live_outs); del_set(env.opcode2id_map); obstack_free(&env.obst, NULL); - current_ir_graph = rem; return res; } /* shape_blocks */