This is the mail archive of the gcc@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: pruning unused debugging types (enums/PR23336)


Richard Henderson wrote:

> A solution that comes to mind is to have the front-end add dummy
> TYPE_DECL nodes to the BLOCK_VARS list of the function's outer-most
> BLOCK.  If the TYPE_DECL node were marked DECL_ARTIFICIAL and had
> no DECL_NAME, it'd be easy for us to notice that we shouldn't 
> actually emit debug info for the TYPE_DECL itself, but that we
> should consider its TREE_TYPE to be used.
> 
> I'm open to better schemes.  Perhaps a used-type hash table in
> the struct function.

I like the idea, but I think a hash table would be better.  In fact, I
think the best choice would be a hash table during compilation of the
function, transformed into a vector after the closing brace of the
function, so that we do not have the wasted memory associated with
either dummy TYPE_DECLs or hash table entries.  Also, we should do this
only for the kinds of types we tend to lose (maybe casts and enums?), to
keep the extra memory cost to a minimum.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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