Skip to content

Commit e0e7fed

Browse files
authored
Merge pull request #4877 from ldc-developers/merge-2.111
Upgrade frontend & libs to v2.111
2 parents 5f4761f + df747ff commit e0e7fed

File tree

960 files changed

+32917
-23752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

960 files changed

+32917
-23752
lines changed

.github/actions/1-setup/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ runs:
145145
if: runner.os == 'Windows'
146146
shell: cmd
147147
run: make --version
148+
- name: 'macOS: Install a more recent GNU make'
149+
if: runner.os == 'macOS'
150+
shell: bash
151+
run: |
152+
brew install make
153+
gmake --version
148154
149155
- name: 'Windows: Download & extract libcurl' # into ../libcurl/ldc2
150156
if: runner.os == 'Windows'

.github/actions/4c-test-dmd/action.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,7 @@ runs:
99
- name: 'Posix: Run DMD testsuite'
1010
if: runner.os != 'Windows'
1111
shell: bash
12-
run: |
13-
set -eux
14-
repoDir=$PWD
15-
cd ../build
16-
if type -P apk &>/dev/null; then
17-
# Alpine: run full dmd-testsuite-debug
18-
ctest -V -R 'dmd-testsuite' -E '^dmd-testsuite$'
19-
# these two tests require extra flags "-link-defaultlib-debug -frame-pointer=all": https://github.com/ldc-developers/ldc/issues/4694
20-
# => remove before running optimized dmd-testsuite separately
21-
rm $repoDir/tests/dmd/runnable/{test17559.d,test19086.d}
22-
ctest -V -R '^dmd-testsuite$'
23-
else
24-
ctest -V -R "dmd-testsuite"
25-
fi
12+
run: cd ../build && ctest -V -R "dmd-testsuite"
2613

2714
- name: 'Windows: Run DMD testsuite'
2815
if: runner.os == 'Windows'

.github/actions/4d-test-libs/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ runs:
2727
excludes+='|^std.internal.math.gammafunction'
2828
# FIXME: failing unittest(s) with enabled optimizations
2929
excludes+='|^std.math.exponential(-shared)?$'
30-
# FIXME: subtest rt_trap_exceptions fails
31-
excludes+='|^druntime-test-exceptions-debug$'
3230
# FIXME: sporadically hanging
3331
excludes+='|^core.thread-shared$'
3432
fi

.github/workflows/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
name: Main
44
on:
5-
- pull_request
6-
- push
5+
pull_request:
6+
push:
7+
branches-ignore:
8+
- 'merge-*' # don't run on pushes to merge-X.Y.Z branches, they are usually PRs
9+
tags: # explicitly needed to run for all tags, due to the branches filter above
10+
- '**'
711

812
concurrency:
913
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/supported_llvm_versions.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
name: Vanilla LLVM
44
on:
5-
- pull_request
6-
- push
5+
pull_request:
6+
push:
7+
branches-ignore:
8+
- 'merge-*' # don't run on pushes to merge-X.Y.Z branches, they are usually PRs
9+
tags: # explicitly needed to run for all tags, due to the branches filter above
10+
- '**'
711

812
concurrency:
913
group: ${{ github.workflow }}-${{ github.ref }}
@@ -69,6 +73,12 @@ jobs:
6973
sudo apt-get update
7074
sudo apt-get install gdb lld-${{ matrix.llvm_version }} llvm-${{ matrix.llvm_version }}-dev libclang-common-${{ matrix.llvm_version }}-dev
7175
76+
- name: 'macOS: Install a more recent GNU make'
77+
if: runner.os == 'macOS'
78+
run: |
79+
brew install make
80+
gmake --version
81+
7282
- name: 'macOS: Try to restore cached LLVM'
7383
if: runner.os == 'macOS'
7484
uses: actions/cache@v4
@@ -129,6 +139,14 @@ jobs:
129139
if [[ '${{ runner.os }}' == 'Linux' ]]; then
130140
# FIXME: lsan_interceptors.cpp:82 "((!lsan_init_is_running)) != (0)"
131141
rm tests/sanitizers/lsan_memleak.d
142+
elif [[ '${{ runner.os }}' == 'macOS' ]]; then
143+
# work around weird lit-test `plugins/addFuncEntryCall/testPlugin.d`
144+
# regression after switching to homebrew make (default CXX is clang++)
145+
export CXX=c++
146+
if [[ '${{ matrix.cmake_flags }}' =~ -DRT_SUPPORT_SANITIZERS=ON ]]; then
147+
# FIXME: regressed with druntime v2.111 on macOS arm64 (but works on Linux x86_64)
148+
rm tests/sanitizers/asan_fiber.d
149+
fi
132150
fi
133151
ctest -V -R "lit-tests"
134152
- name: Run DMD testsuite

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# LDC master
22

33
#### Big news
4+
- Frontend, druntime and Phobos are at version [2.111.0](https://dlang.org/changelog/2.111.0.html). (#4877)
5+
- Keep frame pointers by default with `-O` for some targets, notably AArch64 (except Windows), x86_64 (except Windows and glibc Linux), Windows x86, and Android. This fixes druntime backtraces with optimized code (incl. prebuilt druntime/Phobos). (#4889)
46
- The prebuilt (non-musl) Linux packages are now generated on Ubuntu 22.04; the minimum glibc version has accordingly been raised from v2.31 to v2.35. (#4893)
57
- ldc2.conf: Arrays can now be appended to via the `~=` operator. (#4848, #4856)
68
- New `--installWithSuffix` command-line option for the `ldc-build-runtime` tool, to simplify copying the libraries to an existing LDC installation. (#4870)

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ include(GetLinuxDistribution)
117117
#
118118

119119
# Version information
120-
set(LDC_VERSION "1.40.1") # May be overridden by git hash tag
120+
set(LDC_VERSION "1.41.0") # May be overridden by git hash tag
121121
set(DMDFE_MAJOR_VERSION 2)
122-
set(DMDFE_MINOR_VERSION 110)
122+
set(DMDFE_MINOR_VERSION 111)
123123
set(DMDFE_PATCH_VERSION 0)
124124

125125
set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}.${DMDFE_PATCH_VERSION})
@@ -408,7 +408,6 @@ set(DRV_HDR
408408
driver/linker.h
409409
driver/plugins.h
410410
driver/targetmachine.h
411-
driver/timetrace.h
412411
driver/toobj.h
413412
driver/tool.h
414413
)

dmd/README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ Note that these groups have no strict meaning, the category assignments are a bi
4141
| [frontend.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/frontend.d) | An interface for using DMD as a library |
4242
| [errors.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/errors.d) | Error reporting implementation |
4343
| [errorsink.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/errorsink.d) | Error reporting interface |
44+
| [sarif.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/sarif.d) | Generates SARIF reports for errors and warnings. |
4445
| [target.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/target.d) | Manage target-specific parameters for cross-compiling (for LDC/GDC) |
4546
| [compiler.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/compiler.d) | Describe a back-end compiler and implements compiler-specific actions |
47+
| [deps.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/deps.d) | Implement the `-deps` and `-makedeps` switches |
48+
| [timetrace.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/timetrace.d) | Build time profiling utility |
4649

4750
### Lexing / parsing
4851

@@ -96,14 +99,14 @@ Note that these groups have no strict meaning, the category assignments are a bi
9699

97100
| File | Purpose |
98101
|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
99-
| [parsetimevisitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/parsetimevisitor.d) | General [visitor](https://en.wikipedia.org/wiki/Visitor_pattern) for AST nodes |
100-
| [permissivevisitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/permissivevisitor.d) | Subclass of ParseTimeVisitor that does not `assert(0)` on unimplemented nodes |
101-
| [strictvisitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/strictvisitor.d) | Visitor that forces derived classes to implement `visit` for every possible node |
102-
| [visitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor.d) | A visitor implementing `visit` for all nodes present in the compiler |
103-
| [transitivevisitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/transitivevisitor.d) | Provide a mixin template with visit methods for the parse time AST |
104-
| [postordervisitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/postordervisitor.d) | Depth-first expression visitor |
105-
| [sapply.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/sapply.d) | Depth-first statement visitor |
106-
| [statement_rewrite_walker.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/statement_rewrite_walker.d) | Statement visitor that allows replacing the currently visited node |
102+
| [visitor/parsetime.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor/parsetime.d) | General [visitor](https://en.wikipedia.org/wiki/Visitor_pattern) for AST nodes |
103+
| [visitor/permissive.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor/permissive.d) | Subclass of ParseTimeVisitor that does not `assert(0)` on unimplemented nodes |
104+
| [visitor/strict.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor/strict.d) | Visitor that forces derived classes to implement `visit` for every possible node |
105+
| [visitor/package.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor/package.d) | A visitor implementing `visit` for all nodes present in the compiler |
106+
| [visitor/transitive.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor/transitive.d) | Provide a mixin template with visit methods for the parse time AST |
107+
| [visitor/postorder.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor/postorder.d) | Depth-first expression & statement visitor |
108+
| [visitor/statement_rewrite_walker.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor/statement_rewrite_walker.d) | Statement visitor that allows replacing the currently visited node |
109+
| [visitor/foreachvar.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor/foreachvar.d) | Used in `ob.d` to iterate over all variables in an expression |
107110

108111
**Semantic passes**
109112

@@ -197,13 +200,13 @@ Note that these groups have no strict meaning, the category assignments are a bi
197200

198201
| File | Purpose |
199202
|-------------------------------------------------------------------------------|------------------------------------------------------|
200-
| [lib.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib.d) | Abstract library class |
201-
| [libelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libelf.d) | Library in ELF format (Unix) |
202-
| [libmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libmach.d) | Library in Mach-O format (macOS) |
203-
| [libmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libmscoff.d) | Library in COFF format (32/64-bit Windows) |
204-
| [scanelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanelf.d) | Extract symbol names from a library in ELF format |
205-
| [scanmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanmach.d) | Extract symbol names from a library in Mach-O format |
206-
| [scanmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanmscoff.d) | Extract symbol names from a library in COFF format |
203+
| [lib/package.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/package.d) | Abstract library class |
204+
| [lib/elf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/elf.d) | Library in ELF format (Unix) |
205+
| [lib/mach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/mach.d) | Library in Mach-O format (macOS) |
206+
| [lib/mscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/mscoff.d) | Library in COFF format (32/64-bit Windows) |
207+
| [lib/scanelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/scanelf.d) | Extract symbol names from a library in ELF format |
208+
| [lib/scanmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/scanmach.d) | Extract symbol names from a library in Mach-O format |
209+
| [lib/scanmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/scanmscoff.d) | Extract symbol names from a library in COFF format |
207210

208211
### Code generation / back-end interfacing
209212

@@ -231,10 +234,10 @@ Note that these groups have no strict meaning, the category assignments are a bi
231234

232235
| File | Purpose |
233236
|-----------------------------------------------------------------------------------|------------------------------------------------------------------|
234-
| [cppmangle.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/cppmangle.d) | C++ name mangling |
235-
| [cppmanglewin.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/cppmanglewin.d) | C++ name mangling for Windows |
236-
| [basicmangle.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/basicmangle.d) | D name mangling for basic types |
237-
| [dmangle.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dmangle.d) | D [name mangling](https://dlang.org/spec/abi.html#name_mangling) |
237+
| [mangle/cpp.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/mangle/cpp.d) | C++ name mangling |
238+
| [mangle/cppwin.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/mangle/cppwin.d) | C++ name mangling for Windows |
239+
| [mangle/basic.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/mangle/basic.d) | D name mangling for basic types |
240+
| [mangle/package.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/mangle/package.d) | D [name mangling](https://dlang.org/spec/abi.html#name_mangling) |
238241

239242
### Linking
240243

@@ -251,7 +254,7 @@ Note that these groups have no strict meaning, the category assignments are a bi
251254
| [hdrgen.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/hdrgen.d) | Convert an AST into D source code for `.di` header generation, as well as `-vcg-ast` and error messages |
252255
| [json.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/json.d) | Describe the module in a `.json` file for the `-X` flag |
253256
| [dtoh.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dtoh.d) | C++ header generation from D source files |
254-
| [disasm86.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/disasm86.d) | x86-64 dissassembly generation
257+
| [disasm86.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/x86/disasm86.d) | x86-64 disassembly generation
255258
| [disasmarm.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/arm/disasmarm.d) | AArch64 disassembly generation
256259

257260
### Utility
@@ -268,4 +271,3 @@ Note: many other utilities are in [dmd/root](https://github.com/dlang/dmd/tree/m
268271
|---------------------------------------------------------------------------------|---------------------------------------------------------------|
269272
| [asttypename.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/asttypename.d) | Print the internal name of an AST node (for debugging only) |
270273
| [printast.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/printast.d) | Print the AST data structure |
271-
| [foreachvar.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/foreachvar.d) | Used in `ob.d` to iterate over all variables in an expression |

dmd/access.d

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
*
44
* Specification: $(LINK2 https://dlang.org/spec/attribute.html#visibility_attributes, Visibility Attributes)
55
*
6-
* Copyright: Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved
6+
* Copyright: Copyright (C) 1999-2025 by The D Language Foundation, All Rights Reserved
77
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
88
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
9-
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/access.d, _access.d)
9+
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/compiler/src/dmd/access.d, _access.d)
1010
* Documentation: https://dlang.org/phobos/dmd_access.html
11-
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/access.d
11+
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/access.d
1212
*/
1313

1414
module dmd.access;
@@ -22,6 +22,7 @@ import dmd.dstruct;
2222
import dmd.dsymbol;
2323
import dmd.errors;
2424
import dmd.expression;
25+
import dmd.funcsem : overloadApply;
2526
import dmd.location;
2627
import dmd.tokens;
2728

@@ -141,7 +142,7 @@ private bool hasPackageAccess(Module mod, Dsymbol s)
141142
/****************************************
142143
* Determine if scope sc has protected level access to cd.
143144
*/
144-
private bool hasProtectedAccess(Scope *sc, Dsymbol s)
145+
private bool hasProtectedAccess(Scope* sc, Dsymbol s)
145146
{
146147
if (auto cd = s.isClassMember()) // also includes interfaces
147148
{
@@ -163,7 +164,7 @@ private bool hasProtectedAccess(Scope *sc, Dsymbol s)
163164
*/
164165
bool checkAccess(Loc loc, Scope* sc, Expression e, Dsymbol d)
165166
{
166-
if (sc.flags & SCOPE.noaccesscheck)
167+
if (sc.noAccessCheck)
167168
return false;
168169
static if (LOG)
169170
{
@@ -272,7 +273,7 @@ bool symbolIsVisible(Dsymbol origin, Dsymbol s)
272273
* s = symbol to check for visibility
273274
* Returns: true if s is visible by origin
274275
*/
275-
bool symbolIsVisible(Scope *sc, Dsymbol s)
276+
bool symbolIsVisible(Scope* sc, Dsymbol s)
276277
{
277278
s = mostVisibleOverload(s);
278279
return checkSymbolAccess(sc, s);
@@ -287,7 +288,7 @@ bool symbolIsVisible(Scope *sc, Dsymbol s)
287288
* s = symbol to check for visibility
288289
* Returns: true if s is visible by origin
289290
*/
290-
bool checkSymbolAccess(Scope *sc, Dsymbol s)
291+
bool checkSymbolAccess(Scope* sc, Dsymbol s)
291292
{
292293
final switch (s.visible().kind)
293294
{

0 commit comments

Comments
 (0)