Adding a statement to statement list before pass_cfg_build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I've been trying to add a statement before the statement list before
the basic blocks are created. I am planning to add a function call
statement before a user function is called and I use the instrument
function definition as a statement . The code and the pass compiles
properly but  no function is called when the actual program runs.

Can someone hint me where I am going wrong?


static void spmm_init_function(tree *tp)
{
tree func_decl;
tree x,spmm_decl,bind;
  tree_stmt_iterator i = tsi_start (*tp);
  tree_stmt_iterator last_i;
  tree stmt=NULL;
  enum tree_code code;
    while (!tsi_end_p (i))
    {
      tree prev_stmt;

      prev_stmt = stmt;
      stmt = tsi_stmt (i);
	   code = TREE_CODE (stmt);
	  switch (code)
	  {
	  	case CALL_EXPR:
	  	print_
	  	x = implicit_built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER];
	 	x = build_call_expr (x, 0);
	 	tsi_link_after(&i,x,TSI_NEW_STMT);
	 	break;
		
	 	default:
	 	break;
	}
	tsi_next(&i);
}

}

-- 
Regards,

Saleel Kudchadker
Graduate Student
School of Computing , Informatics and Decision Systems
Arizona State University

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux