FreeBSD/contrib/gcc/varasm.c
/* Emit an assembler directive to make the symbol for DECL an alias to
   the symbol for TARGET.  */
Emit an assembler directive to make the symbol for DECL an alias to
the symbol for TARGET.
Emit an assembler directive to make the symbol for DECL an alias to the symbol for TARGET .
void
assemble_alias (tree decl, tree target)
{
  tree target_decl;
  bool is_weakref = false;
  if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
    {
      tree alias = DECL_ASSEMBLER_NAME (decl);
      is_weakref = true;
      ultimate_transparent_alias_target (&target);
      if (alias == target)
	error ("weakref %q+D ultimately targets itself", decl);
      else
	{
#ifndef ASM_OUTPUT_WEAKREF
	  IDENTIFIER_TRANSPARENT_ALIAS (alias) = 1;
	  TREE_CHAIN (alias) = target;
#endif
	}
      if (TREE_PUBLIC (decl))
	error ("weakref %q+D must have static linkage", decl);
    }
  else
    {
#if !defined (ASM_OUTPUT_DEF)
# if !defined(ASM_OUTPUT_WEAK_ALIAS) && !defined (ASM_WEAKEN_DECL)
      error ("%Jalias definitions not supported in this configuration", decl);
      return;
# else
      if (!DECL_WEAK (decl))
	{
	  error ("%Jonly weak aliases are supported in this configuration", decl);
	  return;
	}
# endif
#endif
    }
  make_decl_rtl (decl);
  TREE_USED (decl) = 1;
  if (! is_weakref)
    DECL_EXTERNAL (decl) = 0;
  if (TREE_CODE (decl) == FUNCTION_DECL)
    cgraph_node (decl)->alias = true;
  else
    cgraph_varpool_node (decl)->alias = true;
  target_decl = find_decl_and_mark_needed (decl, target);
  if (target_decl && TREE_ASM_WRITTEN (target_decl))
    do_assemble_alias (decl, target);
  else
    {
      alias_pair *p = VEC_safe_push (alias_pair, gc, alias_pairs, NULL);
      p->decl = decl;
      p->target = target;
    }
}
void assemble_alias ( tree decl , tree target ) { tree target_decl ; bool is_weakref = false ; if ( lookup_attribute ( " " , DECL_ATTRIBUTES ( decl ) ) ) { tree alias = DECL_ASSEMBLER_NAME ( decl ) ; is_weakref = true ; ultimate_transparent_alias_target ( & target ) ; if ( alias == target ) error ( " " , decl ) ; else { #ifndef ASM_OUTPUT_WEAKREF IDENTIFIER_TRANSPARENT_ALIAS ( alias ) = 1 ; TREE_CHAIN ( alias ) = target ; #endif } if ( TREE_PUBLIC ( decl ) ) error ( " " , decl ) ; } else { #if ! defined ( ASM_OUTPUT_DEF ) # if ! defined ( ASM_OUTPUT_WEAK_ALIAS ) && ! defined ( ASM_WEAKEN_DECL ) error ( " " , decl ) ; return ; # else if ( ! DECL_WEAK ( decl ) ) { error ( " " , decl ) ; return ; } # endif #endif } make_decl_rtl ( decl ) ; TREE_USED ( decl ) = 1 ; if ( ! is_weakref ) DECL_EXTERNAL ( decl ) = 0 ; if ( TREE_CODE ( decl ) == FUNCTION_DECL ) cgraph_node ( decl ) -> alias = true ; else cgraph_varpool_node ( decl ) -> alias = true ; target_decl = find_decl_and_mark_needed ( decl , target ) ; if ( target_decl && TREE_ASM_WRITTEN ( target_decl ) ) do_assemble_alias ( decl , target ) ; else { alias_pair * p = VEC_safe_push ( alias_pair , gc , alias_pairs , NULL ) ; p -> decl = decl ; p -> target = target ; } }
Emit an assembler directive to make the symbol for DECL an alias to
the symbol for TARGET.
Emit an assembler directive to make the symbol for DECL an alias to the symbol for TARGET .
/* We must force creation of DECL_RTL for debug info generation, even though
     we don't use it here.  */ /* A quirk of the initial implementation of aliases required that the user
     add "extern" to all of them.  Which is silly, but now historical.  Do
     note that the symbol is in fact locally defined.  */ /* Allow aliases to aliases.  */ /* If the target has already been emitted, we don't have to queue the
     alias.  This saves a tad o memory.  */