Name Date Size #Lines LOC

..30-Jul-2023-

common/H30-Jul-2023-1,8741,296

res/H30-Jul-2023-826697

root/H30-Jul-2023-9,3356,460

MERGEH A D30-Jul-2023154 53

README.mdH A D30-Jul-202330.5 KiB262214

VERSIONH A D30-Jul-20239 21

access.cH A D08-May-202216.8 KiB570400

access.dH A D30-Jul-202312.7 KiB403261

aggregate.dH A D30-Jul-202326.9 KiB817540

aggregate.hH A D30-Jul-202311.4 KiB331237

aliasthis.cH A D08-May-20224.5 KiB169130

aliasthis.dH A D30-Jul-20236.7 KiB218141

aliasthis.hH A D30-Jul-2023863 3215

apply.cH A D08-May-20223.6 KiB150101

apply.dH A D30-Jul-20235.1 KiB190126

arrayop.cH A D08-May-202217.9 KiB636478

arrayop.dH A D30-Jul-202310.8 KiB389280

arraytypes.dH A D30-Jul-20232.1 KiB5743

arraytypes.hH A D30-Jul-20231.9 KiB7031

ast_node.dH A D30-Jul-2023923 277

ast_node.hH A D30-Jul-2023499 217

astcodegen.dH A D30-Jul-20234.3 KiB10386

astenums.dH A D30-Jul-202313.5 KiB443350

attrib.cH A D08-May-202246.5 KiB1,7531,291

attrib.dH A D30-Jul-202347.4 KiB1,6041,036

attrib.hH A D30-Jul-20236.9 KiB256200

blockexit.cH A D08-May-202215.7 KiB505417

blockexit.dH A D30-Jul-202317.3 KiB559438

boostlicense.txtH A D08-May-20221.3 KiB2420

builtin.dH A D30-Jul-20231.1 KiB327

canthrow.cH A D08-May-20229.4 KiB317258

canthrow.dH A D30-Jul-20238.3 KiB288218

chkformat.dH A D30-Jul-202341.2 KiB1,365991

clone.cH A D08-May-202237.4 KiB1,182827

clone.dH A D30-Jul-202355.9 KiB1,7001,115

compiler.dH A D30-Jul-20231.9 KiB5819

compiler.hH A D30-Jul-20231 KiB3817

complex_t.hH A D08-May-20222 KiB7246

cond.cH A D30-Jul-202221.7 KiB752563

cond.dH A D30-Jul-202330.3 KiB1,004669

cond.hH A D30-Jul-20232.2 KiB9971

constfold.cH A D08-May-202251.9 KiB1,9231,662

constfold.dH A D30-Jul-202352.1 KiB1,8221,645

cparse.dH A D30-Jul-2023158.3 KiB5,0343,459

cppmangle.cH A D08-May-202234.8 KiB1,133800

cppmangle.dH A D30-Jul-202380 KiB2,5791,686

ctfe.hH A D30-Jul-20231.6 KiB6530

ctfeexpr.cH A D08-May-202265.7 KiB2,1261,731

ctfeexpr.dH A D30-Jul-202367.4 KiB2,1091,721

ctorflow.dH A D30-Jul-20236.1 KiB225136

dcast.cH A D30-Jul-2022116.7 KiB3,5652,825

dcast.dH A D30-Jul-2023122.3 KiB3,8953,004

dclass.cH A D08-May-202256.9 KiB1,9411,395

dclass.dH A D30-Jul-202335.6 KiB1,160792

declaration.cH A D08-May-202275.8 KiB2,5611,901

declaration.dH A D30-Jul-202372.1 KiB2,3891,775

declaration.hH A D30-Jul-202328.5 KiB868658

delegatize.cH A D08-May-20225.5 KiB210145

delegatize.dH A D30-Jul-20238.4 KiB306202

denum.cH A D08-May-202219.6 KiB751574

denum.dH A D30-Jul-20239 KiB338233

dimport.cH A D08-May-202213.4 KiB488363

dimport.dH A D30-Jul-202311.3 KiB359271

dinterpret.cH A D11-Jul-2023235 KiB7,0795,823

dinterpret.dH A D30-Jul-2023247.3 KiB7,4856,101

dmacro.cH A D08-May-202214 KiB459334

dmacro.dH A D30-Jul-202314.8 KiB425318

dmangle.cH A D08-May-202223.1 KiB875689

dmangle.dH A D30-Jul-202337.1 KiB1,3721,037

dmodule.cH A D08-May-202239.2 KiB1,362960

dmodule.dH A D30-Jul-202350.3 KiB1,5191,070

doc.cH A D08-May-202280.4 KiB2,8062,175

doc.dH A D30-Jul-2023178.2 KiB5,3914,194

doc.hH A D30-Jul-2023417 163

dscope.cH A D08-May-202218.8 KiB702514

dscope.dH A D30-Jul-202326.5 KiB804559

dstruct.cH A D08-May-202241.6 KiB1,4841,068

dstruct.dH A D30-Jul-202318.2 KiB636440

dsymbol.cH A D08-May-202251.2 KiB1,8901,324

dsymbol.dH A D30-Jul-202382.7 KiB2,6051,771

dsymbol.hH A D30-Jul-202315.2 KiB432352

dsymbolsem.dH A D30-Jul-2023249.5 KiB6,9155,210

dtemplate.cH A D08-May-2022279 KiB8,6716,379

dtemplate.dH A D30-Jul-2023292.1 KiB8,4296,157

dtoh.dH A D30-Jul-202399.4 KiB3,2952,458

dversion.cH A D08-May-20224.4 KiB201151

dversion.dH A D30-Jul-20235.4 KiB216166

entity.cH A D08-May-2022156.8 KiB2,3912,205

entity.dH A D30-Jul-2023147.6 KiB2,3962,207

enum.hH A D30-Jul-20232.2 KiB8746

errors.dH A D30-Jul-202314 KiB459248

errors.hH A D30-Jul-20232.7 KiB5636

escape.cH A D08-May-202239.5 KiB1,235892

escape.dH A D30-Jul-202377.7 KiB2,3651,626

expression.cH A D30-Jul-2022195.9 KiB7,0235,265

expression.dH A D30-Jul-2023210.5 KiB7,2345,231

expression.hH A D30-Jul-202333.7 KiB1,4061,101

expressionsem.cH A D11-Jul-2023283.6 KiB8,8037,226

expressionsem.dH A D30-Jul-2023447.9 KiB13,46610,437

file_manager.dH A D30-Jul-20238.9 KiB293199

foreachvar.dH A D30-Jul-20239 KiB323260

func.cH A D08-May-2022176.9 KiB5,6624,101

func.dH A D30-Jul-2023137.6 KiB4,3012,911

globals.dH A D30-Jul-202323.5 KiB616412

globals.hH A D30-Jul-202315.3 KiB422316

gluelayer.dH A D30-Jul-20232.1 KiB9264

hdrgen.cH A D08-May-202289.4 KiB3,4803,023

hdrgen.dH A D30-Jul-2023112.2 KiB4,1513,618

hdrgen.hH A D30-Jul-2023595 228

iasm.cH A D08-May-20221.2 KiB4523

iasm.dH A D30-Jul-20231.5 KiB6035

iasmgcc.cH A D08-May-202210.5 KiB382236

iasmgcc.dH A D30-Jul-202314.9 KiB538349

id.dH A D30-Jul-202313.7 KiB586473

id.hH A D30-Jul-2023418 175

identifier.cH A D08-May-20224.1 KiB189137

identifier.dH A D30-Jul-202310 KiB363232

identifier.hH A D30-Jul-20231.1 KiB4225

idgen.cH A D08-May-202213.3 KiB505425

impcnvgen.cH A D08-May-202219.8 KiB599463

impcnvtab.dH A D30-Jul-202316.2 KiB435302

imphint.cH A D08-May-20221.3 KiB5331

imphint.dH A D30-Jul-20232.7 KiB9266

import.hH A D30-Jul-20231.6 KiB5532

importc.dH A D30-Jul-20239.9 KiB358208

init.cH A D08-May-20227 KiB286228

init.dH A D30-Jul-20238.8 KiB333247

init.hH A D30-Jul-20232.7 KiB11885

initsem.cH A D08-May-202229.4 KiB918770

initsem.dH A D30-Jul-202347.8 KiB1,3951,101

inline.dH A D30-Jul-20231.2 KiB317

intrange.cH A D08-May-202223.3 KiB840649

intrange.dH A D30-Jul-202327.3 KiB920708

intrange.hH A D08-May-20227.2 KiB17884

json.cH A D08-May-202220.7 KiB892700

json.dH A D30-Jul-202328.7 KiB1,082910

json.hH A D30-Jul-2023541 206

lambdacomp.dH A D30-Jul-202313.6 KiB497363

lexer.cH A D08-May-202266.1 KiB2,4021,987

lexer.dH A D30-Jul-202399.7 KiB3,3122,842

lexer.hH A D08-May-20222.2 KiB7654

macro.hH A D08-May-20221.1 KiB3919

mangle.hH A D30-Jul-20231 KiB3517

mars.hH A D08-May-20222.7 KiB9426

module.hH A D30-Jul-20236.1 KiB173118

mtype.cH A D30-Jul-2022254.2 KiB9,5997,536

mtype.dH A D30-Jul-2023207.5 KiB7,3195,506

mtype.hH A D30-Jul-202324.5 KiB934780

mustuse.dH A D30-Jul-20236.5 KiB245168

nogc.cH A D08-May-20226 KiB242201

nogc.dH A D30-Jul-20237 KiB244195

nspace.cH A D08-May-20225.6 KiB239197

nspace.dH A D30-Jul-20235.2 KiB172100

nspace.hH A D30-Jul-2023986 3316

ob.dH A D30-Jul-202379 KiB2,6861,968

objc.cH A D08-May-20221.6 KiB8556

objc.dH A D30-Jul-202326.3 KiB896549

objc.hH A D30-Jul-20232.5 KiB8558

opover.cH A D08-May-202266.4 KiB1,9641,478

opover.dH A D30-Jul-202368.5 KiB1,8571,408

optimize.cH A D08-May-202241.5 KiB1,2751,016

optimize.dH A D30-Jul-202346.9 KiB1,4031,147

parse.cH A D08-May-2022243.3 KiB8,1506,677

parse.dH A D30-Jul-2023316 KiB9,6267,717

parse.hH A D08-May-20226.7 KiB192160

parsetimevisitor.dH A D30-Jul-202317 KiB299230

permissivevisitor.dH A D30-Jul-2023949 2914

printast.dH A D30-Jul-20235.6 KiB212165

readme.txtH A D08-May-2022463 1410

safe.cH A D08-May-20225 KiB169101

safe.dH A D30-Jul-20237.3 KiB229143

sapply.cH A D08-May-20223.7 KiB156127

sapply.dH A D30-Jul-20234.1 KiB180130

scope.hH A D30-Jul-20235.7 KiB151102

semantic2.dH A D30-Jul-202325.8 KiB779568

semantic3.dH A D30-Jul-202365.7 KiB1,6531,218

sideeffect.cH A D08-May-202212.9 KiB439288

sideeffect.dH A D30-Jul-202313.2 KiB423272

statement.cH A D08-May-202242.3 KiB1,7731,334

statement.dH A D30-Jul-202354.8 KiB2,0641,508

statement.hH A D30-Jul-202320.7 KiB767584

statement_rewrite_walker.dH A D30-Jul-20234.4 KiB195150

statementsem.cH A D30-Jul-2022142.6 KiB3,9113,129

statementsem.dH A D30-Jul-2023165.9 KiB4,8793,749

staticassert.cH A D08-May-20222.6 KiB10376

staticassert.dH A D30-Jul-20231.8 KiB7245

staticassert.hH A D30-Jul-2023791 3015

staticcond.cH A D08-May-20222.7 KiB10166

staticcond.dH A D30-Jul-202312.9 KiB424336

stmtstate.dH A D30-Jul-20233.8 KiB143106

target.dH A D30-Jul-202315.1 KiB442166

target.hH A D30-Jul-20236.8 KiB215163

template.hH A D30-Jul-20239.9 KiB318208

templateparamsem.dH A D30-Jul-20235.9 KiB191137

tokens.cH A D08-May-202215.6 KiB477409

tokens.dH A D30-Jul-202324.8 KiB1,1551,008

tokens.hH A D30-Jul-20237.5 KiB488402

traits.cH A D08-May-202247 KiB1,4841,259

traits.dH A D30-Jul-202367 KiB2,2361,803

transitivevisitor.dH A D30-Jul-202329.6 KiB1,212909

typesem.cH A D08-May-20223.2 KiB12490

typesem.dH A D30-Jul-2023163.9 KiB4,9433,895

typinf.dH A D30-Jul-20238.4 KiB263177

utf.cH A D08-May-20229 KiB306207

utf.hH A D08-May-20226.8 KiB11893

utils.cH A D08-May-20222.7 KiB12469

utils.dH A D30-Jul-20237.1 KiB300191

version.hH A D30-Jul-20231,019 4224

visitor.dH A D30-Jul-202310 KiB255201

visitor.hH A D30-Jul-202326.5 KiB663587

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
5https://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 https://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/common/](https://github.com/dlang/dmd/tree/master/src/dmd/common)   | Code shared by the front-end and back-end                                                                                                                                                                     |
24| [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).                                    |
25
26DMD has a mostly flat directory structure, so this section aims to divide all source files into logical groups for easier navigation.
27The groups are roughly ordered by how late they appear in the compilation process.
28Note that these groups have no strict meaning, the category assignments are a bit subjective.
29
30### Driver
31
32| File                                                                        | Purpose                                                               |
33|-----------------------------------------------------------------------------|-----------------------------------------------------------------------|
34| [mars.d](https://github.com/dlang/dmd/blob/master/src/dmd/mars.d)           | The entry point. Contains `main`.                                     |
35| [cli.d](https://github.com/dlang/dmd/blob/master/src/dmd/cli.d)             | Define the command line interface                                     |
36| [dmdparams.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmdparams.d) | DMD-specific parameters                                               |
37| [globals.d](https://github.com/dlang/dmd/blob/master/src/dmd/globals.d)     | Define a structure storing command line options                       |
38| [dinifile.d](https://github.com/dlang/dmd/blob/master/src/dmd/dinifile.d)   | Parse settings from .ini file (`sc.ini` / `dmd.conf`)                 |
39| [vsoptions.d](https://github.com/dlang/dmd/blob/master/src/dmd/vsoptions.d) | Detect the Microsoft Visual Studio toolchain for linking              |
40| [frontend.d](https://github.com/dlang/dmd/blob/master/src/dmd/frontend.d)   | An interface for using DMD as a library                               |
41| [errors.d](https://github.com/dlang/dmd/blob/master/src/dmd/errors.d)       | Error reporting functionality                                         |
42| [target.d](https://github.com/dlang/dmd/blob/master/src/dmd/target.d)       | Manage target-specific parameters for cross-compiling (for LDC/GDC)   |
43| [compiler.d](https://github.com/dlang/dmd/blob/master/src/dmd/compiler.d)   | Describe a back-end compiler and implements compiler-specific actions |
44
45### Lexing / parsing
46
47| File                                                                  | Purpose                                                              |
48|-----------------------------------------------------------------------|----------------------------------------------------------------------|
49| [lexer.d](https://github.com/dlang/dmd/blob/master/src/dmd/lexer.d)   | Convert source code into tokens for the D and ImportC parsers        |
50| [entity.d](https://github.com/dlang/dmd/blob/master/src/dmd/entity.d) | Define "\\&Entity;" escape sequence for strings / character literals |
51| [tokens.d](https://github.com/dlang/dmd/blob/master/src/dmd/tokens.d) | Define lexical tokens.                                               |
52| [parse.d](https://github.com/dlang/dmd/blob/master/src/dmd/parse.d)   | D parser, converting tokens into an Abstract Syntax Tree (AST)       |
53| [cparse.d](https://github.com/dlang/dmd/blob/master/src/dmd/cparse.d) | ImportC parser, converting tokens into an Abstract Syntax Tree (AST) |
54
55### Semantic analysis
56
57**Symbols and declarations**
58
59| File                                                                            | Purpose                                                                                                          |
60|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
61| [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.                                          |
62| [identifier.d](https://github.com/dlang/dmd/blob/master/src/dmd/identifier.d)   | Represents the name of a `Dsymbol`                                                                               |
63| [id.d](https://github.com/dlang/dmd/blob/master/src/dmd/id.d)                   | Define strings for pre-defined identifiers (e.g. `sizeof`, `string`)                                             |
64| [dscope.d](https://github.com/dlang/dmd/blob/master/src/dmd/dscope.d)           | Define a 'scope' on which symbol lookup can be performed                                                         |
65| [dtemplate.d](https://github.com/dlang/dmd/blob/master/src/dmd/dtemplate.d)     | A template declaration or instance                                                                               |
66| [dmodule.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmodule.d)         | Define a package and module                                                                                      |
67| [mtype.d](https://github.com/dlang/dmd/blob/master/src/dmd/mtype.d)             | Define expression types such as `int`, `char[]`, `void function()`                                               |
68| [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`                                        |
69| [declaration.d](https://github.com/dlang/dmd/blob/master/src/dmd/declaration.d) | Misc. declarations of `alias`, variables, type tuples, `ClassInfo` etc.                                          |
70| [denum.d](https://github.com/dlang/dmd/blob/master/src/dmd/denum.d)             | Defines `enum` declarations and enum members                                                                     |
71| [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 |
72| [func.d](https://github.com/dlang/dmd/blob/master/src/dmd/func.d)               | Define a function declaration (includes function literals, `invariant`, `unittest`)                              |
73| [dversion.d](https://github.com/dlang/dmd/blob/master/src/dmd/dversion.d)       | Defines a version symbol, e.g. `version = ident`, `debug = ident`                                                |
74
75**AST nodes**
76
77| File                                                                              | Purpose                                                     |
78|-----------------------------------------------------------------------------------|-------------------------------------------------------------|
79| [ast_node.d](https://github.com/dlang/dmd/blob/master/src/dmd/ast_node.d)         | Define an abstract AST node class                           |
80| [astbase.d](https://github.com/dlang/dmd/blob/master/src/dmd/astbase.d)           | Namespace of AST nodes that can be produced by the parser   |
81| [astcodegen.d](https://github.com/dlang/dmd/blob/master/src/dmd/astcodegen.d)     | Namespace of AST nodes of a AST ready for code generation   |
82| [astenums.d](https://github.com/dlang/dmd/blob/master/src/dmd/astenums.d)         | Enums common to DMD and AST                                 |
83| [expression.d](https://github.com/dlang/dmd/blob/master/src/dmd/expression.d)     | Define expression AST nodes                                 |
84| [statement.d](https://github.com/dlang/dmd/blob/master/src/dmd/statement.d)       | Define statement AST nodes                                  |
85| [staticassert.d](https://github.com/dlang/dmd/blob/master/src/dmd/staticassert.d) | Define a `static assert` AST node                           |
86| [aggregate.d](https://github.com/dlang/dmd/blob/master/src/dmd/aggregate.d)       | Define an aggregate (`struct`, `union` or `class`) AST node |
87| [dclass.d](https://github.com/dlang/dmd/blob/master/src/dmd/dclass.d)             | Define a `class` AST node                                   |
88| [dstruct.d](https://github.com/dlang/dmd/blob/master/src/dmd/dstruct.d)           | Define a `struct` or `union` AST node                       |
89| [init.d](https://github.com/dlang/dmd/blob/master/src/dmd/init.d)                 | Define variable initializers                                |
90
91**AST visitors**
92
93| File                                                                                                      | Purpose                                                                          |
94|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
95| [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   |
96| [permissivevisitor.d](https://github.com/dlang/dmd/blob/master/src/dmd/permissivevisitor.d)               | Subclass of ParseTimeVisitor that does not `assert(0)` on unimplemented nodes    |
97| [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 |
98| [visitor.d](https://github.com/dlang/dmd/blob/master/src/dmd/visitor.d)                                   | A visitor implementing `visit` for all nodes present in the compiler             |
99| [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               |
100| [apply.d](https://github.com/dlang/dmd/blob/master/src/dmd/apply.d)                                       | Depth-first expression visitor                                                   |
101| [sapply.d](https://github.com/dlang/dmd/blob/master/src/dmd/sapply.d)                                     | Depth-first statement visitor                                                    |
102| [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               |
103
104**Semantic passes**
105
106| File                                                                                      | Purpose                                                           |
107|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
108| [dsymbolsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/dsymbolsem.d)             | Do semantic 1 pass (symbol identifiers/types)                     |
109| [semantic2.d](https://github.com/dlang/dmd/blob/master/src/dmd/semantic2.d)               | Do semantic 2 pass (symbol initializers)                          |
110| [semantic3.d](https://github.com/dlang/dmd/blob/master/src/dmd/semantic3.d)               | Do semantic 3 pass (function bodies)                              |
111| [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) |
112| [inlinecost.d](https://github.com/dlang/dmd/blob/master/src/dmd/inlinecost.d)             | Compute the cost of inlining a function call.                     |
113| [expressionsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/expressionsem.d)       | Do semantic analysis for expressions                              |
114| [statementsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/statementsem.d)         | Do semantic analysis for statements                               |
115| [initsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/initsem.d)                   | Do semantic analysis for initializers                             |
116| [templateparamsem.d](https://github.com/dlang/dmd/blob/master/src/dmd/templateparamsem.d) | Do semantic analysis for template parameters                      |
117| [typesem.d](https://github.com/dlang/dmd/blob/master/src/dmd/typesem.d)                   | Do semantic analysis for types                                    |
118
119**Semantic helpers**
120
121| File                                                                          | Purpose                                                                                    |
122|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
123| [opover.d](https://github.com/dlang/dmd/blob/master/src/dmd/opover.d)         | Operator overloading                                                                       |
124| [clone.d](https://github.com/dlang/dmd/blob/master/src/dmd/dsymbolsem.d)      | Generate automatic `opEquals`, `opAssign` and constructors for structs                     |
125| [blockexit.d](https://github.com/dlang/dmd/blob/master/src/dmd/blockexit.d)   | Find out in what ways control flow can exit a block                                        |
126| [ctorflow.d](https://github.com/dlang/dmd/blob/master/src/dmd/ctorflow.d)     | Control flow in constructors                                                               |
127| [constfold.d](https://github.com/dlang/dmd/blob/master/src/dmd/constfold.d)   | Do constant folding of arithmetic expressions                                              |
128| [optimize.d](https://github.com/dlang/dmd/blob/master/src/dmd/optimize.d)     | Do constant folding more generally                                                         |
129| [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 |
130| [impcnvtab.d](https://github.com/dlang/dmd/blob/master/src/dmd/impcnvtab.d)   | Define an implicit conversion table for basic types                                        |
131| [importc.d](https://github.com/dlang/dmd/blob/master/src/dmd/importc.d)       | Helpers specific to ImportC                                                                |
132| [sideeffect.d](https://github.com/dlang/dmd/blob/master/src/dmd/sideeffect.d) | Extract side-effects of expressions for certain lowerings.                                 |
133| [mustuse.d](https://github.com/dlang/dmd/blob/master/src/dmd/mustuse.d)       | Helpers related to the `@mustuse` attribute                                                |
134
135
136**Compile Time Function Execution (CTFE)**
137
138| File                                                                          | Purpose                                                                             |
139|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
140| [dinterpret.d](https://github.com/dlang/dmd/blob/master/src/dmd/dinterpret.d) | CTFE entry point                                                                    |
141| [ctfeexpr.d](https://github.com/dlang/dmd/blob/master/src/dmd/ctfeexpr.d)     | CTFE for expressions involving pointers, slices, array concatenation etc.           |
142| [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`) |
143
144### Specific language features
145
146**Attribute checks**
147
148| File                                                                      | Purpose                                |
149|---------------------------------------------------------------------------|----------------------------------------|
150| [nogc.d](https://github.com/dlang/dmd/blob/master/src/dmd/nogc.d)         | `@nogc` checks                         |
151| [safe.d](https://github.com/dlang/dmd/blob/master/src/dmd/safe.d)         | `@safe` checks                         |
152| [canthrow.d](https://github.com/dlang/dmd/blob/master/src/dmd/canthrow.d) | `nothrow` checks                       |
153| [escape.d](https://github.com/dlang/dmd/blob/master/src/dmd/escape.d)     | `scope` checks                         |
154| [access.d](https://github.com/dlang/dmd/blob/master/src/dmd/access.d)     | `public` / `private` checks            |
155| [ob.d](https://github.com/dlang/dmd/blob/master/src/dmd/ob.d)             | Ownership / borrowing (`@live`) checks |
156
157**Inline Assembly**
158
159| File                                                                    | Purpose                                   |
160|-------------------------------------------------------------------------|-------------------------------------------|
161| [iasm.d](https://github.com/dlang/dmd/blob/master/src/dmd/iasm.d)       | Inline assembly depending on the compiler |
162| [iasmdmd.d](https://github.com/dlang/dmd/blob/master/src/dmd/iasmdmd.d) | Inline assembly for DMD                   |
163| [iasmgcc.d](https://github.com/dlang/dmd/blob/master/src/dmd/iasmgcc.d) | Inline assembly for GDC                   |
164
165**Other**
166
167| File                                                                          | Purpose                                                                                     |
168|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
169| [aliasthis.d](https://github.com/dlang/dmd/blob/master/src/dmd/aliasthis.d)   | Resolve implicit conversions for `alias X this`                                             |
170| [traits.d](https://github.com/dlang/dmd/blob/master/src/dmd/traits.d)         | `__traits()`                                                                                |
171| [lambdacomp.d](https://github.com/dlang/dmd/blob/master/src/dmd/lambdacomp.d) | `__traits(isSame, x => y, z => w)`                                                          |
172| [cond.d](https://github.com/dlang/dmd/blob/master/src/dmd/cond.d)             | Evaluate `static if`, `version` `debug `                                                    |
173| [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 |
174| [delegatize.d](https://github.com/dlang/dmd/blob/master/src/dmd/delegatize.d) | Converts expression to delegates for `lazy` parameters                                      |
175| [eh.d](https://github.com/dlang/dmd/blob/master/src/dmd/eh.d)                 | Generate tables for exception handling                                                      |
176| [nspace.d](https://github.com/dlang/dmd/blob/master/src/dmd/nspace.d)         | Namespace for `extern (C++, Module)`                                                        |
177| [intrange.d](https://github.com/dlang/dmd/blob/master/src/dmd/intrange.d)     | [Value range propagation](https://digitalmars.com/articles/b62.html)                        |
178| [dimport.d](https://github.com/dlang/dmd/blob/master/src/dmd/dimport.d)       | Renamed imports (`import aliasSymbol = pkg1.pkg2.symbol`)                                   |
179| [arrayop.d](https://github.com/dlang/dmd/blob/master/src/dmd/arrayop.d)       | Array operations (`a[] = b[] + c[]`)                                                        |
180| [typinf.d](https://github.com/dlang/dmd/blob/master/src/dmd/typinf.d)         | Generate typeinfo for `typeid()` (as well as internals)                                     |
181
182| File                                                                        | Purpose                                                                            |
183|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------|
184| [chkformat.d](https://github.com/dlang/dmd/blob/master/src/dmd/chkformat.d) | Validate arguments with format specifiers for `printf` / `scanf` etc.              |
185| [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. |
186
187### Library files
188
189| File                                                                          | Purpose                                              |
190|-------------------------------------------------------------------------------|------------------------------------------------------|
191| [lib.d](https://github.com/dlang/dmd/blob/master/src/dmd/lib.d)               | Abstract library class                               |
192| [libelf.d](https://github.com/dlang/dmd/blob/master/src/dmd/libelf.d)         | Library in ELF format (Unix)                         |
193| [libmach.d](https://github.com/dlang/dmd/blob/master/src/dmd/libmach.d)       | Library in Mach-O format (macOS)                     |
194| [libmscoff.d](https://github.com/dlang/dmd/blob/master/src/dmd/libmscoff.d)   | Library in COFF format (32/64-bit Windows)           |
195| [libomf.d](https://github.com/dlang/dmd/blob/master/src/dmd/libomf.d)         | Library in OMF format (legacy 32-bit Windows)        |
196| [scanelf.d](https://github.com/dlang/dmd/blob/master/src/dmd/scanelf.d)       | Extract symbol names from a library in ELF format    |
197| [scanmach.d](https://github.com/dlang/dmd/blob/master/src/dmd/scanmach.d)     | Extract symbol names from a library in Mach-O format |
198| [scanmscoff.d](https://github.com/dlang/dmd/blob/master/src/dmd/scanmscoff.d) | Extract symbol names from a library in COFF format   |
199| [scanomf.d](https://github.com/dlang/dmd/blob/master/src/dmd/scanomf.d)       | Extract symbol names from a library in OMF format    |
200
201### Code generation / back-end interfacing
202
203| File                                                                                        | Purpose                                                                             |
204|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
205| [dmsc.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmsc.d)                           | Configures and initializes the back-end                                             |
206| [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            |
207| [toir.d](https://github.com/dlang/dmd/blob/master/src/dmd/toir.d)                           | Convert Dsymbols intermediate representation                                        |
208| [e2ir.d](https://github.com/dlang/dmd/blob/master/src/dmd/e2ir.d)                           | Convert Expressions to intermediate representation                                  |
209| [s2ir.d](https://github.com/dlang/dmd/blob/master/src/dmd/s2ir.d)                           | Convert Statements to intermediate representation                                   |
210| [stmtstate.d](https://github.com/dlang/dmd/blob/master/src/dmd/stmtstate.d)                 | Used to help transform statement AST into flow graph                                |
211| [toctype.d](https://github.com/dlang/dmd/blob/master/src/dmd/toctype.d)                     | Convert a D type to a type the back-end understands                                 |
212| [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)           |
213| [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                |
214| [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                                              |
215| [argtypes_aarch64.d](https://github.com/dlang/dmd/blob/master/src/dmd/argtypes_aarch64.d)   | 'argtypes' for the AArch64 ABI                                                      |
216| [glue.d](https://github.com/dlang/dmd/blob/master/src/dmd/glue.d)                           | Generate the object file for function declarations                                  |
217| [gluelayer.d](https://github.com/dlang/dmd/blob/master/src/dmd/gluelayer.d)                 | Declarations for back-end functions that the front-end invokes                      |
218| [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 |
219| [tocvdebug.d](https://github.com/dlang/dmd/blob/master/src/dmd/tovcdebug.d)                 | Generate debug info in the CV4 debug format.                                        |
220| [objc.d](https://github.com/dlang/dmd/blob/master/src/dmd/objc.d)                           | Objective-C interfacing                                                             |
221| [objc_glue.d](https://github.com/dlang/dmd/blob/master/src/dmd/objc_glue.d)                 | Glue code for Objective-C interop.                                                  |
222
223**Name mangling**
224
225| File                                                                              | Purpose                                                          |
226|-----------------------------------------------------------------------------------|------------------------------------------------------------------|
227| [cppmangle.d](https://github.com/dlang/dmd/blob/master/src/dmd/cppmangle.d)       | C++ name mangling                                                |
228| [cppmanglewin.d](https://github.com/dlang/dmd/blob/master/src/dmd/cppmanglewin.d) | C++ name mangling for Windows                                    |
229| [dmangle.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmangle.d)           | D [name mangling](https://dlang.org/spec/abi.html#name_mangling) |
230
231### Linking
232
233| File                                                              | Purpose                                 |
234|-------------------------------------------------------------------|-----------------------------------------|
235| [link.d](https://github.com/dlang/dmd/blob/master/src/dmd/link.d) | Invoke the linker as a separate process |
236
237### Special output
238
239| File                                                                  | Purpose                                                                                                 |
240|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
241| [doc.d](https://github.com/dlang/dmd/blob/master/src/dmd/doc.d)       | [Documentation generation](https://dlang.org/spec/ddoc.html)                                            |
242| [dmacro.d](https://github.com/dlang/dmd/blob/master/src/dmd/dmacro.d) | DDoc macro processing                                                                                   |
243| [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 |
244| [json.d](https://github.com/dlang/dmd/blob/master/src/dmd/json.d)     | Describe the module in a `.json` file for the `-X` flag                                                 |
245| [dtoh.d](https://github.com/dlang/dmd/blob/master/src/dmd/dtoh.d)     | C++ header generation from D source files                                                               |
246
247### Utility
248
249Note: many other utilities are in [dmd/root](https://github.com/dlang/dmd/tree/master/src/dmd/root).
250
251| File                                                                              | Purpose                                           |
252|-----------------------------------------------------------------------------------|---------------------------------------------------|
253| [console.d](https://github.com/dlang/dmd/blob/master/src/dmd/console.d)           | Print error messages in color                     |
254| [file_manager.d](https://github.com/dlang/dmd/blob/master/src/dmd/file_manager.d) | Keep file contents in memory                      |
255| [utils.d](https://github.com/dlang/dmd/blob/master/src/dmd/utils.d)               | Utility functions related to files and file paths |
256
257| File                                                                            | Purpose                                                       |
258|---------------------------------------------------------------------------------|---------------------------------------------------------------|
259| [asttypename.d](https://github.com/dlang/dmd/blob/master/src/dmd/asttypename.d) | Print the internal name of an AST node (for debugging only)   |
260| [printast.d](https://github.com/dlang/dmd/blob/master/src/dmd/printast.d)       | Print the AST data structure                                  |
261| [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 |
262

readme.txt

1This is the source code to the DMD compiler
2for the D Programming Language defined in the documents at
3http://dlang.org/
4
5These sources are free, they are redistributable and modifiable
6under the terms of the Boost Software License, Version 1.0.
7The terms of this license are in the file boostlicense.txt,
8or see http://www.boost.org/LICENSE_1_0.txt.
9
10If a particular file has a different license in it, that overrides
11this license for that file.
12
13-Walter Bright
14