|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 05-Dec-2021 | - |
| res/ | H | 05-Dec-2021 | - | 826 | 697 |
| root/ | H | 05-Dec-2021 | - | 7,345 | 4,987 |
| MERGE | H A D | 05-Dec-2021 | 154 | 5 | 3 |
| README.md | H A D | 05-Dec-2021 | 30.1 KiB | 260 | 213 |
| VERSION | H A D | 05-Dec-2021 | 9 | 2 | 1 |
| access.d | H A D | 05-Dec-2021 | 13.1 KiB | 411 | 266 |
| aggregate.d | H A D | 05-Dec-2021 | 25.1 KiB | 770 | 510 |
| aggregate.h | H A D | 05-Dec-2021 | 11.1 KiB | 330 | 237 |
| aliasthis.d | H A D | 05-Dec-2021 | 6.1 KiB | 203 | 138 |
| aliasthis.h | H A D | 05-Dec-2021 | 861 | 32 | 15 |
| apply.d | H A D | 05-Dec-2021 | 5.1 KiB | 190 | 126 |
| arrayop.d | H A D | 05-Dec-2021 | 10.7 KiB | 388 | 279 |
| arraytypes.d | H A D | 05-Dec-2021 | 2.1 KiB | 58 | 43 |
| arraytypes.h | H A D | 05-Dec-2021 | 1.9 KiB | 71 | 31 |
| ast_node.d | H A D | 05-Dec-2021 | 921 | 27 | 7 |
| ast_node.h | H A D | 05-Dec-2021 | 497 | 21 | 7 |
| astcodegen.d | H A D | 05-Dec-2021 | 4.3 KiB | 103 | 86 |
| astenums.d | H A D | 05-Dec-2021 | 12.4 KiB | 392 | 315 |
| attrib.d | H A D | 05-Dec-2021 | 45.6 KiB | 1,519 | 999 |
| attrib.h | H A D | 05-Dec-2021 | 6.9 KiB | 256 | 200 |
| blockexit.d | H A D | 05-Dec-2021 | 16.8 KiB | 538 | 428 |
| builtin.d | H A D | 05-Dec-2021 | 1.1 KiB | 34 | 9 |
| canthrow.d | H A D | 05-Dec-2021 | 7.2 KiB | 245 | 190 |
| chkformat.d | H A D | 05-Dec-2021 | 41.2 KiB | 1,365 | 991 |
| clone.d | H A D | 05-Dec-2021 | 55.3 KiB | 1,696 | 1,117 |
| compiler.d | H A D | 05-Dec-2021 | 1.9 KiB | 58 | 19 |
| compiler.h | H A D | 05-Dec-2021 | 1 KiB | 38 | 17 |
| complex.d | H A D | 05-Dec-2021 | 2.5 KiB | 113 | 84 |
| complex_t.h | H A D | 05-Dec-2021 | 2.1 KiB | 72 | 46 |
| cond.d | H A D | 05-Dec-2021 | 30.3 KiB | 1,005 | 670 |
| cond.h | H A D | 05-Dec-2021 | 2.2 KiB | 99 | 71 |
| constfold.d | H A D | 05-Dec-2021 | 52.2 KiB | 1,826 | 1,655 |
| cparse.d | H A D | 05-Dec-2021 | 131.2 KiB | 4,250 | 2,905 |
| cppmangle.d | H A D | 05-Dec-2021 | 78.9 KiB | 2,541 | 1,655 |
| ctfe.h | H A D | 05-Dec-2021 | 1.6 KiB | 65 | 30 |
| ctfeexpr.d | H A D | 05-Dec-2021 | 66.9 KiB | 2,097 | 1,714 |
| ctorflow.d | H A D | 05-Dec-2021 | 6.1 KiB | 226 | 136 |
| dcast.d | H A D | 05-Dec-2021 | 122.6 KiB | 3,742 | 2,892 |
| dclass.d | H A D | 05-Dec-2021 | 34.4 KiB | 1,140 | 781 |
| declaration.d | H A D | 05-Dec-2021 | 69.8 KiB | 2,324 | 1,701 |
| declaration.h | H A D | 05-Dec-2021 | 28.6 KiB | 854 | 642 |
| delegatize.d | H A D | 05-Dec-2021 | 8.4 KiB | 306 | 202 |
| denum.d | H A D | 05-Dec-2021 | 8.9 KiB | 334 | 230 |
| dimport.d | H A D | 05-Dec-2021 | 11.3 KiB | 359 | 271 |
| dinterpret.d | H A D | 05-Dec-2021 | 247.8 KiB | 7,488 | 6,107 |
| dmacro.d | H A D | 05-Dec-2021 | 15.1 KiB | 436 | 329 |
| dmangle.d | H A D | 05-Dec-2021 | 35.7 KiB | 1,298 | 995 |
| dmodule.d | H A D | 05-Dec-2021 | 52.6 KiB | 1,609 | 1,132 |
| doc.d | H A D | 05-Dec-2021 | 178.1 KiB | 5,389 | 4,193 |
| doc.h | H A D | 05-Dec-2021 | 415 | 16 | 3 |
| dscope.d | H A D | 05-Dec-2021 | 25.6 KiB | 769 | 539 |
| dstruct.d | H A D | 05-Dec-2021 | 17.4 KiB | 611 | 420 |
| dsymbol.d | H A D | 05-Dec-2021 | 75.8 KiB | 2,387 | 1,661 |
| dsymbol.h | H A D | 05-Dec-2021 | 14.8 KiB | 412 | 335 |
| dsymbolsem.d | H A D | 05-Dec-2021 | 239.4 KiB | 6,655 | 5,028 |
| dtemplate.d | H A D | 05-Dec-2021 | 290.3 KiB | 8,416 | 6,163 |
| dtoh.d | H A D | 05-Dec-2021 | 96.9 KiB | 3,226 | 2,406 |
| dversion.d | H A D | 05-Dec-2021 | 5.4 KiB | 216 | 166 |
| entity.d | H A D | 05-Dec-2021 | 147.6 KiB | 2,396 | 2,207 |
| enum.h | H A D | 05-Dec-2021 | 2.2 KiB | 87 | 46 |
| errors.d | H A D | 05-Dec-2021 | 13.6 KiB | 447 | 246 |
| errors.h | H A D | 05-Dec-2021 | 2.7 KiB | 56 | 36 |
| escape.d | H A D | 05-Dec-2021 | 74.3 KiB | 2,291 | 1,594 |
| expression.d | H A D | 05-Dec-2021 | 201.4 KiB | 6,986 | 5,153 |
| expression.h | H A D | 05-Dec-2021 | 33.4 KiB | 1,392 | 1,090 |
| expressionsem.d | H A D | 05-Dec-2021 | 430.8 KiB | 13,059 | 10,178 |
| foreachvar.d | H A D | 05-Dec-2021 | 9 KiB | 324 | 260 |
| func.d | H A D | 05-Dec-2021 | 131.3 KiB | 4,103 | 2,748 |
| globals.d | H A D | 05-Dec-2021 | 23.4 KiB | 641 | 429 |
| globals.h | H A D | 05-Dec-2021 | 15 KiB | 401 | 301 |
| gluelayer.d | H A D | 05-Dec-2021 | 2.1 KiB | 91 | 63 |
| hdrgen.d | H A D | 05-Dec-2021 | 104.6 KiB | 3,957 | 3,452 |
| hdrgen.h | H A D | 05-Dec-2021 | 593 | 22 | 8 |
| iasm.d | H A D | 05-Dec-2021 | 1.5 KiB | 60 | 35 |
| iasmgcc.d | H A D | 05-Dec-2021 | 14.9 KiB | 538 | 349 |
| id.d | H A D | 05-Dec-2021 | 13.2 KiB | 569 | 456 |
| id.h | H A D | 05-Dec-2021 | 416 | 17 | 5 |
| identifier.d | H A D | 05-Dec-2021 | 10 KiB | 363 | 232 |
| identifier.h | H A D | 05-Dec-2021 | 1.1 KiB | 42 | 25 |
| impcnvtab.d | H A D | 05-Dec-2021 | 15.1 KiB | 380 | 249 |
| imphint.d | H A D | 05-Dec-2021 | 2.7 KiB | 92 | 66 |
| import.h | H A D | 05-Dec-2021 | 1.6 KiB | 55 | 32 |
| init.d | H A D | 05-Dec-2021 | 8.7 KiB | 333 | 247 |
| init.h | H A D | 05-Dec-2021 | 2.7 KiB | 118 | 85 |
| initsem.d | H A D | 05-Dec-2021 | 42.4 KiB | 1,269 | 1,016 |
| inline.d | H A D | 05-Dec-2021 | 1.2 KiB | 31 | 7 |
| intrange.d | H A D | 05-Dec-2021 | 27.3 KiB | 920 | 708 |
| intrange.h | H A D | 05-Dec-2021 | 7.2 KiB | 178 | 84 |
| json.d | H A D | 05-Dec-2021 | 28.8 KiB | 1,086 | 912 |
| json.h | H A D | 05-Dec-2021 | 539 | 20 | 6 |
| lambdacomp.d | H A D | 05-Dec-2021 | 13.6 KiB | 496 | 362 |
| lexer.d | H A D | 05-Dec-2021 | 98.5 KiB | 3,274 | 2,830 |
| lexer.h | H A D | 05-Dec-2021 | 2.2 KiB | 76 | 54 |
| macro.h | H A D | 05-Dec-2021 | 1.1 KiB | 39 | 19 |
| mangle.h | H A D | 05-Dec-2021 | 1 KiB | 35 | 17 |
| mars.h | H A D | 05-Dec-2021 | 2.7 KiB | 94 | 26 |
| module.h | H A D | 05-Dec-2021 | 6.2 KiB | 175 | 120 |
| mtype.d | H A D | 05-Dec-2021 | 207.1 KiB | 7,356 | 5,539 |
| mtype.h | H A D | 05-Dec-2021 | 24.2 KiB | 929 | 775 |
| nogc.d | H A D | 05-Dec-2021 | 7.6 KiB | 267 | 217 |
| nspace.d | H A D | 05-Dec-2021 | 5.1 KiB | 171 | 99 |
| nspace.h | H A D | 05-Dec-2021 | 984 | 33 | 16 |
| ob.d | H A D | 05-Dec-2021 | 78.8 KiB | 2,681 | 1,964 |
| objc.d | H A D | 05-Dec-2021 | 27.9 KiB | 954 | 575 |
| objc.h | H A D | 05-Dec-2021 | 2.5 KiB | 85 | 58 |
| opover.d | H A D | 05-Dec-2021 | 67.6 KiB | 1,844 | 1,402 |
| optimize.d | H A D | 05-Dec-2021 | 40.6 KiB | 1,187 | 973 |
| parse.d | H A D | 05-Dec-2021 | 306.7 KiB | 9,366 | 7,578 |
| parse.h | H A D | 05-Dec-2021 | 6.8 KiB | 193 | 161 |
| parsetimevisitor.d | H A D | 05-Dec-2021 | 16.9 KiB | 298 | 229 |
| permissivevisitor.d | H A D | 05-Dec-2021 | 949 | 29 | 14 |
| printast.d | H A D | 05-Dec-2021 | 4.4 KiB | 174 | 129 |
| safe.d | H A D | 05-Dec-2021 | 7.2 KiB | 229 | 143 |
| sapply.d | H A D | 05-Dec-2021 | 4.1 KiB | 181 | 130 |
| scope.h | H A D | 05-Dec-2021 | 5.7 KiB | 151 | 102 |
| semantic2.d | H A D | 05-Dec-2021 | 25.6 KiB | 775 | 564 |
| semantic3.d | H A D | 05-Dec-2021 | 64 KiB | 1,625 | 1,202 |
| sideeffect.d | H A D | 05-Dec-2021 | 13.1 KiB | 419 | 271 |
| statement.d | H A D | 05-Dec-2021 | 54.6 KiB | 2,054 | 1,503 |
| statement.h | H A D | 05-Dec-2021 | 20.6 KiB | 767 | 584 |
| statement_rewrite_walker.d | H A D | 05-Dec-2021 | 4.4 KiB | 195 | 150 |
| statement_rewrite_walker.h | H A D | 05-Dec-2021 | 4.4 KiB | 173 | 155 |
| statementsem.d | H A D | 05-Dec-2021 | 168.9 KiB | 4,996 | 3,869 |
| staticassert.d | H A D | 05-Dec-2021 | 1.7 KiB | 67 | 41 |
| staticassert.h | H A D | 05-Dec-2021 | 737 | 29 | 14 |
| staticcond.d | H A D | 05-Dec-2021 | 12.9 KiB | 425 | 337 |
| stmtstate.d | H A D | 05-Dec-2021 | 3.8 KiB | 143 | 106 |
| target.d | H A D | 05-Dec-2021 | 14.8 KiB | 439 | 158 |
| target.h | H A D | 05-Dec-2021 | 6.3 KiB | 210 | 158 |
| template.h | H A D | 05-Dec-2021 | 9.8 KiB | 316 | 206 |
| templateparamsem.d | H A D | 05-Dec-2021 | 5.9 KiB | 191 | 137 |
| tokens.d | H A D | 05-Dec-2021 | 23.6 KiB | 1,023 | 907 |
| tokens.h | H A D | 05-Dec-2021 | 6.6 KiB | 263 | 181 |
| traits.d | H A D | 05-Dec-2021 | 66.2 KiB | 2,203 | 1,777 |
| transitivevisitor.d | H A D | 05-Dec-2021 | 29.5 KiB | 1,208 | 908 |
| typesem.d | H A D | 05-Dec-2021 | 161.7 KiB | 4,897 | 3,874 |
| typinf.d | H A D | 05-Dec-2021 | 1 KiB | 29 | 5 |
| utf.d | H A D | 05-Dec-2021 | 15.6 KiB | 562 | 464 |
| utf.h | H A D | 05-Dec-2021 | 6.8 KiB | 118 | 93 |
| utils.d | H A D | 05-Dec-2021 | 7.1 KiB | 299 | 190 |
| version.h | H A D | 05-Dec-2021 | 1,017 | 42 | 24 |
| visitor.d | H A D | 05-Dec-2021 | 10 KiB | 255 | 201 |
| visitor.h | H A D | 05-Dec-2021 | 26.4 KiB | 661 | 585 |
README.md
1# DMD Source code
2
3This is the source code to the DMD compiler
4for the D Programming Language defined in the documents at
5http://dlang.org/
6
7These sources are free, they are redistributable and modifiable
8under the terms of the Boost Software License, Version 1.0.
9The terms of this license are in the file boostlicense.txt,
10or see http://www.boost.org/LICENSE_1_0.txt.
11
12If a particular file has a different license in it, that overrides
13this license for that file.
14
15-Walter Bright
16
17## Directory structure
18
19| Folder | Purpose |
20|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
21| [dmd/](https://github.com/dlang/dmd/tree/master/src/dmd) | The dmd driver and front-end |
22| [dmd/backend/](https://github.com/dlang/dmd/tree/master/src/dmd/backend) | Code generation for x86 or x86-64. Shared by the [Digital Mars C compiler](https://github.com/DigitalMars/Compiler/), but not [LDC](https://github.com/ldc-developers/ldc) or [GDC](https://gdcproject.org/). |
23| [dmd/root/](https://github.com/dlang/dmd/tree/master/src/dmd/root) | Meant as a portable utility library, but ["it wasn't very good and the only project left using it is dmd"](https://github.com/dlang/dmd/pull/9844#issuecomment-498479516). |
24
25DMD has a mostly flat directory structure, so this section aims to divide all source files into logical groups for easier navigation.
26The groups are roughly ordered by how late they appear in the compilation process.
27Note that these groups have no strict meaning, the category assignments are a bit subjective.
28
29### Driver
30
31| File | Purpose |
32|-----------------------------------------------------------------------------|-----------------------------------------------------------------------|
33| [mars.d](https://github.com/dlang/dmd/blob/master/src/dmd/mars.d) | The entry point. Contains `main`. |
34| [cli.d](https://github.com/dlang/dmd/blob/master/src/dmd/cli.d) | Define the command line interface |
35| [globals.d](https://github.com/dlang/dmd/blob/master/src/dmd/globals.d) | Define a structure storing command line options |
36| [dinifile.d](https://github.com/dlang/dmd/blob/master/src/dmd/dinifile.d) | Parse settings from .ini file (`sc.ini` / `dmd.conf`) |
37| [vsoptions.d](https://github.com/dlang/dmd/blob/master/src/dmd/vsoptions.d) | Detect the Microsoft Visual Studio toolchain for linking |
38| [frontend.d](https://github.com/dlang/dmd/blob/master/src/dmd/frontend.d) | An interface for using DMD as a library |
39| [errors.d](https://github.com/dlang/dmd/blob/master/src/dmd/errors.d) | Error reporting functionality |
40| [target.d](https://github.com/dlang/dmd/blob/master/src/dmd/target.d) | Manage target-specific parameters for cross-compiling (for LDC/GDC) |
41| [compiler.d](https://github.com/dlang/dmd/blob/master/src/dmd/compiler.d) | Describe a back-end compiler and implements compiler-specific actions |
42
43### Lexing / parsing
44
45| File | Purpose |
46|-----------------------------------------------------------------------|----------------------------------------------------------------------|
47| [lexer.d](https://github.com/dlang/dmd/blob/master/src/dmd/lexer.d) | Convert source code into tokens for the D and ImportC parsers |
48| [entity.d](https://github.com/dlang/dmd/blob/master/src/dmd/entity.d) | Define "\\&Entity;" escape sequence for strings / character literals |
49| [tokens.d](https://github.com/dlang/dmd/blob/master/src/dmd/tokens.d) | Define lexical tokens. |
50| [parse.d](https://github.com/dlang/dmd/blob/master/src/dmd/parse.d) | D parser, converting tokens into an Abstract Syntax Tree (AST) |
51| [cparse.d](https://github.com/dlang/dmd/blob/master/src/dmd/cparse.d) | ImportC parser, converting tokens into an Abstract Syntax Tree (AST) |
52
53### Semantic analysis
54
55**Symbols and declarations**
56
57| File | Purpose |
58|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
59| [dsymbol.d](https://github.com/dlang/dmd/blob/master/src/dmd/dsymbol.d) | Base class for a D symbol, e.g. a variable, function, module, enum etc. |
60| [identifier.d](https://github.com/dlang/dmd/blob/master/src/dmd/identifier.d) | Represents the name of a `Dsymbol` |
61| [id.d](https://github.com/dlang/dmd/blob/master/src/dmd/id.d) | Define strings for pre-defined identifiers (e.g. `sizeof`, `string`) |
62| [dscope.d](https://github.com/dlang/dmd/blob/master/src/dmd/dscope.d) | Define a 'scope' on which symbol lookup can be performed |
63| [dtemplate.d](https://github.com/dlang/dmd/blob/master/src/dmd/dtemplate.d) | A template declaration or instance |
64| [dmodule.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmodule.d) | Define a package and module |
65| [mtype.d](https://github.com/dlang/dmd/blob/master/src/dmd/mtype.d) | Define expression types such as `int`, `char[]`, `void function()` |
66| [arraytypes.d](https://github.com/dlang/dmd/blob/master/src/dmd/arraytypes.d) | For certain Declaration nodes of type `T`, provides aliases for `Array!T` |
67| [declaration.d](https://github.com/dlang/dmd/blob/master/src/dmd/declaration.d) | Misc. declarations of `alias`, variables, type tuples, `ClassInfo` etc. |
68| [denum.d](https://github.com/dlang/dmd/blob/master/src/dmd/denum.d) | Defines `enum` declarations and enum members |
69| [attrib.d](https://github.com/dlang/dmd/blob/master/src/dmd/nogc.d) | Declarations of 'attributes' such as `private`, `pragma()`, `immutable`, `@UDA`, `align`, `extern(C++)` and more |
70| [func.d](https://github.com/dlang/dmd/blob/master/src/dmd/func.d) | Define a function declaration (includes function literals, `invariant`, `unittest`) |
71| [dversion.d](https://github.com/dlang/dmd/blob/master/src/dmd/dversion.d) | Defines a version symbol, e.g. `version = ident`, `debug = ident` |
72
73**AST nodes**
74
75| File | Purpose |
76|-----------------------------------------------------------------------------------|-------------------------------------------------------------|
77| [ast_node.d](https://github.com/dlang/dmd/blob/master/src/dmd/ast_node.d) | Define an abstract AST node class |
78| [astbase.d](https://github.com/dlang/dmd/blob/master/src/dmd/astbase.d) | Namespace of AST nodes that can be produced by the parser |
79| [astcodegen.d](https://github.com/dlang/dmd/blob/master/src/dmd/astcodegen.d) | Namespace of AST nodes of a AST ready for code generation |
80| [astenums.d](https://github.com/dlang/dmd/blob/master/src/dmd/astenums.d) | Enums common to DMD and AST |
81| [expression.d](https://github.com/dlang/dmd/blob/master/src/dmd/expression.d) | Define expression AST nodes |
82| [statement.d](https://github.com/dlang/dmd/blob/master/src/dmd/statement.d) | Define statement AST nodes |
83| [staticassert.d](https://github.com/dlang/dmd/blob/master/src/dmd/staticassert.d) | Define a `static assert` AST node |
84| [aggregate.d](https://github.com/dlang/dmd/blob/master/src/dmd/aggregate.d) | Define an aggregate (`struct`, `union` or `class`) AST node |
85| [dclass.d](https://github.com/dlang/dmd/blob/master/src/dmd/dclass.d) | Define a `class` AST node |
86| [dstruct.d](https://github.com/dlang/dmd/blob/master/src/dmd/dstruct.d) | Define a `struct` or `union` AST node |
87| [init.d](https://github.com/dlang/dmd/blob/master/src/dmd/init.d) | Define variable initializers |
88
89**AST visitors**
90
91| File | Purpose |
92|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
93| [parsetimevisitor.d](https://github.com/dlang/dmd/blob/master/src/dmd/parsetimevisitor.d) | General [visitor](https://en.wikipedia.org/wiki/Visitor_pattern) for AST nodes |
94| [permissivevisitor.d](https://github.com/dlang/dmd/blob/master/src/dmd/permissivevisitor.d) | Subclass of ParseTimeVisitor that does not `assert(0)` on unimplemented nodes |
95| [strictvisitor.d](https://github.com/dlang/dmd/blob/master/src/dmd/strictvisitor.d) | Visitor that forces derived classes to implement `visit` for every possible node |
96| [visitor.d](https://github.com/dlang/dmd/blob/master/src/dmd/visitor.d) | A visitor implementing `visit` for all nodes present in the compiler |
97| [transitivevisitor.d](https://github.com/dlang/dmd/blob/master/src/dmd/transitivevisitor.d) | Provide a mixin template with visit methods for the parse time AST |
98| [apply.d](https://github.com/dlang/dmd/blob/master/src/dmd/apply.d) | Depth-first expression visitor |
99| [sapply.d](https://github.com/dlang/dmd/blob/master/src/dmd/sapply.d) | Depth-first statement visitor |
100| [statement_rewrite_walker.d](https://github.com/dlang/dmd/blob/master/src/dmd/statement_rewrite_walker.d) | Statement visitor that allows replacing the currently visited node |
101
102**Semantic passes**
103
104| File | Purpose |
105|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
106| [dsymbolsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/dsymbolsem.d) | Do semantic 1 pass (symbol identifiers/types) |
107| [semantic2.d](https://github.com/dlang/dmd/blob/master/src/dmd/semantic2.d) | Do semantic 2 pass (symbol initializers) |
108| [semantic3.d](https://github.com/dlang/dmd/blob/master/src/dmd/semantic3.d) | Do semantic 3 pass (function bodies) |
109| [inline.d](https://github.com/dlang/dmd/blob/master/src/dmd/inline.d) | Do inline pass (optimization pass that dmd does in the front-end) |
110| [inlinecost.d](https://github.com/dlang/dmd/blob/master/src/dmd/inlinecost.d) | Compute the cost of inlining a function call. |
111| [expressionsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/expressionsem.d) | Do semantic analysis for expressions |
112| [statementsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/statementsem.d) | Do semantic analysis for statements |
113| [initsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/initsem.d) | Do semantic analysis for initializers |
114| [templateparamsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/templateparamsem.d) | Do semantic analysis for template parameters |
115| [typesem.d](https://github.com/dlang/dmd/blob/master/src/dmd/typesem.d) | Do semantic analysis for types |
116
117**Semantic helpers**
118
119| File | Purpose |
120|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
121| [opover.d](https://github.com/dlang/dmd/blob/master/src/dmd/opover.d) | Operator overloading |
122| [clone.d](https://github.com/dlang/dmd/blob/master/src/dmd/dsymbolsem.d) | Generate automatic `opEquals`, `opAssign` and constructors for structs |
123| [blockexit.d](https://github.com/dlang/dmd/blob/master/src/dmd/blockexit.d) | Find out in what ways control flow can exit a block |
124| [ctorflow.d](https://github.com/dlang/dmd/blob/master/src/dmd/ctorflow.d) | Control flow in constructors |
125| [constfold.d](https://github.com/dlang/dmd/blob/master/src/dmd/constfold.d) | Do constant folding of arithmetic expressions |
126| [optimize.d](https://github.com/dlang/dmd/blob/master/src/dmd/optimize.d) | Do constant folding more generally |
127| [dcast.d](https://github.com/dlang/dmd/blob/master/src/dmd/dcast.d) | Implicit or explicit cast(), finding common types e.g. in `x ? a : b`, integral promotions |
128| [impcnvtab.d](https://github.com/dlang/dmd/blob/master/src/dmd/impcnvtab.d) | Define an implicit conversion table for basic types |
129| [sideeffect.d](https://github.com/dlang/dmd/blob/master/src/dmd/sideeffect.d) | Extract side-effects of expressions for certain lowerings. |
130
131**Compile Time Function Execution (CTFE)**
132
133| File | Purpose |
134|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
135| [dinterpret.d](https://github.com/dlang/dmd/blob/master/src/dmd/dinterpret.d) | CTFE entry point |
136| [ctfeexpr.d](https://github.com/dlang/dmd/blob/master/src/dmd/ctfeexpr.d) | CTFE for expressions involving pointers, slices, array concatenation etc. |
137| [builtin.d](https://github.com/dlang/dmd/blob/master/src/dmd/builtin.d) | Allow CTFE of certain external functions (`core.math`, `std.math` and `core.bitop`) |
138
139### Specific language features
140
141**Attribute checks**
142
143| File | Purpose |
144|---------------------------------------------------------------------------|----------------------------------------|
145| [nogc.d](https://github.com/dlang/dmd/blob/master/src/dmd/nogc.d) | `@nogc` checks |
146| [safe.d](https://github.com/dlang/dmd/blob/master/src/dmd/safe.d) | `@safe` checks |
147| [canthrow.d](https://github.com/dlang/dmd/blob/master/src/dmd/canthrow.d) | `nothrow` checks |
148| [escape.d](https://github.com/dlang/dmd/blob/master/src/dmd/escape.d) | `scope` checks |
149| [access.d](https://github.com/dlang/dmd/blob/master/src/dmd/access.d) | `public` / `private` checks |
150| [ob.d](https://github.com/dlang/dmd/blob/master/src/dmd/ob.d) | Ownership / borrowing (`@live`) checks |
151
152**Inline Assembly**
153
154| File | Purpose |
155|-------------------------------------------------------------------------|-------------------------------------------|
156| [iasm.d](https://github.com/dlang/dmd/blob/master/src/dmd/iasm.d) | Inline assembly depending on the compiler |
157| [iasmdmd.d](https://github.com/dlang/dmd/blob/master/src/dmd/iasmdmd.d) | Inline assembly for DMD |
158| [iasmgcc.d](https://github.com/dlang/dmd/blob/master/src/dmd/iasmgcc.d) | Inline assembly for GDC |
159
160**Other**
161
162| File | Purpose |
163|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
164| [aliasthis.d](https://github.com/dlang/dmd/blob/master/src/dmd/aliasthis.d) | Resolve implicit conversions for `alias X this` |
165| [traits.d](https://github.com/dlang/dmd/blob/master/src/dmd/traits.d) | `__traits()` |
166| [lambdacomp.d](https://github.com/dlang/dmd/blob/master/src/dmd/lambdacomp.d) | `__traits(isSame, x => y, z => w)` |
167| [cond.d](https://github.com/dlang/dmd/blob/master/src/dmd/cond.d) | Evaluate `static if`, `version` `debug ` |
168| [staticcond.d](https://github.com/dlang/dmd/blob/master/src/dmd/staticcond.d) | Lazily evaluate static conditions for `static if`, `static assert` and template constraints |
169| [delegatize.d](https://github.com/dlang/dmd/blob/master/src/dmd/delegatize.d) | Converts expression to delegates for `lazy` parameters |
170| [eh.d](https://github.com/dlang/dmd/blob/master/src/dmd/eh.d) | Generate tables for exception handling |
171| [nspace.d](https://github.com/dlang/dmd/blob/master/src/dmd/nspace.d) | Namespace for `extern (C++, Module)` |
172| [intrange.d](https://github.com/dlang/dmd/blob/master/src/dmd/intrange.d) | [Value range propagation](https://digitalmars.com/articles/b62.html) |
173| [dimport.d](https://github.com/dlang/dmd/blob/master/src/dmd/dimport.d) | Renamed imports (`import aliasSymbol = pkg1.pkg2.symbol`) |
174| [arrayop.d](https://github.com/dlang/dmd/blob/master/src/dmd/arrayop.d) | Array operations (`a[] = b[] + c[]`) |
175| [typinf.d](https://github.com/dlang/dmd/blob/master/src/dmd/typinf.d) | Generate typeinfo for `typeid()` (as well as internals) |
176
177| File | Purpose |
178|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------|
179| [chkformat.d](https://github.com/dlang/dmd/blob/master/src/dmd/chkformat.d) | Validate arguments with format specifiers for `printf` / `scanf` etc. |
180| [imphint.d](https://github.com/dlang/dmd/blob/master/src/dmd/imphint.d) | Give a suggestion to e.g. `import std.stdio` when `writeln` could not be resolved. |
181
182### Library files
183
184| File | Purpose |
185|-------------------------------------------------------------------------------|------------------------------------------------------|
186| [lib.d](https://github.com/dlang/dmd/blob/master/src/dmd/lib.d) | Abstract library class |
187| [libelf.d](https://github.com/dlang/dmd/blob/master/src/dmd/libelf.d) | Library in ELF format (Unix) |
188| [libmach.d](https://github.com/dlang/dmd/blob/master/src/dmd/libmach.d) | Library in Mach-O format (macOS) |
189| [libmscoff.d](https://github.com/dlang/dmd/blob/master/src/dmd/libmscoff.d) | Library in COFF format (32/64-bit Windows) |
190| [libomf.d](https://github.com/dlang/dmd/blob/master/src/dmd/libomf.d) | Library in OMF format (legacy 32-bit Windows) |
191| [scanelf.d](https://github.com/dlang/dmd/blob/master/src/dmd/scanelf.d) | Extract symbol names from a library in ELF format |
192| [scanmach.d](https://github.com/dlang/dmd/blob/master/src/dmd/scanmach.d) | Extract symbol names from a library in Mach-O format |
193| [scanmscoff.d](https://github.com/dlang/dmd/blob/master/src/dmd/scanmscoff.d) | Extract symbol names from a library in COFF format |
194| [scanomf.d](https://github.com/dlang/dmd/blob/master/src/dmd/scanomf.d) | Extract symbol names from a library in OMF format |
195
196### Code generation / back-end interfacing
197
198| File | Purpose |
199|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
200| [dmsc.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmsc.d) | Configures and initializes the back-end |
201| [toobj.d](https://github.com/dlang/dmd/blob/master/src/dmd/toobj.d) | Convert an AST that went through all semantic phases into an object file |
202| [toir.d](https://github.com/dlang/dmd/blob/master/src/dmd/toir.d) | Convert Dsymbols intermediate representation |
203| [e2ir.d](https://github.com/dlang/dmd/blob/master/src/dmd/e2ir.d) | Convert Expressions to intermediate representation |
204| [s2ir.d](https://github.com/dlang/dmd/blob/master/src/dmd/s2ir.d) | Convert Statements to intermediate representation |
205| [stmtstate.d](https://github.com/dlang/dmd/blob/master/src/dmd/stmtstate.d) | Used to help transform statement AST into flow graph |
206| [toctype.d](https://github.com/dlang/dmd/blob/master/src/dmd/toctype.d) | Convert a D type to a type the back-end understands |
207| [tocsym.d](https://github.com/dlang/dmd/blob/master/src/dmd/tocsym.d) | Convert a D symbol to a symbol the linker understands (with mangled name) |
208| [argtypes_x86.d](https://github.com/dlang/dmd/blob/master/src/dmd/argtypes_x86.d) | Convert a D type into simple (register) types for the 32-bit x86 ABI |
209| [argtypes_sysv_x64.d](https://github.com/dlang/dmd/blob/master/src/dmd/argtypes_sysv_x64.d) | 'argtypes' for the x86_64 System V ABI |
210| [argtypes_aarch64.d](https://github.com/dlang/dmd/blob/master/src/dmd/argtypes_aarch64.d) | 'argtypes' for the AArch64 ABI |
211| [glue.d](https://github.com/dlang/dmd/blob/master/src/dmd/glue.d) | Generate the object file for function declarations |
212| [gluelayer.d](https://github.com/dlang/dmd/blob/master/src/dmd/gluelayer.d) | Declarations for back-end functions that the front-end invokes |
213| [todt.d](https://github.com/dlang/dmd/blob/master/src/dmd/todt.d) | Convert initializers into structures that the back-end will add to the data segment |
214| [tocvdebug.d](https://github.com/dlang/dmd/blob/master/src/dmd/tovcdebug.d) | Generate debug info in the CV4 debug format. |
215| [objc.d](https://github.com/dlang/dmd/blob/master/src/dmd/objc.d) | Objective-C interfacing |
216| [objc_glue.d](https://github.com/dlang/dmd/blob/master/src/dmd/objc_glue.d) | Glue code for Objective-C interop. |
217
218**Name mangling**
219
220| File | Purpose |
221|-----------------------------------------------------------------------------------|------------------------------------------------------------------|
222| [cppmangle.d](https://github.com/dlang/dmd/blob/master/src/dmd/cppmangle.d) | C++ name mangling |
223| [cppmanglewin.d](https://github.com/dlang/dmd/blob/master/src/dmd/cppmanglewin.d) | C++ name mangling for Windows |
224| [dmangle.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmangle.d) | D [name mangling](https://dlang.org/spec/abi.html#name_mangling) |
225
226### Linking
227
228| File | Purpose |
229|-------------------------------------------------------------------|-----------------------------------------|
230| [link.d](https://github.com/dlang/dmd/blob/master/src/dmd/link.d) | Invoke the linker as a separate process |
231
232### Special output
233
234| File | Purpose |
235|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
236| [doc.d](https://github.com/dlang/dmd/blob/master/src/dmd/doc.d) | [Documentation generation](https://dlang.org/spec/ddoc.html) |
237| [dmacro.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmacro.d) | DDoc macro processing |
238| [hdrgen.d](https://github.com/dlang/dmd/blob/master/src/dmd/hdrgen.d) | Convert an AST into D source code for `.di` header generation, as well as `-vcg-ast` and error messages |
239| [json.d](https://github.com/dlang/dmd/blob/master/src/dmd/json.d) | Describe the module in a `.json` file for the `-X` flag |
240| [dtoh.d](https://github.com/dlang/dmd/blob/master/src/dmd/dtoh.d) | C++ header generation from D source files |
241
242### Utility
243
244Note: many other utilities are in [dmd/root](https://github.com/dlang/dmd/tree/master/src/dmd/root).
245
246| File | Purpose |
247|-----------------------------------------------------------------------------|---------------------------------------------------|
248| [env.d](https://github.com/dlang/dmd/blob/master/src/dmd/env.d) | Modify environment variables |
249| [console.d](https://github.com/dlang/dmd/blob/master/src/dmd/console.d) | Print error messages in color |
250| [utf.d](https://github.com/dlang/dmd/blob/master/src/dmd/utf.d) | Encoding/decoding Unicode text |
251| [filecache.d](https://github.com/dlang/dmd/blob/master/src/dmd/filecache.d) | Keep file contents in memory |
252| [utils.d](https://github.com/dlang/dmd/blob/master/src/dmd/utils.d) | Utility functions related to files and file paths |
253| [complex.d](https://github.com/dlang/dmd/blob/master/src/dmd/complex.d) | A complex number type |
254
255| File | Purpose |
256|---------------------------------------------------------------------------------|---------------------------------------------------------------|
257| [asttypename.d](https://github.com/dlang/dmd/blob/master/src/dmd/asttypename.d) | Print the internal name of an AST node (for debugging only) |
258| [printast.d](https://github.com/dlang/dmd/blob/master/src/dmd/printast.d) | Print the AST data structure |
259| [foreachvar.d](https://github.com/dlang/dmd/blob/master/src/dmd/foreachvar.d) | Used in `ob.d` to iterate over all variables in an expression |
260