Skip to content

[WIP] Upgrade frontend & libs to v2.114 - #5283

Draft
kinke wants to merge 381 commits into
masterfrom
merge-2.114
Draft

[WIP] Upgrade frontend & libs to v2.114#5283
kinke wants to merge 381 commits into
masterfrom
merge-2.114

Conversation

@kinke

@kinke kinke commented Sep 7, 2026

Copy link
Copy Markdown
Member

No description provided.

rainers and others added 30 commits May 17, 2026 22:11
…ates foreach iteration

add test case that failed before the change to templated AA implementation, because it no longer frees the old bucket array when resizing
Three backend symbols were referenced from dmd:frontend modules:

1. statementsem.d and dsymbolsem.d unconditionally imported dmd.iasm
   (inline assembler, backend-only). Wrap the calls in version(NoBackend),
   consistent with how iasm/package.d itself handles the no-backend case.

2. globals.d (dmd:lexer) has Edition used as an AA value type, which
   causes TypeInfo_Enum for Edition to be instantiated in globals.o.
   That TypeInfo references Edition.__init, defined in astenums.d. Since
   astenums.d was only in dmd:frontend (not dmd:lexer), the symbol was
   unresolvable due to static archive link order. Fix by moving astenums.d
   into dmd:lexer and excluding it from dmd:frontend's source path.

Add a regression test (compiler/test/dub_package/frontend_subpackage.d)
that links against dmd:frontend only and calls initDMD(). Add a targeted
CI step (test_frontend_subpackage) that runs this test with both the host
compiler and the freshly-built compiler, using -m${MODEL} to match the
build architecture.

Fixes dlang/dmd#23119

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-05-22

# Conflicts:
#	compiler/include/dmd/scope.h
#	compiler/src/dmd/cli.d
#	compiler/src/dmd/dscope.d
#	compiler/src/dmd/frontend.h
#	compiler/src/dmd/glue/todt.d
#	compiler/src/dmd/statementsem.d
#	compiler/src/dmd/typesem.d
#	compiler/test/fail_compilation/staticarray.d
add pure nogc safe to gcinterface.Range.opEquals
* Add basic CI for -marm codegen using qemu

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Put rdmd in PATH

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove TLS globals in tools/paths.d
Previously, the implicit override of a base class destructor for C++
classes was shallow, so with an empty class B sitting inbetween A and C
you would get a vtbl = [A.~this, C.~this], where dmd considers A.~this
hidden by C.~this. Now, C finds the vtable index of A resulting in
vtbl = [C.~this].

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restructure the diagnostic pipeline so the SARIF output format is a
subclass of the regular compiler error sink instead of a separate
procedural path:

- Move the gating logic (gag handling, error limit, warning and
  deprecation modes) into `ErrorSinkCompiler` and expose a single
  virtual `emit` hook for output customisation.
- Introduce `ErrorSinkSarif` in `dmd.sarif` that extends
  `ErrorSinkCompiler` and overrides `emit`/`plugSink` to build the
  SARIF JSON document; `dmd.errors` no longer imports `dmd.sarif`.
- Drop the global `Diagnostic[]` collection and the `SarifReport`
  indirection in favour of the sink's own `OutBuffer`.
- Move `ErrorKind` from `dmd.errors` to `dmd.errorsink` so the SARIF
  sink does not need to import `dmd.errors`.
- Type `global.errorSink` as `ErrorSinkCompiler` so the gating-state
  fields can be reached without a cast.
- In `main`, swap to `ErrorSinkSarif` once the CLI confirms
  `-verror-style=sarif`.

Behaviour is unchanged; gating still reads its inputs from
`global.params` for now. A follow-up commit migrates those fields onto
`ErrorSinkCompiler`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ErrorSinkCompiler

These four settings used to live on `Param`/`Verbose`. The error sink
now owns them directly, which removes the need for the gating code in
`dmd.errors` to reach across to `global.params`.

Mechanical migration:

- `global.params.useDeprecated`      -> `global.errorSink.useDeprecated`
- `global.params.useWarnings`        -> `global.errorSink.useWarnings`
- `global.params.v.showGaggedErrors` -> `global.errorSink.showGaggedErrors`
- The CLI handlers in `dmd.mars` write straight into the sink.
- `Param.useDeprecated`, `Param.useWarnings`, and
  `Verbose.showGaggedErrors` are removed; `frontend.h` is regenerated.
- `errorLimit` keeps its CLI staging field on `Verbose` (parsed by
  `-verrors=N`) and is mirrored into the sink so it is in effect when
  the very next argument is processed.

No behaviour change.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…atch (dlang/dmd!23194)

* Closes dlang/dmd!17906 - recursive call wrongly assumed nothrow elides catch

When eliminating catch clauses around a try body that cannot throw, the
catch elision passed sc.func to blockExit/canThrow. During nothrow
inference, canThrow treats self-recursive calls as non-throwing to
compute the fixpoint, so a recursive call to the still-being-analyzed
function looked nothrow and the catch (Exception) clause was dropped,
leaving the exception to be caught only by a more general catch (Throwable).

Pass null instead so self-recursive calls are evaluated by their type,
giving the conservative answer needed for catch elision.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Add switch fallthrough in try block test

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
They have been superseded by ./build.d cpp-layout-test
…n stack

Chain the template instantiation through a `mixin` by setting
`tm.tinst`/`sc2.tinst`, so error messages inside mixed-in templates
report where the mixin itself was instantiated from.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… cycle

glue.sisharedctors was not reset between modules in genObjFile, unlike
its sibling arrays. When several modules with @standalone shared static
ctors were compiled in one invocation, an earlier module's ctor leaked
into a later module's __modsharedictor and ran more than once.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
reduce independent use of `global.errorSink.showGaggedErrors`/`global.gag`
When default construction is disabled for a type, emit supplemental errors
showing the chain of reasoning: the offending field(s), recursing into nested
field types, and the `@disable this();` declaration ultimately responsible.

Consolidate the duplicated "default construction is disabled" diagnostics in
`new` expressions (class, struct and array) through the existing `checkDefCtor`
helper, which now handles classes as well as structs and emits the supplemental
messages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rainers and others added 30 commits August 17, 2026 20:20
When an untyped lambda argument couldn't be matched against any
candidate parameter type (e.g. two lambdas passed where the first
one's inferred return type is wrong), the main error line printed
it as void, e.g. is not callable using argument types (void, void).
This didn't help identify which of several lambda arguments was the
problem.

Print the lambda's source text instead, matching what the existing
supplemental 'cannot pass argument ...' line already does.

Fixes dlang/dmd!18923
'hello' ~ s where s is const(char)* only reported a generic type
mismatch, giving no clue why. Concatenating two pointers is a common
mistake with C strings; add a supplemental hint pointing at
std.string.fromStringz as the fix.

Fixes dlang/dmd!17758
thewilsonator noted that the fromStringz hint was shown for any
pointer concatenation (e.g. int* ~ int*), not just character
pointers where the suggestion actually makes sense.
The => shorthand function syntax isn't supported by the older
bootstrap compiler (2.095.0) used in CI.
'integral promotion not done for -header, ... or -cast(int)(header)'
didn't show the operand's type, and the leading '-' on the suggested
rewrite could be misread as a second compiler switch next to
'-revert=intpromote'. Add the operand type and say 'rewrite as' to
make the suggestion unambiguous.

Fixes dlang/dmd!17834
Follow-up to dlang/dmd!23646 — the comment restating why the message was
changed wasn't merged before dkorpel's review comment asking to
remove it landed.
…ant-comment-17834

Remove redundant explanatory comment in intpromote message
….114

Conflicts:
	dmd/astenums.d
	dmd/declaration.d
	dmd/dsymbolsem.d
	dmd/expression.h
	dmd/expressionsem.d
	dmd/frontend.h
	dmd/main.d
	dmd/mars.d
	dmd/pragmasem.d
	dmd/statement.d
	dmd/statementsem.d
	dmd/target.d
	dmd/template.h
	dmd/typesem.d
	dmd/vsoptions.d
	runtime/druntime/src/core/demangle.d
	runtime/druntime/src/core/internal/gc/impl/conservative/gc.d
	runtime/druntime/src/core/stdc/errno.d
	runtime/druntime/src/core/stdc/fenv.d
	runtime/druntime/src/core/stdc/limits.d
	runtime/druntime/src/core/stdc/signal.d
	runtime/druntime/src/core/stdc/stdint.d
	runtime/druntime/src/core/stdc/wchar_.d
	runtime/druntime/src/core/sys/posix/aio.d
	runtime/druntime/src/core/sys/posix/dirent.d
	runtime/druntime/src/core/sys/posix/fcntl.d
	runtime/druntime/src/core/sys/posix/poll.d
	runtime/druntime/src/core/sys/posix/sched.d
	runtime/druntime/src/core/sys/posix/signal.d
	runtime/druntime/src/core/sys/posix/spawn.d
	runtime/druntime/src/core/sys/posix/stdio.d
	runtime/druntime/src/core/sys/posix/sys/ioctl.d
	runtime/druntime/src/core/sys/posix/sys/ipc.d
	runtime/druntime/src/core/sys/posix/sys/mman.d
	runtime/druntime/src/core/sys/posix/sys/resource.d
	runtime/druntime/src/core/sys/posix/sys/shm.d
	runtime/druntime/src/core/sys/posix/sys/socket.d
	runtime/druntime/src/core/sys/posix/sys/stat.d
	runtime/druntime/src/core/sys/posix/sys/types.d
	runtime/druntime/src/core/sys/posix/sys/un.d
	runtime/druntime/src/core/sys/posix/sys/wait.d
	runtime/druntime/src/core/sys/posix/time.d
	runtime/druntime/src/core/thread/fiber/base.d
	runtime/druntime/src/core/thread/fiber/package.d
	runtime/druntime/src/core/thread/fiber/switch_context_asm.S
	runtime/druntime/src/core/thread/osthread.d
	runtime/druntime/src/core/thread/threadbase.d
	runtime/druntime/src/core/time.d
	runtime/druntime/src/importc.h
	runtime/druntime/src/rt/alloca.d
	runtime/druntime/src/rt/sections_elf_shared.d
	runtime/druntime/test/importc_compare/src/importc_compare.d
	tests/dmd/compilable/cdcmp.d
	tests/dmd/compilable/ftimetrace.d
	tests/dmd/compilable/objc_class.d
	tests/dmd/compilable/test21672.d
	tests/dmd/compilable/test24130.c
	tests/dmd/compilable/test3004.d
	tests/dmd/fail_compilation/fail17105.d
	tests/dmd/fail_compilation/fail18372.d
	tests/dmd/fail_compilation/fail3753.d
	tests/dmd/fail_compilation/fail6451.d
	tests/dmd/fail_compilation/sarifmultiple_test.d
	tests/dmd/fail_compilation/vector_types.d
	tests/dmd/fail_compilation/xmmslice.d
	tests/dmd/runnable/bitfieldsposix64.c
	tests/dmd/runnable/casting.d
	tests/dmd/runnable/dbitfieldsposix64.d
	tests/dmd/runnable/objc_instance_variable.d
	tests/dmd/runnable/test_cdstrpar.d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.