Пример #1
0
static type endpoint_type(endp p)
{
  type t = NULL;

  if (p->args_node)
    {
      if (p->function)
	t = type_function_return_type(p->function->type);
      else if (p->interface)
	t = p->interface->type;
    }
  else
    {
      if (p->function)
	t = p->function->type;
      else if (p->interface)
	{
	  t = p->interface->type;

	  /* We don't normally include the generic parameters in the 
	     interface's type, but we do here to allow correct matching */
	  if (p->interface->gparms)
	    t = make_generic_type(t, p->interface->gparms);
	}
    }
  return t;
}
Пример #2
0
static type current_return_type(void)
{
  if (type_volatile(current_function_decl->ddecl->type))
    warning("function declared `noreturn' has a `return' statement");

  return type_function_return_type(current_function_decl->ddecl->type);
}
Пример #3
0
type get_actual_function_type(type t)
/* Returns: The actual function type for a (possibly generic) type t
     representing the type of a function/command/event
 */
{
  if (type_generic(t))
    return type_function_return_type(t);
  else
    return t;
}
Пример #4
0
expression build_function_call(region r, location loc,
			       expression fn, expression arglist)
{
  expression result = CAST(expression, new_function_call(r, loc, fn, arglist, NULL, normal_call));
  type fntype = type_default_conversion(fn->type), rettype;

  if (type_pointer(fntype))
    /* All function types come this way because default_conversion makes
       them into pointers to functions... */
    fntype = type_points_to(fntype);

  rettype = type_function_return_type(fntype);
  result->type = rettype;
  result->cst = fold_function_call(result, 0);

  return result;
}