FreeBSD/contrib/gcc/c-common.c
/* Handle a "destructor" attribute; arguments as in
   struct attribute_spec.handler.  */
Handle a "destructor" attribute; arguments as in
struct attribute_spec.handler.
Handle a " destructor " attribute ; arguments as in struct attribute_spec . handler .
static tree
handle_destructor_attribute (tree *node, tree name,
			     tree ARG_UNUSED (args),
			     int ARG_UNUSED (flags),
			     bool *no_add_attrs)
{
  tree decl = *node;
  tree type = TREE_TYPE (decl);
  if (TREE_CODE (decl) == FUNCTION_DECL
      && TREE_CODE (type) == FUNCTION_TYPE
      && decl_function_context (decl) == 0)
    {
      DECL_STATIC_DESTRUCTOR (decl) = 1;
      TREE_USED (decl) = 1;
    }
  else
    {
      warning (OPT_Wattributes, "%qE attribute ignored", name);
      *no_add_attrs = true;
    }
  return NULL_TREE;
}
static tree handle_destructor_attribute ( tree * node , tree name , tree ARG_UNUSED ( args ) , int ARG_UNUSED ( flags ) , bool * no_add_attrs ) { tree decl = * node ; tree type = TREE_TYPE ( decl ) ; if ( TREE_CODE ( decl ) == FUNCTION_DECL && TREE_CODE ( type ) == FUNCTION_TYPE && decl_function_context ( decl ) == 0 ) { DECL_STATIC_DESTRUCTOR ( decl ) = 1 ; TREE_USED ( decl ) = 1 ; } else { warning ( OPT_Wattributes , " " , name ) ; * no_add_attrs = true ; } return NULL_TREE ; }
Handle a "destructor" attribute; arguments as in
struct attribute_spec.handler.
Handle a " destructor " attribute ; arguments as in struct attribute_spec . handler .