FreeBSD/contrib/gcc/cp/mangle.c
/* Return an identifier for the mangled name of a this-adjusting or
   covariant thunk to FN_DECL.  FIXED_OFFSET is the initial adjustment
   to this used to find the vptr.  If VIRTUAL_OFFSET is non-NULL, this
   is a virtual thunk, and it is the vtbl offset in
   bytes. THIS_ADJUSTING is nonzero for a this adjusting thunk and
   zero for a covariant thunk. Note, that FN_DECL might be a covariant
   thunk itself. A covariant thunk name always includes the adjustment
   for the this pointer, even if there is none.

   <special-name> ::= T <call-offset> <base encoding>
		  ::= Tc <this_adjust call-offset> <result_adjust call-offset>
					<base encoding>  */
Return an identifier for the mangled name of a this-adjusting or
covariant thunk to FN_DECL.  FIXED_OFFSET is the initial adjustment
to this used to find the vptr.  If VIRTUAL_OFFSET is non-NULL, this
is a virtual thunk, and it is the vtbl offset in
bytes. THIS_ADJUSTING is nonzero for a this adjusting thunk and
zero for a covariant thunk. Note, that FN_DECL might be a covariant
thunk itself. A covariant thunk name always includes the adjustment
for the this pointer, even if there is none.


Return an identifier for the mangled name of a this - adjusting or covariant thunk to FN_DECL . FIXED_OFFSET is the initial adjustment to this used to find the vptr . If VIRTUAL_OFFSET is non - NULL this is a virtual thunk and it is the vtbl offset in bytes . THIS_ADJUSTING is nonzero for a this adjusting thunk and zero for a covariant thunk . Note that FN_DECL might be a covariant thunk itself . A covariant thunk name always includes the adjustment for the this pointer even if there is none .
tree
mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset,
	      tree virtual_offset)
{
  const char *result;
  start_mangling (fn_decl, true);
  write_string ("_Z");
  write_char ('T');
  if (!this_adjusting)
    {
      write_char ('c');
      mangle_call_offset (integer_zero_node, NULL_TREE);
      mangle_call_offset (fixed_offset, virtual_offset);
    }
  else if (!DECL_THUNK_P (fn_decl))
    mangle_call_offset (fixed_offset, virtual_offset);
  else
    {
      write_char ('c');
      mangle_call_offset (fixed_offset, virtual_offset);
      fixed_offset = ssize_int (THUNK_FIXED_OFFSET (fn_decl));
      virtual_offset = THUNK_VIRTUAL_OFFSET (fn_decl);
      if (virtual_offset)
	virtual_offset = BINFO_VPTR_FIELD (virtual_offset);
      mangle_call_offset (fixed_offset, virtual_offset);
      fn_decl = THUNK_TARGET (fn_decl);
    }
  write_encoding (fn_decl);
  result = finish_mangling (false);
  if (DEBUG_MANGLE)
    fprintf (stderr, "mangle_thunk = %s\n\n", result);
  return get_identifier_nocopy (result);
}
tree mangle_thunk ( tree fn_decl , const int this_adjusting , tree fixed_offset , tree virtual_offset ) { const char * result ; start_mangling ( fn_decl , true ) ; write_string ( " " ) ; write_char ( ' ' ) ; if ( ! this_adjusting ) { write_char ( ' ' ) ; mangle_call_offset ( integer_zero_node , NULL_TREE ) ; mangle_call_offset ( fixed_offset , virtual_offset ) ; } else if ( ! DECL_THUNK_P ( fn_decl ) ) mangle_call_offset ( fixed_offset , virtual_offset ) ; else { write_char ( ' ' ) ; mangle_call_offset ( fixed_offset , virtual_offset ) ; fixed_offset = ssize_int ( THUNK_FIXED_OFFSET ( fn_decl ) ) ; virtual_offset = THUNK_VIRTUAL_OFFSET ( fn_decl ) ; if ( virtual_offset ) virtual_offset = BINFO_VPTR_FIELD ( virtual_offset ) ; mangle_call_offset ( fixed_offset , virtual_offset ) ; fn_decl = THUNK_TARGET ( fn_decl ) ; } write_encoding ( fn_decl ) ; result = finish_mangling ( false ) ; if ( DEBUG_MANGLE ) fprintf ( stderr , " \n \n " , result ) ; return get_identifier_nocopy ( result ) ; }
Return an identifier for the mangled name of a this-adjusting or
covariant thunk to FN_DECL.
Return an identifier for the mangled name of a this - adjusting or covariant thunk to FN_DECL .
/*ident_p=*/ /* Covariant thunk with no this adjustment */ /* Plain this adjusting thunk.  */ /* This adjusting thunk to covariant thunk.  */ /* Scoped name.  */ /*warn=*/