X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeutil.c;h=8754f4d8f5921d94d6e247008340305647273f21;hb=afbbc0b1ccd684c4c24bfd43d0f994123245f39f;hp=a600ab730bc28ec7b04e43e4f6a744fae3976102;hpb=9e56dbf066d3698df877e2a9f78caeca29ea5a03;p=libfirm diff --git a/ir/be/beutil.c b/ir/be/beutil.c index a600ab730..8754f4d8f 100644 --- a/ir/be/beutil.c +++ b/ir/be/beutil.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -128,7 +128,9 @@ void dump_allocated_irg(arch_env_t *arch_env, ir_graph *irg, char *suffix) */ static int sched_edge_hook(FILE *F, ir_node *irn) { - if(sched_is_scheduled(irn) && sched_has_prev(irn)) { + if (is_Proj(irn)) + return 1; + if (sched_is_scheduled(irn) && sched_has_prev(irn)) { ir_node *prev = sched_prev(irn); fprintf(F, "edge:{sourcename:\""); PRINT_NODEID(irn); @@ -143,7 +145,8 @@ void dump_ir_block_graph_sched(ir_graph *irg, const char *suffix) { DUMP_NODE_EDGE_FUNC old = get_dump_node_edge_hook(); dump_consts_local(0); - set_dump_node_edge_hook(sched_edge_hook); + if (have_sched_info(irg)) + set_dump_node_edge_hook(sched_edge_hook); dump_ir_block_graph(irg, suffix); set_dump_node_edge_hook(old); } @@ -152,7 +155,8 @@ void dump_ir_extblock_graph_sched(ir_graph *irg, const char *suffix) { DUMP_NODE_EDGE_FUNC old = get_dump_node_edge_hook(); dump_consts_local(0); - set_dump_node_edge_hook(sched_edge_hook); + if (have_sched_info(irg)) + set_dump_node_edge_hook(sched_edge_hook); dump_ir_extblock_graph(irg, suffix); set_dump_node_edge_hook(old); } @@ -192,9 +196,9 @@ static void collect_phis(ir_node *irn, void *data) void be_clear_links(ir_graph *irg) { - set_using_irn_link(irg); + ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK); irg_walk_graph(irg, firm_clear_link, NULL, NULL); - clear_using_irn_link(irg); + ir_free_resources(irg, IR_RESOURCE_IRN_LINK); } void be_collect_phis(ir_graph *irg) @@ -215,28 +219,6 @@ unsigned get_num_reachable_nodes(ir_graph *irg) { return num; } -/** - * Sets all node inputs to BAD node. - */ -void be_kill_node(ir_node *irn) { - ir_graph *irg = get_irn_irg(irn); - - assert(!is_Bad(irn)); - -#ifdef DEBUG_libfirm - { - int i, first; - first = 0 - ! is_Block(irn); - - for (i = get_irn_arity(irn) - 1; i >= first; --i) { - set_irn_n(irn, i, get_irg_bad(irg)); - } - } -#endif - - edges_node_deleted(irn, irg); -} - /** * Gets the Proj with number pn from irn. */ @@ -248,7 +230,7 @@ ir_node *be_get_Proj_for_pn(const ir_node *irn, long pn) { foreach_out_edge(irn, edge) { proj = get_edge_src_irn(edge); - if (get_Proj_proj(proj) == pn) + if (is_Proj(proj) && get_Proj_proj(proj) == pn) return proj; }