* @brief Instrumentation of graphs.
* @date 14.4.2008
* @author Michael Beck
- * @version $Id$
*/
#include "config.h"
#include "ircons.h"
#include "instrument.h"
-/**
- * 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;
int i, idx, need_new_block;
symconst_symbol sym;
- edges_assure(irg);
+ assure_edges(irg);
/* find the first block */
initial_exec = get_irg_initial_exec(irg);
adr = new_r_SymConst(irg, mode_P_code, sym, symconst_addr_ent);
call = new_r_Call(first_block, get_irg_no_mem(irg), adr, 0, NULL, get_entity_type(ent));
- new_mem = new_r_Proj(first_block, call, mode_M, pn_Call_M_regular);
+ 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);