This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] PR c++/44188
On Thu, May 20, 2010 at 01:48:10PM -0400, Jason Merrill wrote:
> On 05/20/2010 07:05 AM, Dodji Seketeli wrote:
> >- mod_type_die = lookup_type_die (qualified_type);
> >+ /* Handle C++ typedefs naming anonymous structs. */
> >+ if (handle_naming_typedef
> >+ && is_naming_typedef_decl (TYPE_NAME (qualified_type)))
> >+ mod_type_die = gen_typedef_die (TYPE_NAME (qualified_type),
> >+ context_die);
> >+ else
> >+ mod_type_die = lookup_type_die (qualified_type);
>
> For controlling infinite recursion, rather than add a new parameter
> here, how about changing gen_typedef_die to call gen_type_die
> directly for this case so that the lookup_type_die here will
> succeed?
Sorry, I don't follow. Do you mean doing here
if (is_naming_typedef (TYPE_NAME (qualified_type)))
gen_typedef_die (TYPE_NAME (qualified_type), context_die);
mod_type_die = lookup_type_die (qualified_type);
and have the lookup_type_die yield the DW_TAG_typedef DIE?
If yes, then I think we'd still have problem for the DW_AT_type
attribute of the DW_TAG_typedef DIE itself. In gen_typedef_type the
call to add_type_attribute must set the DW_AT_type attribute to a
DW_TAG_structure_type DIE, but as lookup_type_die would always return
a DW_TAG_typedef when passed the anonymous type, how can I make the
add_type_attribute called from within gen_typedef_die to pick the
anonymous DW_TAG_structure instead of the DW_TAG_typedef?
Dodji