FreeBSD/contrib/gcc/c-common.c
/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */
/* Handle "blocks" attribute. */
APPLE LOCAL begin radar 5932809 - copyable byref blocks
Handle "blocks" attribute.
APPLE LOCAL begin radar 5932809 - copyable byref blocks Handle " blocks " attribute .
static tree
handle_blocks_attribute (tree *node, tree name, 
			  tree args,
			  int ARG_UNUSED (flags), bool *no_add_attrs)
{
  tree arg_ident;
  tree type;
  *no_add_attrs = true;
  if (!(*node) || TREE_CODE (*node) != VAR_DECL)
    {
      error ("__block attribute can be specified on variables only");
      return NULL_TREE;
    }
  arg_ident = TREE_VALUE (args);
  gcc_assert (TREE_CODE (arg_ident) == IDENTIFIER_NODE);
  if (strcmp (IDENTIFIER_POINTER (arg_ident), "byref"))
    {
      warning (OPT_Wattributes, "Only \"byref\" is allowed - %qE attribute ignored", 
	        name);
      return NULL_TREE;
    }
  type = TREE_TYPE (*node);
  if (TREE_CODE (type) == ERROR_MARK)
    return NULL_TREE;
  if (TREE_CODE (type) == ARRAY_TYPE)
  {
    if (!TYPE_SIZE (type) || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
    {
      error ("__block not allowed on a variable length array declaration");
      return NULL_TREE;
    }
  }
  COPYABLE_BYREF_LOCAL_VAR (*node) = 1;
  COPYABLE_BYREF_LOCAL_NONPOD (*node) = block_requires_copying (*node);
  return NULL_TREE;
}
static tree handle_blocks_attribute ( tree * node , tree name , tree args , int ARG_UNUSED ( flags ) , bool * no_add_attrs ) { tree arg_ident ; tree type ; * no_add_attrs = true ; if ( ! ( * node ) || TREE_CODE ( * node ) != VAR_DECL ) { error ( " " ) ; return NULL_TREE ; } arg_ident = TREE_VALUE ( args ) ; gcc_assert ( TREE_CODE ( arg_ident ) == IDENTIFIER_NODE ) ; if ( strcmp ( IDENTIFIER_POINTER ( arg_ident ) , " " ) ) { warning ( OPT_Wattributes , " \" \" " , name ) ; return NULL_TREE ; } type = TREE_TYPE ( * node ) ; if ( TREE_CODE ( type ) == ERROR_MARK ) return NULL_TREE ; if ( TREE_CODE ( type ) == ARRAY_TYPE ) { if ( ! TYPE_SIZE ( type ) || TREE_CODE ( TYPE_SIZE ( type ) ) != INTEGER_CST ) { error ( " " ) ; return NULL_TREE ; } } COPYABLE_BYREF_LOCAL_VAR ( * node ) = 1 ; COPYABLE_BYREF_LOCAL_NONPOD ( * node ) = block_requires_copying ( * node ) ; return NULL_TREE ; }
APPLE LOCAL begin radar 5932809 - copyable byref blocks
Handle "blocks" attribute.
APPLE LOCAL begin radar 5932809 - copyable byref blocks Handle " blocks " attribute .
/* APPLE LOCAL radar 6217257 */ /* APPLE LOCAL radar 6096219 */ /* APPLE LOCAL radar 6096219 */ /* APPLE LOCAL begin radar 6217257 */ /* APPLE LOCAL end radar 6217257 */