FreeBSD/contrib/gcc/c-common.c
/* Determine the ELF symbol visibility for DECL, which is either a
   variable or a function.  It is an error to use this function if a
   definition of DECL is not available in this translation unit.
   Returns true if the final visibility has been determined by this
   function; false if the caller is free to make additional
   modifications.  */
Determine the ELF symbol visibility for DECL, which is either a
variable or a function.  It is an error to use this function if a
definition of DECL is not available in this translation unit.
Returns true if the final visibility has been determined by this
function; false if the caller is free to make additional
modifications.
Determine the ELF symbol visibility for DECL which is either a variable or a function . It is an error to use this function if a definition of DECL is not available in this translation unit . Returns true if the final visibility has been determined by this function ; false if the caller is free to make additional modifications .
bool
c_determine_visibility (tree decl)
{
  gcc_assert (TREE_CODE (decl) == VAR_DECL
	      || TREE_CODE (decl) == FUNCTION_DECL);
  if (lookup_attribute ("visibility", DECL_ATTRIBUTES (decl)))
    return true;
  if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
      && lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
    {
      DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
      DECL_VISIBILITY_SPECIFIED (decl) = 1;
      return true;
    }
  if (!DECL_VISIBILITY_SPECIFIED (decl))
    {
      DECL_VISIBILITY (decl) = default_visibility;
      DECL_VISIBILITY_SPECIFIED (decl) = visibility_options.inpragma;
    }
  return false;
}
bool c_determine_visibility ( tree decl ) { gcc_assert ( TREE_CODE ( decl ) == VAR_DECL || TREE_CODE ( decl ) == FUNCTION_DECL ) ; if ( lookup_attribute ( " " , DECL_ATTRIBUTES ( decl ) ) ) return true ; if ( TARGET_DLLIMPORT_DECL_ATTRIBUTES && lookup_attribute ( " " , DECL_ATTRIBUTES ( decl ) ) ) { DECL_VISIBILITY ( decl ) = VISIBILITY_DEFAULT ; DECL_VISIBILITY_SPECIFIED ( decl ) = 1 ; return true ; } if ( ! DECL_VISIBILITY_SPECIFIED ( decl ) ) { DECL_VISIBILITY ( decl ) = default_visibility ; DECL_VISIBILITY_SPECIFIED ( decl ) = visibility_options . inpragma ; } return false ; }
Determine the ELF symbol visibility for DECL, which is either a
variable or a function.
Determine the ELF symbol visibility for DECL which is either a variable or a function .
/* If the user explicitly specified the visibility with an
     attribute, honor that.  DECL_VISIBILITY will have been set during
     the processing of the attribute.  We check for an explicit
     attribute, rather than just checking DECL_VISIBILITY_SPECIFIED,
     to distinguish the use of an attribute from the use of a "#pragma
     GCC visibility push(...)"; in the latter case we still want other
     considerations to be able to overrule the #pragma.  */ /* Anything that is exported must have default visibility.  */ /* Set default visibility to whatever the user supplied with
     visibility_specified depending on #pragma GCC visibility.  */