• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..05-Dec-2021-

res/H05-Dec-2021-826697

root/H05-Dec-2021-7,3454,987

MERGEH A D05-Dec-2021154 53

README.mdH A D05-Dec-202130.1 KiB260213

VERSIONH A D05-Dec-20219 21

access.dH A D05-Dec-202113.1 KiB411266

aggregate.dH A D05-Dec-202125.1 KiB770510

aggregate.hH A D05-Dec-202111.1 KiB330237

aliasthis.dH A D05-Dec-20216.1 KiB203138

aliasthis.hH A D05-Dec-2021861 3215

apply.dH A D05-Dec-20215.1 KiB190126

arrayop.dH A D05-Dec-202110.7 KiB388279

arraytypes.dH A D05-Dec-20212.1 KiB5843

arraytypes.hH A D05-Dec-20211.9 KiB7131

ast_node.dH A D05-Dec-2021921 277

ast_node.hH A D05-Dec-2021497 217

astcodegen.dH A D05-Dec-20214.3 KiB10386

astenums.dH A D05-Dec-202112.4 KiB392315

attrib.dH A D05-Dec-202145.6 KiB1,519999

attrib.hH A D05-Dec-20216.9 KiB256200

blockexit.dH A D05-Dec-202116.8 KiB538428

builtin.dH A D05-Dec-20211.1 KiB349

canthrow.dH A D05-Dec-20217.2 KiB245190

chkformat.dH A D05-Dec-202141.2 KiB1,365991

clone.dH A D05-Dec-202155.3 KiB1,6961,117

compiler.dH A D05-Dec-20211.9 KiB5819

compiler.hH A D05-Dec-20211 KiB3817

complex.dH A D05-Dec-20212.5 KiB11384

complex_t.hH A D05-Dec-20212.1 KiB7246

cond.dH A D05-Dec-202130.3 KiB1,005670

cond.hH A D05-Dec-20212.2 KiB9971

constfold.dH A D05-Dec-202152.2 KiB1,8261,655

cparse.dH A D05-Dec-2021131.2 KiB4,2502,905

cppmangle.dH A D05-Dec-202178.9 KiB2,5411,655

ctfe.hH A D05-Dec-20211.6 KiB6530

ctfeexpr.dH A D05-Dec-202166.9 KiB2,0971,714

ctorflow.dH A D05-Dec-20216.1 KiB226136

dcast.dH A D05-Dec-2021122.6 KiB3,7422,892

dclass.dH A D05-Dec-202134.4 KiB1,140781

declaration.dH A D05-Dec-202169.8 KiB2,3241,701

declaration.hH A D05-Dec-202128.6 KiB854642

delegatize.dH A D05-Dec-20218.4 KiB306202

denum.dH A D05-Dec-20218.9 KiB334230

dimport.dH A D05-Dec-202111.3 KiB359271

dinterpret.dH A D05-Dec-2021247.8 KiB7,4886,107

dmacro.dH A D05-Dec-202115.1 KiB436329

dmangle.dH A D05-Dec-202135.7 KiB1,298995

dmodule.dH A D05-Dec-202152.6 KiB1,6091,132

doc.dH A D05-Dec-2021178.1 KiB5,3894,193

doc.hH A D05-Dec-2021415 163

dscope.dH A D05-Dec-202125.6 KiB769539

dstruct.dH A D05-Dec-202117.4 KiB611420

dsymbol.dH A D05-Dec-202175.8 KiB2,3871,661

dsymbol.hH A D05-Dec-202114.8 KiB412335

dsymbolsem.dH A D05-Dec-2021239.4 KiB6,6555,028

dtemplate.dH A D05-Dec-2021290.3 KiB8,4166,163

dtoh.dH A D05-Dec-202196.9 KiB3,2262,406

dversion.dH A D05-Dec-20215.4 KiB216166

entity.dH A D05-Dec-2021147.6 KiB2,3962,207

enum.hH A D05-Dec-20212.2 KiB8746

errors.dH A D05-Dec-202113.6 KiB447246

errors.hH A D05-Dec-20212.7 KiB5636

escape.dH A D05-Dec-202174.3 KiB2,2911,594

expression.dH A D05-Dec-2021201.4 KiB6,9865,153

expression.hH A D05-Dec-202133.4 KiB1,3921,090

expressionsem.dH A D05-Dec-2021430.8 KiB13,05910,178

foreachvar.dH A D05-Dec-20219 KiB324260

func.dH A D05-Dec-2021131.3 KiB4,1032,748

globals.dH A D05-Dec-202123.4 KiB641429

globals.hH A D05-Dec-202115 KiB401301

gluelayer.dH A D05-Dec-20212.1 KiB9163

hdrgen.dH A D05-Dec-2021104.6 KiB3,9573,452

hdrgen.hH A D05-Dec-2021593 228

iasm.dH A D05-Dec-20211.5 KiB6035

iasmgcc.dH A D05-Dec-202114.9 KiB538349

id.dH A D05-Dec-202113.2 KiB569456

id.hH A D05-Dec-2021416 175

identifier.dH A D05-Dec-202110 KiB363232

identifier.hH A D05-Dec-20211.1 KiB4225

impcnvtab.dH A D05-Dec-202115.1 KiB380249

imphint.dH A D05-Dec-20212.7 KiB9266

import.hH A D05-Dec-20211.6 KiB5532

init.dH A D05-Dec-20218.7 KiB333247

init.hH A D05-Dec-20212.7 KiB11885

initsem.dH A D05-Dec-202142.4 KiB1,2691,016

inline.dH A D05-Dec-20211.2 KiB317

intrange.dH A D05-Dec-202127.3 KiB920708

intrange.hH A D05-Dec-20217.2 KiB17884

json.dH A D05-Dec-202128.8 KiB1,086912

json.hH A D05-Dec-2021539 206

lambdacomp.dH A D05-Dec-202113.6 KiB496362

lexer.dH A D05-Dec-202198.5 KiB3,2742,830

lexer.hH A D05-Dec-20212.2 KiB7654

macro.hH A D05-Dec-20211.1 KiB3919

mangle.hH A D05-Dec-20211 KiB3517

mars.hH A D05-Dec-20212.7 KiB9426

module.hH A D05-Dec-20216.2 KiB175120

mtype.dH A D05-Dec-2021207.1 KiB7,3565,539

mtype.hH A D05-Dec-202124.2 KiB929775

nogc.dH A D05-Dec-20217.6 KiB267217

nspace.dH A D05-Dec-20215.1 KiB17199

nspace.hH A D05-Dec-2021984 3316

ob.dH A D05-Dec-202178.8 KiB2,6811,964

objc.dH A D05-Dec-202127.9 KiB954575

objc.hH A D05-Dec-20212.5 KiB8558

opover.dH A D05-Dec-202167.6 KiB1,8441,402

optimize.dH A D05-Dec-202140.6 KiB1,187973

parse.dH A D05-Dec-2021306.7 KiB9,3667,578

parse.hH A D05-Dec-20216.8 KiB193161

parsetimevisitor.dH A D05-Dec-202116.9 KiB298229

permissivevisitor.dH A D05-Dec-2021949 2914

printast.dH A D05-Dec-20214.4 KiB174129

safe.dH A D05-Dec-20217.2 KiB229143

sapply.dH A D05-Dec-20214.1 KiB181130

scope.hH A D05-Dec-20215.7 KiB151102

semantic2.dH A D05-Dec-202125.6 KiB775564

semantic3.dH A D05-Dec-202164 KiB1,6251,202

sideeffect.dH A D05-Dec-202113.1 KiB419271

statement.dH A D05-Dec-202154.6 KiB2,0541,503

statement.hH A D05-Dec-202120.6 KiB767584

statement_rewrite_walker.dH A D05-Dec-20214.4 KiB195150

statement_rewrite_walker.hH A D05-Dec-20214.4 KiB173155

statementsem.dH A D05-Dec-2021168.9 KiB4,9963,869

staticassert.dH A D05-Dec-20211.7 KiB6741

staticassert.hH A D05-Dec-2021737 2914

staticcond.dH A D05-Dec-202112.9 KiB425337

stmtstate.dH A D05-Dec-20213.8 KiB143106

target.dH A D05-Dec-202114.8 KiB439158

target.hH A D05-Dec-20216.3 KiB210158

template.hH A D05-Dec-20219.8 KiB316206

templateparamsem.dH A D05-Dec-20215.9 KiB191137

tokens.dH A D05-Dec-202123.6 KiB1,023907

tokens.hH A D05-Dec-20216.6 KiB263181

traits.dH A D05-Dec-202166.2 KiB2,2031,777

transitivevisitor.dH A D05-Dec-202129.5 KiB1,208908

typesem.dH A D05-Dec-2021161.7 KiB4,8973,874

typinf.dH A D05-Dec-20211 KiB295

utf.dH A D05-Dec-202115.6 KiB562464

utf.hH A D05-Dec-20216.8 KiB11893

utils.dH A D05-Dec-20217.1 KiB299190

version.hH A D05-Dec-20211,017 4224

visitor.dH A D05-Dec-202110 KiB255201

visitor.hH A D05-Dec-202126.4 KiB661585

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