This patch adds the D front-end implementation, the only part of the compiler that interacts with GCC directly, and being the parts that I maintain, is something that I can talk about more directly.
For the actual code generation pass, that converts the front-end AST to GCC trees, most parts use a separate Visitor interfaces to do a certain kind of lowering, for instance, types.cc builds *_TYPE trees from AST Type's. The Visitor class is part of the DMD front-end, and is defined in dfrontend/visitor.h. There are also a few interfaces which have their headers in the DMD frontend, but are implemented here because they do something that requires knowledge of the GCC backend (d-target.cc), does something that may not be portable, or differ between D compilers (d-frontend.cc) or are a thin wrapper around something that is managed by GCC (d-diagnostic.cc). Many high level operations result in generation of calls to D runtime library functions (runtime.def), all with require some kind of runtime type information (typeinfo.cc). The compiler also generates functions for registering/deregistering compiled modules with the D runtime library (modules.cc). As well as the D language having it's own built-in functions (intrinsics.cc), we also expose GCC builtins to D code via a `gcc.builtins' module (d-builtins.cc), and give special treatment to a number of UDAs that could be applied to functions (d-attribs.cc). That is roughly the high level jist of how things are currently organized. ftp://ftp.gdcproject.org/patches/v4/02-v4-d-frontend-gdc.patch --- gcc/d/d-attribs.c | 846 +++++++++++ gcc/d/d-builtins.cc | 1162 +++++++++++++++ gcc/d/d-codegen.cc | 2730 +++++++++++++++++++++++++++++++++++ gcc/d/d-convert.cc | 807 +++++++++++ gcc/d/d-diagnostic.cc | 347 +++++ gcc/d/d-frontend.cc | 534 +++++++ gcc/d/d-incpath.cc | 195 +++ gcc/d/d-lang.cc | 1847 ++++++++++++++++++++++++ gcc/d/d-longdouble.cc | 204 +++ gcc/d/d-spec.c | 493 +++++++ gcc/d/d-target-def.h | 20 + gcc/d/d-target.cc | 502 +++++++ gcc/d/d-target.def | 60 + gcc/d/d-target.h | 34 + gcc/d/d-tree.def | 34 + gcc/d/d-tree.h | 669 +++++++++ gcc/d/decl.cc | 2177 ++++++++++++++++++++++++++++ gcc/d/expr.cc | 3158 +++++++++++++++++++++++++++++++++++++++++ gcc/d/imports.cc | 203 +++ gcc/d/intrinsics.cc | 895 ++++++++++++ gcc/d/intrinsics.def | 154 ++ gcc/d/lang-specs.h | 29 + gcc/d/lang.opt | 366 +++++ gcc/d/longdouble.h | 136 ++ gcc/d/modules.cc | 849 +++++++++++ gcc/d/runtime.cc | 315 ++++ gcc/d/runtime.def | 224 +++ gcc/d/toir.cc | 1438 +++++++++++++++++++ gcc/d/typeinfo.cc | 1667 ++++++++++++++++++++++ gcc/d/types.cc | 980 +++++++++++++ gcc/d/verstr.h | 1 + 31 files changed, 23076 insertions(+)