This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR debug/38757 gcc does not emit DW_LANG_C99
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Mark Wielaard <mjw at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Aldy Hernandez <aldyh at redhat dot com>
- Date: Thu, 13 Nov 2014 14:07:15 +0100
- Subject: Re: [PATCH] PR debug/38757 gcc does not emit DW_LANG_C99
- Authentication-results: sourceware.org; auth=none
- References: <1413189233 dot 5534 dot 23 dot camel at bordewijk dot wildebeest dot org> <1415803819 dot 4965 dot 13 dot camel at bordewijk dot wildebeest dot org> <20141112145413 dot GG5026 at tucnak dot redhat dot com> <CAFiYyc0cHUZ95cF+=XGF-OLp9qdJ4-JO46EEP1O5d8uCH-cuqw at mail dot gmail dot com> <20141112153352 dot GI5026 at tucnak dot redhat dot com> <1415807199 dot 4965 dot 16 dot camel at bordewijk dot wildebeest dot org> <20141112163149 dot GJ5026 at tucnak dot redhat dot com> <CAFiYyc17teyVvmxMy+taGk1KXHrTAtp=RRjHax70s1KgLm8nNA at mail dot gmail dot com> <20141113111702 dot GK5026 at tucnak dot redhat dot com> <CAFiYyc2zUjEzjb1xeOZHBbf20zyoD76g5tX+ksEnEWMCcx=CzA at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Nov 13, 2014 at 01:08:44PM +0100, Richard Biener wrote:
> On Thu, Nov 13, 2014 at 12:17 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Thu, Nov 13, 2014 at 12:08:01PM +0100, Richard Biener wrote:
> >> Btw, I have nothing against changing TRANSLATION_UNIT_LANGUAGE
> >> to DW_LANG_* directly - we only use it for choosing the language
> >> of the dwarf unit. This would of course mean to change its initialization
> >> from
> >>
> >> TRANSLATION_UNIT_LANGUAGE (tu) = lang_hooks.name;
> >>
> >> to sth like
> >>
> >> TRANSLATION_UNIT_LANGUAGE (tu) = lang_hooks.dw_lang;
> >>
> >> which means adding a langhook (thus more similar to your original
> >> patch).
> >
> > But that would mean having to include dwarf2 headers in every FE.
>
> Don't see what would be bad about this, but well...
I think strings are better than DWARF constants for middle-end thing,
say if DWARF doesn't make a difference between some language variants but
something different in the middle-end wants, or updating all the backends to
test when C++17 is released and DWARF assigns a language code for it
would be also weird.
If you want an integer instead of strings, it better should be some enum
with major and minor parts in it, so that one can easily test if it is
a C++ family, C family, C/C++ family, Fortran family etc. Still, that would
make things hard for third party frontends, which wouldn't know what values
to use if they don't have a language code in DWARF.
Jakub