X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Finstrument.c;h=9d2e76e4921b2c08e5fa0fd20e21b5ef2b851207;hb=eb47aca33f2f8c414409f3695e73277b47442334;hp=5300ec3338de1df94ffe69e297fb688688ba6ddf;hpb=16d3a8c9a3686eb1a0d05b7aa2e8690e078e9e8c;p=libfirm diff --git a/ir/ir/instrument.c b/ir/ir/instrument.c index 5300ec333..9d2e76e49 100644 --- a/ir/ir/instrument.c +++ b/ir/ir/instrument.c @@ -24,9 +24,7 @@ * @author Michael Beck * @version $Id$ */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "irgraph_t.h" #include "iredges.h" @@ -37,7 +35,8 @@ /** * Adds a Call at the beginning of the given irg. */ -void instrument_initcall(ir_graph *irg, ir_entity *ent) { +void instrument_initcall(ir_graph *irg, ir_entity *ent) +{ const ir_edge_t *edge; ir_node *initial_exec; ir_node *initial_mem; @@ -63,7 +62,7 @@ void instrument_initcall(ir_graph *irg, ir_entity *ent) { } } if (first_block == NULL) { - panic("Cannot find first block of irg %+F\n", irg); + panic("Cannot find first block of irg %+F", irg); } /* check if this block has only one predecessor */ @@ -82,19 +81,19 @@ void instrument_initcall(ir_graph *irg, ir_entity *ent) { if (need_new_block) { ir_node *blk = new_r_Block(irg, 1, &initial_exec); - set_Block_cfgpred(first_block, idx, new_r_Jmp(irg, blk)); + set_Block_cfgpred(first_block, idx, new_r_Jmp(blk)); first_block = blk; } /* place the call */ sym.entity_p = ent; - adr = new_r_SymConst(irg, start_block, mode_P_code, sym, symconst_addr_ent); + adr = new_r_SymConst(irg, mode_P_code, sym, symconst_addr_ent); - call = new_r_Call(irg, first_block, get_irg_no_mem(irg), adr, 0, NULL, get_entity_type(ent)); - new_mem = new_r_Proj(irg, first_block, call, mode_M, pn_Call_M_regular); + call = new_r_Call(first_block, get_irg_no_mem(irg), adr, 0, NULL, get_entity_type(ent)); + new_mem = new_r_Proj(call, mode_M, pn_Call_M); initial_mem = get_irg_initial_mem(irg); - edges_reroute(initial_mem, new_mem, irg); + edges_reroute(initial_mem, new_mem); /* beware: reroute routes anchor edges also, revert this */ set_irg_initial_mem(irg, initial_mem); set_Call_mem(call, initial_mem);