(valid_machine_attribute): Handle attribute on pointer-to-function

types.

From-SVN: r9762
This commit is contained in:
Richard Kenner 1995-05-22 07:10:37 -04:00
parent 4033d0e702
commit 15c8ec1ccd
1 changed files with 27 additions and 0 deletions

View File

@ -3003,6 +3003,33 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
TREE_TYPE (decl) = type; TREE_TYPE (decl) = type;
valid = 1; valid = 1;
} }
/* Handle putting a type attribute on pointer-to-function-type by putting
the attribute on the function type. */
else if (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE
&& VALID_MACHINE_TYPE_ATTRIBUTE (TREE_TYPE (type), type_attr_list,
attr_name, attr_args))
{
tree inner_type = TREE_TYPE (type);
tree inner_attr_list = TYPE_ATTRIBUTES (inner_type);
tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
type_attr_list);
if (attr != NULL_TREE)
TREE_VALUE (attr) = attr_args;
else
{
inner_attr_list = tree_cons (attr_name, attr_args, inner_attr_list);
inner_type = build_type_attribute_variant (inner_type,
inner_attr_list);
}
if (decl != 0)
TREE_TYPE (decl) = build_pointer_type (inner_type);
valid = 1;
}
#endif #endif
return valid; return valid;