summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index d19a5cde95c..bf248dcba60 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12715,15 +12715,14 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
&& TYPE_NAME (qualified_type)
&& TREE_CODE (TYPE_NAME (qualified_type)) == TYPE_DECL)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (TREE_CODE (TREE_TYPE (TYPE_NAME (qualified_type)))
- == INTEGER_TYPE
- && TYPE_PRECISION (TREE_TYPE (TYPE_NAME (qualified_type)))
- == TYPE_PRECISION (qualified_type)
- && TYPE_UNSIGNED (TREE_TYPE (TYPE_NAME (qualified_type)))
- == TYPE_UNSIGNED (qualified_type));
-#endif
- qualified_type = TREE_TYPE (TYPE_NAME (qualified_type));
+ tree t = TREE_TYPE (TYPE_NAME (qualified_type));
+
+ gcc_checking_assert (TREE_CODE (t) == INTEGER_TYPE
+ && TYPE_PRECISION (t)
+ == TYPE_PRECISION (qualified_type)
+ && TYPE_UNSIGNED (t)
+ == TYPE_UNSIGNED (qualified_type));
+ qualified_type = t;
}
/* If we do, then we can just use its DIE, if it exists. */
@@ -18313,9 +18312,13 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
scope_die_for (type, context_die), type);
equate_type_number_to_die (type, type_die);
add_name_attribute (type_die, type_tag (type));
- if ((dwarf_version >= 4 || !dwarf_strict)
- && ENUM_IS_SCOPED (type))
- add_AT_flag (type_die, DW_AT_enum_class, 1);
+ if (dwarf_version >= 4 || !dwarf_strict)
+ {
+ if (ENUM_IS_SCOPED (type))
+ add_AT_flag (type_die, DW_AT_enum_class, 1);
+ if (ENUM_IS_OPAQUE (type))
+ add_AT_flag (type_die, DW_AT_declaration, 1);
+ }
}
else if (! TYPE_SIZE (type))
return type_die;