FreeBSD/contrib/gcc/cp/mangle.c
/* Write the mangled representation of a method parameter list of
   types given in PARM_TYPES.  If METHOD_P is nonzero, the function is
   considered a non-static method, and the this parameter is omitted.
   If non-NULL, DECL is the FUNCTION_DECL for the function whose
   parameters are being emitted.  */
Write the mangled representation of a method parameter list of
types given in PARM_TYPES.  If METHOD_P is nonzero, the function is
considered a non-static method, and the this parameter is omitted.
If non-NULL, DECL is the FUNCTION_DECL for the function whose
parameters are being emitted.
Write the mangled representation of a method parameter list of types given in PARM_TYPES . If METHOD_P is nonzero the function is considered a non - static method and the this parameter is omitted . If non - NULL DECL is the FUNCTION_DECL for the function whose parameters are being emitted .
static void
write_method_parms (tree parm_types, const int method_p, const tree decl)
{
  tree first_parm_type;
  tree parm_decl = decl ? DECL_ARGUMENTS (decl) : NULL_TREE;
  int varargs_p = 1;
  if (method_p)
    {
      parm_types = TREE_CHAIN (parm_types);
      parm_decl = parm_decl ? TREE_CHAIN (parm_decl) : NULL_TREE;
      while (parm_decl && DECL_ARTIFICIAL (parm_decl))
	{
	  parm_types = TREE_CHAIN (parm_types);
	  parm_decl = TREE_CHAIN (parm_decl);
	}
    }
  for (first_parm_type = parm_types;
       parm_types;
       parm_types = TREE_CHAIN (parm_types))
    {
      tree parm = TREE_VALUE (parm_types);
      if (parm == void_type_node)
	{
	  if (parm_types == first_parm_type)
	    write_type (parm);
	  varargs_p = 0;
	  gcc_assert (TREE_CHAIN (parm_types) == NULL);
	}
      else
	write_type (parm);
    }
  if (varargs_p)
    write_char ('z');
}
static void write_method_parms ( tree parm_types , const int method_p , const tree decl ) { tree first_parm_type ; tree parm_decl = decl ? DECL_ARGUMENTS ( decl ) : NULL_TREE ; int varargs_p = 1 ; if ( method_p ) { parm_types = TREE_CHAIN ( parm_types ) ; parm_decl = parm_decl ? TREE_CHAIN ( parm_decl ) : NULL_TREE ; while ( parm_decl && DECL_ARTIFICIAL ( parm_decl ) ) { parm_types = TREE_CHAIN ( parm_types ) ; parm_decl = TREE_CHAIN ( parm_decl ) ; } } for ( first_parm_type = parm_types ; parm_types ; parm_types = TREE_CHAIN ( parm_types ) ) { tree parm = TREE_VALUE ( parm_types ) ; if ( parm == void_type_node ) { if ( parm_types == first_parm_type ) write_type ( parm ) ; varargs_p = 0 ; gcc_assert ( TREE_CHAIN ( parm_types ) == NULL ) ; } else write_type ( parm ) ; } if ( varargs_p ) write_char ( ' ' ) ; }
Write the mangled representation of a method parameter list of
types given in PARM_TYPES.
Write the mangled representation of a method parameter list of types given in PARM_TYPES .
/* Assume this parameter type list is variable-length.  If it ends
     with a void type, then it's not.  */ /* If this is a member function, skip the first arg, which is the
     this pointer.
       "Member functions do not encode the type of their implicit this
       parameter."

     Similarly, there's no need to mangle artificial parameters, like
     the VTT parameters for constructors and destructors.  */ /* "Empty parameter lists, whether declared as () or
	     conventionally as (void), are encoded with a void parameter
	     (v)."  */ /* If the parm list is terminated with a void type, it's
	     fixed-length.  */ /* A void type better be the last one.  */ /* <builtin-type> ::= z  # ellipsis  */