Skip to content

Upgrade frontend & libs to v2.112 #4949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 117 commits into
base: master
Choose a base branch
from
Open

Upgrade frontend & libs to v2.112 #4949

wants to merge 117 commits into from

Conversation

kinke
Copy link
Member

@kinke kinke commented Jun 7, 2025

No description provided.

TurkeyMan and others added 30 commits March 10, 2025 04:06
…lt to be treated as __rvalue. (dlang/dmd!20946)

This is essential to implement `move`, `forward`, etc.
This brings the compiler's behavior in line with the language spec.

Fixes dlang/dlang.org#4137
- Removed references to _d_arrayappendcTX, _d_newThrowable, and _d_arrayappendT.
- Ensured test cases pass after deletion.
- Left _d_arrayctor and _d_arraysetctor untouched for future semantic phase changes.
…dmd!21001)

* Fix: Prevent ICE on final switch forward referencing its enum

* more simpler approach

* moved the enum member analysis

* Move enum number analysis to sementic2

* WhiteSpace Remove

* Remove Redundant Code in enumsem
* 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. (dlang/dmd!20946)

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

* memoryerror.d: Fix AnySupported version condition (dlang/dmd!20983)

* Fix dlang/dmd!20982 - wrong line number in iasmgcc (dlang/dmd!20993)

* Move genCfunc to cxxfrontend (dlang/dmd!20992)

* druntime: Fix compilation of rt.cover on Android (dlang/dmd!21015)

* Expose SourceLoc to C++ interface (dlang/dmd!20980)

* [stable] C++ header fixes for declaration, expression, and typinf (dlang/dmd!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 (dlang/dmd!21017)

* Fix dlang/dmd!21020 - Indexing a *cast* AA yields no lvalue anymore (dlang/dmd!21029)

* Add C++23 to CppStdRevision enum (dlang/dmd!21043)

* Improve UFCS/property error message (dlang/dmd!21046)

---------

Co-authored-by: Manu Evans <[email protected]>
Co-authored-by: Martin Kinkelin <[email protected]>
Co-authored-by: Iain Buclaw <[email protected]>
Co-authored-by: Martin Kinkelin <[email protected]>
Fixes dlang/dmd!21068.
Also say base class *constructor* in supplemental message.
* Refactored memcpy calls to D slices

* Added .DS_Store to .gitignore
… 128

This enables using (LLVM/gcc) intrinsics for shifts, for which such
inputs are undefined behavior, as for builtin types.
…(dlang/dmd!21067)

* Fix dlang#18262 - Resolved special enum case and other conflicts

* Fix dlang#18262 - Resolved Special Enum case and failing test.

* Fix dlang#18262 - Resolved special enum case and other failing tests
kinke and others added 15 commits May 7, 2025 06:26
… as virtual even though they are not in the vtbl

isVirtual not good enough to check whether a function is virtual
…order in a debugger

set SFLhidden for hidden parameter
reconstruct order in calcLexicalScope
…lang/dmd!21361)

[stable] Fix dlang/dmd!21359 - Merge more types in `substWildTo()`

Signed-off-by: Rainer Schuetze <[email protected]>
Merged-on-behalf-of: Martin Kinkelin <[email protected]>
As that can cause a 'compatible' function type with resolved return type
to wrongly get that deco. This is what happens with LDC for a particular
test case as D v2.111 regression, causing an assertion in the frontend
while generating a TypeInfo_Function for some TypeFunction, with
`TypeFunction.next` being null (unknown return type).

The relevant `genTypeInfo()` calls before the patch, in the format
`genTypeInfo: <type> (<deco>), <type after merge2()> (<deco after merge2()>)`:
```
// const funcptr: TypeInfo_Const
genTypeInfo: const(Algebraic!() function(Function) nothrow @System) (xPFNbC4util8FunctionZSQq__T9AlgebraicZQl), const(Algebraic!() function(Function) nothrow @System) (xPFNbC4util8FunctionZSQq__T9AlgebraicZQl)
// mutable funcptr: TypeInfo_Pointer
genTypeInfo: Algebraic!() function(Function) nothrow @System (PFNbC4util8FunctionZSQq__T9AlgebraicZQl), Algebraic!() function(Function) nothrow @System (PFNbC4util8FunctionZSQq__T9AlgebraicZQl)
// function: TypeInfo_Function
// NOTE the missing Algebraic return type in the decos, this is the bug
genTypeInfo: nothrow @System Algebraic!()(Function) (FNbC4util8FunctionZ), nothrow @System (Function) (FNbC4util8FunctionZ)
```

With this patch:
```
genTypeInfo: const(Algebraic!() function(Function) nothrow @System) (xPFNbC4util8FunctionZSQq__T9AlgebraicZQl), const(Algebraic!() function(Function) nothrow @System) (xPFNbC4util8FunctionZSQq__T9AlgebraicZQl)
genTypeInfo: Algebraic!() function(Function) nothrow @System (PFNbC4util8FunctionZSQq__T9AlgebraicZQl), Algebraic!() function(Function) nothrow @System (PFNbC4util8FunctionZSQq__T9AlgebraicZQl)
genTypeInfo: nothrow @System Algebraic!()(Function) (FNbC4util8FunctionZSQq__T9AlgebraicZQl), nothrow @System Algebraic!()(Function) (FNbC4util8FunctionZSQq__T9AlgebraicZQl)
```
…ang/dmd!21398)

Fix issue dlang/dmd!21397 - Refcounting with Throwable is unsound

Signed-off-by: Martin Kinkelin <[email protected]>
Merged-on-behalf-of: Martin Kinkelin <[email protected]>
…ompiler (dlang/dmd!21407)

check for missing ident
….112

Conflicts:
	dmd/typesem.d
	runtime/druntime/src/core/int128.d
	tests/dmd/compilable/test3004.d
kinke and others added 6 commits June 8, 2025 05:59
…folder 64, not to 64.obj (dlang/dmd!21401) (dlang/dmd!21433)

this avoids concurrently creating the same file multiple times

Co-authored-by: Rainer Schuetze <[email protected]>
…use optimized core.checkedint.mulu() instead
The new templated function's signature isn't suited to adapt this
existing optimization - the old length is in the by-ref passed slice,
not a separate parameter anymore, so we can't trivially check for
a constant.

I guess its effect is negligible, plus the new template provides
regular inlining opportunities, so just remove it.
@kinke
Copy link
Member Author

kinke commented Jun 14, 2025

I don't know how to fix dlang/dmd#21241 elegantly in LDC - I guess we'd have to resort to IR-renaming colliding C static functions ourselves, breaking .mangleof (CT-inspection on the D side), and potentially further complications wrt. forward declarations.

I'm inclined to not fix this - we're a D compiler, with the ability to compile some C code too (though discouraged - use importC for importing only, as the name suggests; and if you need to compile some non-trivial C parts, use a proper C compiler and mix the D/C++ builds via reggae instead). This flexibility means you can compile multiple C modules to a single object file, unlike with C, and this causes the issue. So as noted in the upstream issue, can also be worked around by compiling to separate object files (such as with -lib).

Edit: And unlike DMD, we emit a warning at least when hitting such a case of conflicting mangles in an object file.

@kinke
Copy link
Member Author

kinke commented Jun 14, 2025

That's the single failure on Posix AFAICT. On Windows, debuginfo tests in runnable/testpdb.d have been extended and now fail on Win64. Everything else seems green.

@rainers
Copy link
Contributor

rainers commented Jun 15, 2025

On Windows, debuginfo tests in runnable/testpdb.d have been extended and now fail on Win64.

dmd used to declare function parameters in the wrong order. I see no separator between parameters and locals in the debug info generated by LDC-1.40.1, so I would expect the checks for DataKind.DataIsParam to fail. But that test passes with LDC-1.40.1 for me. Instead test21382 fails (because LDC does not emit member functions).

@kinke
Copy link
Member Author

kinke commented Jun 16, 2025

Instead test21382 fails (because LDC does not emit member functions).

Interestingly, it seems to work on 32-bit Windows though. I had to double-check, thinking that the test muss somehow be skipped on Win32, but no, it seems to be run and work. We do set the DI parent scope of member function definitions to the struct/class type (in IR), we 'just' don't explicitly add any functions as members when defining the parent aggregate type in IR (which clang does).

kinke added 2 commits June 16, 2025 14:24
Fixes dmd-testsuite's runnable/structinit.c, which imports assert.h,
causing LDC to validate the signature.
@kinke kinke marked this pull request as ready for review June 16, 2025 15:09
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.