+2005-11-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/22489
+ * dwarf2out.c (gen_subprogram_die): Force a declaration die for
+ lazily declared methods.
+ (force_decl_die): Stop if forcing out the context already make a
+ DIE for the decl.
+ (force_type_die): Likewise.
+
2005-11-13 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/24820
gcc_assert (!old_die);
}
+ /* Now that the C++ front end lazily declares artificial member fns, we
+ might need to retrofit the declaration into its class. */
+ if (!declaration && !origin && !old_die
+ && DECL_CONTEXT (decl) && TYPE_P (DECL_CONTEXT (decl))
+ && !class_or_namespace_scope_p (context_die)
+ && debug_info_level > DINFO_LEVEL_TERSE)
+ old_die = force_decl_die (decl);
+
if (origin != NULL)
{
gcc_assert (!declaration || local_scope_p (context_die));
Note that force_decl_die() forces function declaration die. It is
later reused to represent definition. */
- equate_decl_number_to_die (decl, subr_die);
+ equate_decl_number_to_die (decl, subr_die);
}
}
else if (DECL_ABSTRACT (decl))
else
context_die = comp_unit_die;
+ decl_die = lookup_decl_die (decl);
+ if (decl_die)
+ return decl_die;
+
switch (TREE_CODE (decl))
{
case FUNCTION_DECL:
{
dw_die_ref context_die;
if (TYPE_CONTEXT (type))
- if (TYPE_P (TYPE_CONTEXT (type)))
- context_die = force_type_die (TYPE_CONTEXT (type));
- else
- context_die = force_decl_die (TYPE_CONTEXT (type));
+ {
+ if (TYPE_P (TYPE_CONTEXT (type)))
+ context_die = force_type_die (TYPE_CONTEXT (type));
+ else
+ context_die = force_decl_die (TYPE_CONTEXT (type));
+ }
else
context_die = comp_unit_die;
+ type_die = lookup_type_die (type);
+ if (type_die)
+ return type_die;
gen_type_die (type, context_die);
type_die = lookup_type_die (type);
gcc_assert (type_die);