dmd D Programming Language compiler
Find a file
Dennis 4d0934d37f
merge stable (#21127)
* bump VERSION to v2.110.0

* purge changelog

* bump VERSION to v2.111.0-beta.1

* Accept __rvalue attribute on ref functions; which will force the result to be treated as __rvalue. (#20946)

This is essential to implement `move`, `forward`, etc.

* memoryerror.d: Fix AnySupported version condition (#20983)

* Fix #20982 - wrong line number in iasmgcc (#20993)

* Move genCfunc to cxxfrontend (#20992)

* druntime: Fix compilation of rt.cover on Android (#21015)

* Expose SourceLoc to C++ interface (#20980)

* [stable] C++ header fixes for declaration, expression, and typinf (#21016)

Seen either from compilation errors or missing symbols at link time.

* C++ headers: Add 3 Declaration bitfield setters/getters required by LDC

* druntime: Add module declaration to rt.invariant, to prevent conflicts with user-provided invariant.d (#21017)

* Fix #21020 - Indexing a *cast* AA yields no lvalue anymore (#21029)

* Add C++23 to CppStdRevision enum (#21043)

* Improve UFCS/property error message (#21046)

* bump VERSION to v2.111.0-rc.1

* Fix #21045 - import __stdin causes compilation to pause while reading from stdin (#21047)

Moves the special handling of reading from stdin out of the semantic
routines to the DMD driver itself. All references to `__stdin.d` have
also been removed from the frontend implementation.

* Update source code and coverage links (#21111)

* Fix #21024 - Optimize x^^c expressions (#21082)

* Fix #21024 - Optimize x^^c expressions

Reason for the *magic* constraint c<8 on inlining x^^c:

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86_64/fpu/e_powl.S;h=47f129f34d368d7c67b8e5f2462b36b0bebb7621;hb=HEAD#l136

* Fix poor assumption about expression state

* Restrict optimization to floating point expressions

* Generalize optimization to any scalar data type

* Fix segfault on x^^c where x is a single member anonymous enum

DMD segfaulted on compiling the unittests in std/algorithm/sorting.o, the
unittest that caused the segfault can be reduced to:

    enum real Two = 2.0;
    auto _ = Two^^3;

I'm not sure why copying the anonymous enum into a `const` variable causes
the compiler to segfault.

* Add tests to x^^c inlining optimization

* Fix missing type for e1 ^^ -1 to 1 / e1 rewrite

* Move rewrites from constant folding to expression semantic and restrict them to [-1, 2]

* Improve error message for the x^^2 rewrite.

Before:
    ex.d(4): Error: can implicitly convert expression `(const const(double) __powtmp2 = x + 5.0;) , __powtmp2 * ...` of type `double` to `int`
        int y = ( x + 5 ) ^^ 2;
                ^
and after:
    ex.d(4): Error: cannot implicitly convert expression `(x + 5.0) ^^ 2L` of type `double` to `int`
        int y = ( x + 5 ) ^^ 2;
                ^

* Update C++ frontend header to match change in `CommaExp`

* Address code review feedback

Co-authored-by: Dennis Korpel <dkorpel@gmail.com>

---------

Co-authored-by: Dennis Korpel <dkorpel@gmail.com>

* Revert "Fix #21024 - Optimize x^^c expressions (#21082)" (#21114)

This reverts commit fa1f860e4b.

* bump VERSION to v2.111.0

* purge changelog

* Strip trailing newline off sarif version

---------

Co-authored-by: Manu Evans <turkeyman@gmail.com>
Co-authored-by: Martin Kinkelin <kinke@users.noreply.github.com>
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
Co-authored-by: Martin Kinkelin <noone@nowhere.com>
Co-authored-by: Fares A. Bakhit <faresa.bakhit@gmail.com>
2025-03-31 15:54:53 +02:00
.azure-pipelines Get rid of obsolete DMC special cases 2024-05-25 19:34:44 +02:00
.circleci CI: Adapt to generic Makefile for Phobos 2023-12-18 17:10:31 +08:00
.github/workflows GHA main: Add Alpine Linux job, to CI-test musl libc (#20741) 2025-01-28 00:28:20 +01:00
changelog merge stable (#21127) 2025-03-31 15:54:53 +02:00
ci GHA main: Add Alpine Linux job, to CI-test musl libc (#20741) 2025-01-28 00:28:20 +01:00
compiler merge stable (#21127) 2025-03-31 15:54:53 +02:00
druntime Turn macro translations into template functions (#21108) 2025-03-29 06:31:49 +08:00
src
.cirrus.yml
.codecov.yml
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore Refactored memcpy calls to D slices (#21062) 2025-03-24 07:12:13 +08:00
.pre-commit-config.yaml
azure-pipelines.yml Kill off OMF support 2024-05-03 18:24:36 +12:00
CODEOWNERS
config.d dub build: Fix cross-compilation 2024-07-28 09:01:09 +08:00
CONTRIBUTING.md Update the contributor guide, remove bugzilla references (#20591) 2024-12-23 20:18:16 +08:00
dub.sdl Fix dub file for dscanner (#20978) 2025-03-12 07:29:09 +08:00
LICENSE.txt
Makefile Remove 'samples' folder 2025-01-11 08:12:48 +08:00
posix.mak
README.md Remove 'samples' folder 2025-01-11 08:12:48 +08:00
VERSION merge stable (#21127) 2025-03-31 15:54:53 +02:00

dlang logo

DMD

GitHub tag Code coverage license

Build status CircleCI Build Status Buildkite


DMD is the reference compiler for the D programming language.

Releases, language specification and other resources can be found on the homepage. Please refer to the guidelines for bug reports to report a problem or browse the list of open bugs.

Overview

This repository is structured into the following directories. Refer to their respective README.md for more in-depth information.

Directory Description
changelog changelog entries for the upcoming release
ci CI related scripts / utilities
compiler root of all compiler (DMD/frontend) related code
compiler/src source code, build system and build instructions
compiler/test tests and testing infrastructure
compiler/docs man pages and internal documentation
compiler/ini predefined dmd.conf files
druntime root of all runtime related code

With a D compiler and dub installed, dmd can be built with:

dub build dmd:compiler

For more information regarding compiling, installing, and hacking on DMD, check the contribution guide and visit the D Wiki.

Nightlies

Nightly builds based of the current DMD / Phobos master branch can be found here.