aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c33
1 files changed, 6 insertions, 27 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 2cc9e4f..7197b47 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5556,40 +5556,19 @@ free_lang_data_in_type (tree type, class free_lang_data_d *fld)
{
if (TREE_CODE (type) == ENUMERAL_TYPE)
{
- tree it = NULL_TREE;
ENUM_IS_OPAQUE (type) = 0;
ENUM_IS_SCOPED (type) = 0;
/* Type values are used only for C++ ODR checking. Drop them
for all type variants and non-ODR types.
For ODR types the data is freed in free_odr_warning_data. */
- if (TYPE_MAIN_VARIANT (type) != type
- || !type_with_linkage_p (type))
+ if (!TYPE_VALUES (type))
+ ;
+ else if (TYPE_MAIN_VARIANT (type) != type
+ || !type_with_linkage_p (type)
+ || type_in_anonymous_namespace_p (type))
TYPE_VALUES (type) = NULL;
else
- /* Simplify representation by recording only values rather
- than const decls. */
- for (tree e = TYPE_VALUES (type); e; e = TREE_CHAIN (e))
- {
- if (TREE_CODE (TREE_VALUE (e)) == CONST_DECL)
- {
- TREE_VALUE (e) = DECL_INITIAL (TREE_VALUE (e));
- /* We can not stream values whose TREE_TYPE is type itself
- because that would create non-trivial CSS. Canonicalize
- them to integer types. */
- }
- /* Some frontends use ENUMERAL_TYPE to represent the constants.
- This leads to nontrivial SCC components containing
- INTEGER_CST which is not good for streaming. Convert them
- all to corresponding integer type. */
- if (TREE_CODE (TREE_TYPE (TREE_VALUE (e))) != INTEGER_TYPE)
- {
- if (!it)
- it = lang_hooks.types.type_for_size
- (TYPE_PRECISION (TREE_TYPE (TREE_VALUE (e))),
- TYPE_UNSIGNED (TREE_TYPE (TREE_VALUE (e))));
- TREE_VALUE (e) = fold_convert (it, TREE_VALUE (e));
- }
- }
+ register_odr_enum (type);
}
free_lang_data_in_one_sizepos (&TYPE_MIN_VALUE (type));
free_lang_data_in_one_sizepos (&TYPE_MAX_VALUE (type));