mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
dmd D Programming Language compiler
![]() * 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> |
||
---|---|---|
.azure-pipelines | ||
.circleci | ||
.github/workflows | ||
changelog | ||
ci | ||
compiler | ||
druntime | ||
src | ||
.cirrus.yml | ||
.codecov.yml | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.pre-commit-config.yaml | ||
azure-pipelines.yml | ||
CODEOWNERS | ||
config.d | ||
CONTRIBUTING.md | ||
dub.sdl | ||
LICENSE.txt | ||
Makefile | ||
posix.mak | ||
README.md | ||
VERSION |
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.