This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

help:how to get the Nth argument stmt from CALL_EXPR stmt tree


hi,all
	
	
      I don't know how to get the Nth argument stmt  from CALL_EXPR stmt tree?

	  the GetCallArgOperands implement this function that i code ,but it isn't working :(

	  thanks any advice or piece of example code .

//////////////////////////////////////////////////////

 tree GetCallArgOperands(tree stmt ,int i){
 tree func, param, args;
 int j = 1;


  func = get_callee_fndecl (stmt);

  for (param = DECL_ARGUMENTS (func), args = TREE_OPERAND (stmt, 1);
	   param && args;
	   param = TREE_CHAIN (param), args = TREE_CHAIN (args))
 {
	  tree arg = TREE_VALUE (args);
	  if (param != arg)
	    {
		// FIXME:
	    }
	  if (j==i)
	  {
		  fprintf(stderr,"args ----------\n");
		  debug_tree(arg);
	
		  return default_def (arg); //FIXME: to stmt tree ?
	  }
	
	  j++;
 }
	  return NULL_TREE;
}
/////////////////////////////////////////////////



 				

        bugs
        bugs@whitecell.org
          2005-07-05



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]