aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-08-19 17:32:52 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-08-19 17:32:52 -0400
commitec83f2b3818ca1f7b8520e9c0577b719db92b952 (patch)
treecb979a01513760d7aeb98040dc8b6d662f50a3e6 /gcc/c-common.c
parentadb230612706c2ae934ad2b5432078b0d8596655 (diff)
downloadgcc-ec83f2b3818ca1f7b8520e9c0577b719db92b952.zip
gcc-ec83f2b3818ca1f7b8520e9c0577b719db92b952.tar.gz
gcc-ec83f2b3818ca1f7b8520e9c0577b719db92b952.tar.bz2
(decl_attribute): Handle "transparent_union" attribute.
From-SVN: r7947
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index f18c270..8109fc0 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -253,6 +253,19 @@ decl_attributes (decl, attributes)
else
warning_with_decl (decl, "`const' attribute ignored");
}
+ else if (TREE_VALUE (a) == get_identifier ("transparent_union"))
+ {
+ if (TREE_CODE (decl) == PARM_DECL
+ && TREE_CODE (type) == UNION_TYPE
+ && TYPE_MODE (type) == DECL_MODE (TYPE_FIELDS (type)))
+ DECL_TRANSPARENT_UNION (decl) = 1;
+ else if (TREE_CODE (decl) == TYPE_DECL
+ && TREE_CODE (type) == UNION_TYPE
+ && TYPE_MODE (type) == DECL_MODE (TYPE_FIELDS (type)))
+ TYPE_TRANSPARENT_UNION (type) = 1;
+ else
+ warning_with_decl (decl, "`transparent_union' attribute ignored");
+ }
else if (TREE_CODE (name) != TREE_LIST)
{
#ifdef VALID_MACHINE_ATTRIBUTE