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: [PATCH] Fixup T_U_D reading


On Fri, 17 Sep 2010, Richard Henderson wrote:

> On 09/17/2010 07:32 AM, Richard Guenther wrote:
> > On Fri, 17 Sep 2010, Jakub Jelinek wrote:
> > 
> >> On Fri, Sep 17, 2010 at 04:20:33PM +0200, Richard Guenther wrote:
> >>>>>  {
> >>>>> -  TRANSLATION_UNIT_LANGUAGE (expr) = input_string (data_in, ib);
> >>>>> +  TRANSLATION_UNIT_LANGUAGE (expr) = xstrdup (input_string (data_in, ib));
> >>>>>   VEC_safe_push (tree, gc, all_translation_units, expr);
> >>>>>  }
> >>>>
> >>>> I guess it's not worth sharing the language strings somehow??
> >>>
> >>> Well, it's going to be O(number of TUs) strings, so - no.  It might
> >>> be worth transitioning LANG_NAME from a string to an enum maybe ;)
> >>
> >> Perhaps putting there not a const char *, but IDENTIFIER and use
> >> get_identifier ("GNU C") etc.?
> > 
> > Well, as I said, if changing anything changing it to an enum makes
> > more sense than trying to save a few bytes via string sharing
> > (in fact LANG_NAME is also not an identifier).
> 
> For the enum, use DW_LANG_* ?

Yes, certainly one possibility.  I've placed it on my list of things
to do (replace LANG_NAME with that as well - I love the strcmp in
fold-const.c ...).

Richard.


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