1
# DP: This implements D language support in the GCC back end, and adds
2
# DP: relevant documentation about the GDC front end (code part).
4
Index: b/src/gcc/config/rs6000/rs6000.c
5
===================================================================
6
--- a/src/gcc/config/rs6000/rs6000.c
7
+++ b/src/gcc/config/rs6000/rs6000.c
8
@@ -25733,6 +25733,7 @@ rs6000_output_function_epilogue (FILE *f
10
|| ! strcmp (language_string, "GNU GIMPLE")
11
|| ! strcmp (language_string, "GNU Go")
12
+ || ! strcmp (language_string, "GNU D")
13
|| ! strcmp (language_string, "libgccjit"))
15
else if (! strcmp (language_string, "GNU F77")
16
Index: b/src/gcc/dwarf2out.c
17
===================================================================
18
--- a/src/gcc/dwarf2out.c
19
+++ b/src/gcc/dwarf2out.c
20
@@ -4754,6 +4754,15 @@ is_ada (void)
21
return lang == DW_LANG_Ada95 || lang == DW_LANG_Ada83;
24
+/* Return TRUE if the language is D. */
28
+ unsigned int lang = get_AT_unsigned (comp_unit_die (), DW_AT_language);
30
+ return lang == DW_LANG_D;
33
/* Remove the specified attribute if present. */
36
@@ -19836,6 +19845,8 @@ gen_compile_unit_die (const char *filena
37
language = DW_LANG_ObjC;
38
else if (strcmp (language_string, "GNU Objective-C++") == 0)
39
language = DW_LANG_ObjC_plus_plus;
40
+ else if (strcmp (language_string, "GNU D") == 0)
41
+ language = DW_LANG_D;
42
else if (dwarf_version >= 5 || !dwarf_strict)
44
if (strcmp (language_string, "GNU Go") == 0)
45
@@ -20804,7 +20815,7 @@ declare_in_namespace (tree thing, dw_die
47
if (ns_context != context_die)
50
+ if (is_fortran () || is_dlang ())
53
gen_decl_die (thing, NULL, ns_context);
54
@@ -20827,7 +20838,7 @@ gen_namespace_die (tree decl, dw_die_ref
56
/* Output a real namespace or module. */
57
context_die = setup_namespace_context (decl, comp_unit_die ());
58
- namespace_die = new_die (is_fortran ()
59
+ namespace_die = new_die (is_fortran () || is_dlang ()
60
? DW_TAG_module : DW_TAG_namespace,
62
/* For Fortran modules defined in different CU don't add src coords. */
63
@@ -20890,7 +20901,7 @@ gen_decl_die (tree decl, tree origin, dw
67
- if (!is_fortran () && !is_ada ())
68
+ if (!is_fortran () && !is_ada () && !is_dlang ())
70
/* The individual enumerators of an enum type get output when we output
71
the Dwarf representation of the relevant enum type itself. */
72
@@ -21361,7 +21372,7 @@ dwarf2out_decl (tree decl)
74
if (debug_info_level <= DINFO_LEVEL_TERSE)
76
- if (!is_fortran () && !is_ada ())
77
+ if (!is_fortran () && !is_ada () && !is_dlang ())
79
if (TREE_STATIC (decl) && decl_function_context (decl))
80
context_die = lookup_decl_die (DECL_CONTEXT (decl));
81
Index: b/src/gcc/gcc.c
82
===================================================================
85
@@ -1103,6 +1103,7 @@ static const struct compiler default_com
86
{".java", "#Java", 0, 0, 0}, {".class", "#Java", 0, 0, 0},
87
{".zip", "#Java", 0, 0, 0}, {".jar", "#Java", 0, 0, 0},
88
{".go", "#Go", 0, 1, 0},
89
+ {".d", "#D", 0, 1, 0}, {".dd", "#D", 0, 1, 0}, {".di", "#D", 0, 1, 0},
90
/* Next come the entries for C. */
91
{".c", "@c", 0, 0, 1},