+2011-05-06 Cary Coutant <ccoutant@google.com>
+
+ * dwarf2out.c (contains_subprogram_definition): New function.
+ (should_move_die_to_comdat): Call it.
+
2011-05-06 Jeff Law <law@redhat.com>
* tree-ssa-threadupdate.c (create_block_for_threading): Do not call
return local_scope_p (decl);
}
+/* Return non-zero if this DIE contains a defining declaration of a
+ subprogram. */
+
+static int
+contains_subprogram_definition (dw_die_ref die)
+{
+ dw_die_ref c;
+
+ if (die->die_tag == DW_TAG_subprogram && ! is_declaration_die (die))
+ return 1;
+ FOR_EACH_CHILD (die, c, if (contains_subprogram_definition(c)) return 1);
+ return 0;
+}
+
/* Return non-zero if this is a type DIE that should be moved to a
COMDAT .debug_types section. */
|| get_AT (die, DW_AT_abstract_origin)
|| is_nested_in_subprogram (die))
return 0;
+ /* A type definition should never contain a subprogram definition. */
+ gcc_assert (!contains_subprogram_definition (die));
return 1;
case DW_TAG_array_type:
case DW_TAG_interface_type: