FreeBSD/contrib/gcc/c-common.c
/* Apply the TYPE_QUALS to the new DECL.  */
Apply the TYPE_QUALS to the new DECL.
Apply the TYPE_QUALS to the new DECL .
void
c_apply_type_quals_to_decl (int type_quals, tree decl)
{
  tree type = TREE_TYPE (decl);
  if (type == error_mark_node)
    return;
  if (((type_quals & TYPE_QUAL_CONST)
       || (type && TREE_CODE (type) == REFERENCE_TYPE))
      && !(type && TYPE_NEEDS_CONSTRUCTING (type)))
    TREE_READONLY (decl) = 1;
  if (type_quals & TYPE_QUAL_VOLATILE)
    {
      TREE_SIDE_EFFECTS (decl) = 1;
      TREE_THIS_VOLATILE (decl) = 1;
    }
  if (type_quals & TYPE_QUAL_RESTRICT)
    {
      while (type && TREE_CODE (type) == ARRAY_TYPE)
	type = TREE_TYPE (type);
      if (!type
	  || !POINTER_TYPE_P (type)
	  || !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type)))
	error ("invalid use of %<restrict%>");
      else if (flag_strict_aliasing && type == TREE_TYPE (decl))
	DECL_POINTER_ALIAS_SET (decl) = -2;
    }
}
void c_apply_type_quals_to_decl ( int type_quals , tree decl ) { tree type = TREE_TYPE ( decl ) ; if ( type == error_mark_node ) return ; if ( ( ( type_quals & TYPE_QUAL_CONST ) || ( type && TREE_CODE ( type ) == REFERENCE_TYPE ) ) && ! ( type && TYPE_NEEDS_CONSTRUCTING ( type ) ) ) TREE_READONLY ( decl ) = 1 ; if ( type_quals & TYPE_QUAL_VOLATILE ) { TREE_SIDE_EFFECTS ( decl ) = 1 ; TREE_THIS_VOLATILE ( decl ) = 1 ; } if ( type_quals & TYPE_QUAL_RESTRICT ) { while ( type && TREE_CODE ( type ) == ARRAY_TYPE ) type = TREE_TYPE ( type ) ; if ( ! type || ! POINTER_TYPE_P ( type ) || ! C_TYPE_OBJECT_OR_INCOMPLETE_P ( TREE_TYPE ( type ) ) ) error ( " " ) ; else if ( flag_strict_aliasing && type == TREE_TYPE ( decl ) ) DECL_POINTER_ALIAS_SET ( decl ) = -2 ; } }
Apply the TYPE_QUALS to the new DECL.
Apply the TYPE_QUALS to the new DECL .
/* An object declared 'const' is only readonly after it is
	 initialized.  We don't have any way of expressing this currently,
	 so we need to be conservative and unset TREE_READONLY for types
	 with constructors.  Otherwise aliasing code will ignore stores in
	 an inline constructor.  */ /* Allow 'restrict' on arrays of pointers.
	   FIXME currently we just ignore it.  */ /* Indicate we need to make a unique alias set for this pointer.
	   We can't do it here because it might be pointing to an
	   incomplete type.  */