Re: Adding a function call at the beginning

2009-03-12 Thread fearyourself
Thanks, after testing, I found that this performs what I need: /* Insert at the beginning */ edge e = find_edge (ENTRY_BLOCK_PTR, ENTRY_BLOCK_PTR->next_bb); basic_block newstart = split_edge(e); i = bsi_last(newstart); tree call = create_function_call(profile_begin, funcname);

Re: Adding a function call at the beginning

2009-03-12 Thread Sebastian Pop
Hi JC, On Thu, Mar 12, 2009 at 10:58, fearyourself wrote: > Dear all, > > I've been trying to add a pass that adds a function call at the > beginning of each function. However, my first solution was to simply > do something like this: > > bb = ENTRY_BLOCK_PTR ->next_bb; > i = bsi_start (bb); > tr

Adding a function call at the beginning

2009-03-12 Thread fearyourself
Dear all, I've been trying to add a pass that adds a function call at the beginning of each function. However, my first solution was to simply do something like this: bb = ENTRY_BLOCK_PTR ->next_bb; i = bsi_start (bb); tree call = create_function_call(profile_begin, funcname); bsi_insert_before(&