From: Richard Stallman Date: Fri, 9 Apr 1993 00:00:06 +0000 (+0000) Subject: (finish_enum): Store layout results into variant types. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fbe23ee7418e3a909ef68eae235c040b9c31402e;p=gcc.git (finish_enum): Store layout results into variant types. From-SVN: r4045 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index a45201cd1eb..ba722bc5046 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);