FreeBSD/contrib/gcc/cp/mangle.c
/* Mangle the name of a function-scope entity.  FUNCTION is the
   FUNCTION_DECL for the enclosing function.  ENTITY is the decl for
   the entity itself.  LOCAL_ENTITY is the entity that's directly
   scoped in FUNCTION_DECL, either ENTITY itself or an enclosing scope
   of ENTITY.

     <local-name> := Z <function encoding> E <entity name> [<discriminator>]
		  := Z <function encoding> E s [<discriminator>]  */
Mangle the name of a function-scope entity.  FUNCTION is the
FUNCTION_DECL for the enclosing function.  ENTITY is the decl for
the entity itself.  LOCAL_ENTITY is the entity that's directly
scoped in FUNCTION_DECL, either ENTITY itself or an enclosing scope
of ENTITY.


Mangle the name of a function - scope entity . FUNCTION is the FUNCTION_DECL for the enclosing function . ENTITY is the decl for the entity itself . LOCAL_ENTITY is the entity that ' s directly scoped in FUNCTION_DECL either ENTITY itself or an enclosing scope of ENTITY .
static void
write_local_name (const tree function, const tree local_entity,
		  const tree entity)
{
  MANGLE_TRACE_TREE ("local-name", entity);
  write_char ('Z');
  write_encoding (function);
  write_char ('E');
  if (TREE_CODE (entity) == STRING_CST)
    {
      write_char ('s');
      write_discriminator (discriminator_for_string_literal (function,
							     entity));
    }
  else
    {
      write_name (entity, 1);
      write_discriminator (discriminator_for_local_entity (local_entity));
    }
}
static void write_local_name ( const tree function , const tree local_entity , const tree entity ) { MANGLE_TRACE_TREE ( " " , entity ) ; write_char ( ' ' ) ; write_encoding ( function ) ; write_char ( ' ' ) ; if ( TREE_CODE ( entity ) == STRING_CST ) { write_char ( ' ' ) ; write_discriminator ( discriminator_for_string_literal ( function , entity ) ) ; } else { write_name ( entity , 1 ) ; write_discriminator ( discriminator_for_local_entity ( local_entity ) ) ; } }
Mangle the name of a function-scope entity.
Mangle the name of a function - scope entity .
/* Now the <entity name>.  Let write_name know its being called
	 from <local-name>, so it doesn't try to process the enclosing
	 function scope again.  */ /*ignore_local_scope=*/