diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2001-12-14 06:36:14 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2001-12-14 06:36:14 +0000 |
commit | c3f23a53ba8aa5c616463c1ae881de4349b1b21d (patch) | |
tree | 0206709f85ba3245fab535963e7a39aa96a96127 | |
parent | 803e889402a3683f6c40af790e0c9e24051148af (diff) | |
download | gcc-c3f23a53ba8aa5c616463c1ae881de4349b1b21d.zip gcc-c3f23a53ba8aa5c616463c1ae881de4349b1b21d.tar.gz gcc-c3f23a53ba8aa5c616463c1ae881de4349b1b21d.tar.bz2 |
attribs.c (c_common_attribute_table): Swap decl_req and type_req for the mode attribute.
* attribs.c (c_common_attribute_table): Swap decl_req and type_req
for the mode attribute.
(handle_mode_attribute): Handle types, not decls.
From-SVN: r47990
-rw-r--r-- | gcc/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/attribs.c | 15 |
2 files changed, 6 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b83230..f02961d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,4 @@ -2001-12-09 Aldy Hernandez <aldyh@redhat.com> +2001-12-13 Aldy Hernandez <aldyh@redhat.com> * attribs.c (c_common_attribute_table): Swap decl_req and type_req for the mode attribute. diff --git a/gcc/attribs.c b/gcc/attribs.c index 5545913..73d9d39 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -120,7 +120,7 @@ static const struct attribute_spec c_common_attribute_table[] = handle_constructor_attribute }, { "destructor", 0, 0, true, false, false, handle_destructor_attribute }, - { "mode", 1, 1, true, false, false, + { "mode", 1, 1, false, true, false, handle_mode_attribute }, { "section", 1, 1, true, false, false, handle_section_attribute }, @@ -761,8 +761,7 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs) int flags ATTRIBUTE_UNUSED; bool *no_add_attrs; { - tree decl = *node; - tree type = TREE_TYPE (decl); + tree type = *node; *no_add_attrs = true; @@ -786,7 +785,7 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs) p = newp; } - /* Give this decl a type with the specified mode. + /* Change this type to have a type with the specified mode. First check for the special modes. */ if (! strcmp (p, "byte")) mode = byte_mode; @@ -805,12 +804,8 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs) TREE_UNSIGNED (type)))) error ("no data type for mode `%s'", p); else - { - TREE_TYPE (decl) = type = typefm; - DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0; - if (TREE_CODE (decl) != FIELD_DECL) - layout_decl (decl, 0); - } + *node = typefm; + /* No need to layout the type here. The caller should do this. */ } return NULL_TREE; |