This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix PR debug/45088


On 11/30/2010 11:06 AM, Dodji Seketeli wrote:
Jason Merrill<jason@redhat.com> writes:

On 11/12/2010 06:47 AM, Dodji Seketeli wrote:
One possible way to do resolve that dilemma is [at the FE level] to
fixup the type of *ai to make it be A instead of the self-reference
type of A. I figure the fact that the self-reference type is different
from A itself should be kept as an implementation detail of the FE
anyway.

I think the typedef should be emitted so that name lookup in the debugger can find it. TYPE_DECL_IS_STUB should not be true for the injected-class-name.

Yes this makes a lot of sense. I initially got somewhat confused by this code snippet in is_redundant_typedef:

   if (DECL_ARTIFICIAL (decl)
       &&  DECL_CONTEXT (decl)
       &&  is_tagged_type (DECL_CONTEXT (decl))
       &&  TREE_CODE (TYPE_NAME (DECL_CONTEXT (decl))) == TYPE_DECL
       &&  DECL_NAME (decl) == DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))))
     /* Also ignore the artificial member typedef for the class name.  */
     return 1;

 From what I understand it basically is tailored to not emit debug info
precisely for injected-class-names.

Yep.


But maybe at that time we didn't have the help of cgraph and the unused
type debug info pruning we have today. In other words I think emitting
debug info for the injected-class-name won't necessarily increase bloat
because if the debug info of the injected-class-name typedef will be
pruned if it is not used.

No, I don't think we can prune those. Perhaps bloat is a reason not to go this way.


What about just having gen_type_die_with_usage check is_redundant_typedef?

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]