diff mbox

Use DW_LANG_D for D

Message ID CABOHX+eJRMTku8meUr3vH7HbXQO=frC8kAiMXrpuVPVLEscJ6w@mail.gmail.com
State New
Headers show

Commit Message

Iain Buclaw Nov. 24, 2013, 3:21 p.m. UTC
Hi,

This patches gen_compile_unit_die to use the DW_LANG_D DWARF language
code for D.  Is in relation to some other D language fixes that are
going to be submitted to gdb.

Regards
Iain.

Comments

Cary Coutant Dec. 3, 2013, 7:42 p.m. UTC | #1
> This patches gen_compile_unit_die to use the DW_LANG_D DWARF language
> code for D.  Is in relation to some other D language fixes that are
> going to be submitted to gdb.

Is this for a private front end? I'm not aware of any front ends that
set the language name to "GNU D".

Since it's so trivial, though, I have no problem with this patch for
Stage 3 -- if you do have a separate front end that sets that language
string, then it's arguably a bug fix. If this patch is preparation for
more substantial changes to the GCC tree, however, I suspect you're
going to need to wait for Stage 1 to reopen anyway.

So, if this is a standalone patch, it's OK, but you also need a ChangeLog entry.

-cary
Iain Buclaw Dec. 4, 2013, 5:35 p.m. UTC | #2
On 3 December 2013 19:42, Cary Coutant <ccoutant@google.com> wrote:
>> This patches gen_compile_unit_die to use the DW_LANG_D DWARF language
>> code for D.  Is in relation to some other D language fixes that are
>> going to be submitted to gdb.
>
> Is this for a private front end? I'm not aware of any front ends that
> set the language name to "GNU D".
>
> Since it's so trivial, though, I have no problem with this patch for
> Stage 3 -- if you do have a separate front end that sets that language
> string, then it's arguably a bug fix. If this patch is preparation for
> more substantial changes to the GCC tree, however, I suspect you're
> going to need to wait for Stage 1 to reopen anyway.
>
> So, if this is a standalone patch, it's OK, but you also need a ChangeLog entry.
>
> -cary

The frontend isn't private, but is currently external to GCC.

I've had plans to get the frontend merged for some time now.  And was
adviced last time I submitted the code for review to send patches that
can be merged into GCC prior to re-submitting the frontend - which as
you have already said will have to wait for Stage 1 to reopen.

Will make a changelog entry for the patch.

Regards
Iain.
diff mbox

Patch

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 3448ec4..ddbf5de 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -19257,6 +19257,8 @@  gen_compile_unit_die (const char *filename)
     {
       if (strcmp (language_string, "GNU Ada") == 0)
 	language = DW_LANG_Ada95;
+      else if (strcmp (language_string, "GNU D") == 0)
+	language = DW_LANG_D;
       else if (strcmp (language_string, "GNU Fortran") == 0)
 	language = DW_LANG_Fortran95;
       else if (strcmp (language_string, "GNU Java") == 0)