[lto] PATCH: Add DIE readers for array and enum types

Sandra Loosemore sandra@codesourcery.com
Fri Sep 1 00:53:00 GMT 2006


Mark Mitchell wrote:

>>     (lto_read_enumeration_type_DIE): New.
> 
> Do you really need to reconcile the DW_AT_byte_size and DW_AT_type 
> things here, using lto_find_integral_type?  I would suggest that GCC 
> should always emit DW_AT_type, and that you just check that 
> DW_AT_byte_size, if present, matches the size type specified by DW_AT_type.

The DWARF spec says that the enumeration type entry "has" the DW_AT_byte_size 
attribute, and "may also have" DW_AT_type, so yes, I think the lookup and 
reconciliation are necessary.  It doesn't say what to do if the sizes are 
incompatible (the case I didn't implement yet in lto_find_integral_type),
but for DW_TAG_subrange_type and DW_TAG_set_type, DW_AT_byte_size is supposed to 
override the "normal" size of the specified base type.  Not sure if GCC ever 
generates output like that; it seemed easier to punt for now.  :-P

I'm working on fixing the other things up.

-Sandra



More information about the Gcc-patches mailing list