aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-04-09 00:00:06 +0000
committerRichard Stallman <rms@gnu.org>1993-04-09 00:00:06 +0000
commitfbe23ee7418e3a909ef68eae235c040b9c31402e (patch)
treefd3ff0dde4571aca0c02bc85c61bc81a2767b53d
parent6d9efc7bd691b2cec9c35fd80bf9a03c62dd8044 (diff)
downloadgcc-fbe23ee7418e3a909ef68eae235c040b9c31402e.zip
gcc-fbe23ee7418e3a909ef68eae235c040b9c31402e.tar.gz
gcc-fbe23ee7418e3a909ef68eae235c040b9c31402e.tar.bz2
(finish_enum): Store layout results into variant types.
From-SVN: r4045
-rw-r--r--gcc/c-decl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index a45201c..ba722bc 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -5384,7 +5384,7 @@ tree
finish_enum (enumtype, values)
register tree enumtype, values;
{
- register tree pair;
+ register tree pair, tem;
tree minnode = 0, maxnode = 0;
register HOST_WIDE_INT maxvalue = 0;
register HOST_WIDE_INT minvalue = 0;
@@ -5474,6 +5474,19 @@ finish_enum (enumtype, values)
TYPE_VALUES (enumtype) = values;
+ /* Fix up all variant types of this enum type. */
+ for (tem = TYPE_MAIN_VARIANT (enumtype); tem; tem = TYPE_NEXT_VARIANT (tem))
+ {
+ TYPE_VALUES (tem) = TYPE_VALUES (enumtype);
+ TYPE_MIN_VALUE (tem) = TYPE_MIN_VALUE (enumtype);
+ TYPE_MAX_VALUE (tem) = TYPE_MAX_VALUE (enumtype);
+ TYPE_SIZE (tem) = TYPE_SIZE (enumtype);
+ TYPE_MODE (tem) = TYPE_MODE (enumtype);
+ TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype);
+ TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
+ TREE_UNSIGNED (tem) = TREE_UNSIGNED (enumtype);
+ }
+
/* Finish debugging output for this type. */
rest_of_type_compilation (enumtype, toplevel);