diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-05-22 11:10:37 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-05-22 11:10:37 +0000 |
commit | 0b7d5c75964ba4f57684d89e774d5315a9c0c32d (patch) | |
tree | 8eb521640092425569a92d93fc071de7299b92fc /gcc/tree.c | |
parent | 64f7a15986f14a04919eeee245da0f7ecce2b579 (diff) | |
download | gcc-0b7d5c75964ba4f57684d89e774d5315a9c0c32d.tar.gz |
(valid_machine_attribute): Handle attribute on pointer-to-function
types.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9762 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 0388e8b809d..1d7ad92fcff 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3003,6 +3003,33 @@ valid_machine_attribute (attr_name, attr_args, decl, type) TREE_TYPE (decl) = type; 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 return valid; |