===================================================================
@@ -9496,6 +9496,14 @@ is_symbol_die (dw_die_ref c)
|| c->die_tag == DW_TAG_module);
}
+/* Returns true iff C is a compile-unit DIE. */
+
+static inline bool
+is_cu_die (dw_die_ref c)
+{
+ return c->die_tag == DW_TAG_compile_unit;
+}
+
static char *
gen_internal_sym (const char *prefix)
{
@@ -11343,7 +11351,7 @@ add_pubtype (tree decl, dw_die_ref die)
e.name = NULL;
if ((TREE_PUBLIC (decl)
- || die->die_parent == comp_unit_die)
+ || is_cu_die (die->die_parent))
&& (die->die_tag == DW_TAG_typedef || COMPLETE_TYPE_P (decl)))
{
e.die = die;
@@ -18729,7 +18737,7 @@ gen_subprogram_die (tree decl, dw_die_re
instances of inlines, since the spec requires the out-of-line copy
to have the same parent. For local class methods, this doesn't
apply; we just use the old DIE. */
- if ((old_die->die_parent == comp_unit_die || context_die == NULL)
+ if ((is_cu_die (old_die->die_parent) || context_die == NULL)
&& (DECL_ARTIFICIAL (decl)
|| (get_AT_file (old_die, DW_AT_decl_file) == file_index
&& (get_AT_unsigned (old_die, DW_AT_decl_line)
@@ -19740,7 +19748,7 @@ gen_struct_or_union_type_die (tree type,
scope_die = scope_die_for (type, context_die);
- if (! type_die || (nested && scope_die == comp_unit_die))
+ if (! type_die || (nested && is_cu_die (scope_die)))
/* First occurrence of type or toplevel definition of nested class. */
{
dw_die_ref old_die = type_die;
@@ -22366,7 +22378,7 @@ dwarf2out_finish (const char *filename)
if (origin)
add_child_die (origin->die_parent, die);
- else if (die == comp_unit_die)
+ else if (is_cu_die (die))
;
else if (seen_error ())
/* It's OK to be confused by errors in the input. */