Translate _d_newarray{U,iT,T} to a single template#15299
Translate _d_newarray{U,iT,T} to a single template#15299RazvanN7 merged 2 commits intodlang:masterfrom
_d_newarray{U,iT,T} to a single template#15299Conversation
|
Thanks for your pull request, @teodutu! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#15299" |
2b695a7 to
6cf7bf2
Compare
cf561a3 to
bde3a7f
Compare
bde3a7f to
9881fb9
Compare
|
Is |
9881fb9 to
04e8b5a
Compare
04e8b5a to
5eaf2ea
Compare
abfc554 to
b3ddd1f
Compare
@ibuclaw, I will take care of [1] dmd/compiler/src/dmd/root/rmem.d Lines 208 to 279 in 646fc3d |
|
So far the DMD and phobos tests are passing. The builkite failure seems unrelated. I tested it locally and it gives the same error when using either |
b3ddd1f to
f45431d
Compare
8455979 to
3162060
Compare
faaa8f7 to
f222386
Compare
|
[1] [2] https://github.com/dlang/dmd/blob/396fc8d477ca66e20f6b4fec4d532f2aee053ba3/druntime/src/rt/lifetime.d#L1135C19-L1158 |
f222386 to
df896e1
Compare
This copies `__setArrayAllocLength()`, `__arrayAlloc()` and moves `__arrayStart()` and `__arrayClearPad()` to `core.internal.array.utils.d`. This is needed because `_d_newarrayT()` calls these functions from `rt.lifetime.d`, but the file cannot be imported from `core.internal.array.creation.d`. Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
This achieves the following:
- Convert `_d_newarray{U,iT,T}` to a single template `_d_newarrayT` that
handles arrays of elements that either have an init symbol or are
zero-initialised.
- Move compiler lowering to the semantic phase
- Store lowered expression in `NewExp.lowering`
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
df896e1 to
00c1822
Compare
|
Up until this point we have not put into changelogs the templatization of druntime hooks. However, if people find it useful we could add it. @WalterBright @ibuclaw what do you think? I, personally, don't see any harm in putting such info in the changelog, except that it might be more verbose with no benefit for the majority of the readers (having a custom runtime should be a niche use case). |
|
@RazvanN7 Having a changelog helps knowing what you have to do for each version of the compiler you want to support with your custom runtime. |
…RRAYIT, TRACENEWARRAYT and TRACENEWARRAYIT
* Remove RTLSYM for Translation PR #15819: Removed NEWARRAYMITX, NEWARRAYMITX, TRACENEWARRAYMTX and TRACENEWARRAYMITX * Remove RTLSYM for Translation PR #15299: Removed NEWARRAYT, NEWARRAYIT, TRACENEWARRAYT and TRACENEWARRAYIT * Remove RTLSYM for Translation PR #14837: Removed NEWCLASS, TRACENEWCLASS * Remove RTLSYM for Translation PR #14664: Removed NEWITEMT, NEWITEMIT, TRACENEWITEMT and TRACENEWITEMIT * Remove RTLSYM for Translation PR #14550: Removed ARRAYCATNTX, ARRAYCATT, TRACEARRAYCATNTX and TRACEARRAYCATT * Remove RTLSYM for Translation PR #14382: Removed ARRAYSETASSIGN * Remove RTLSYM for Translation PR #14310: Removed ARRAYASSIGN * Remove RTLSYM for Translation PR #13495: Removed ARRAYAPPENDT, ARRAYAPPENDCTX, TRACEARRAYAPPENDT and TRACEARRAYAPPENDCTX
PR dlang#15299 added the template `_d_newarrayU`, but not its corresponding trace-GC hook. This commit adds the latter as a wrapper on top of `_d_newarrayUPureNothrow` so `_d_newarrayUTrace` can be called from such contexts Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
PR dlang#15299 added the template `_d_newarrayU`, but not its corresponding trace-GC hook. This commit adds the latter as a wrapper on top of `_d_newarrayUPureNothrow` so `_d_newarrayUTrace` can be called from such contexts Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
PR dlang#15299 added the template `_d_newarrayU`, but not its corresponding trace-GC hook. This commit adds the latter as a wrapper on top of `_d_newarrayUPureNothrow` so `_d_newarrayUTrace` can be called from such contexts Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
PR dlang#15299 added the template `_d_newarrayU`, but not its corresponding trace-GC hook `_d_newarrayUTrace`. This commit adds the latter as a wrapper on top of `_d_newarrayUPureNothrow` so `_d_newarrayUTrace` can be called from such contexts. Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
PR dlang#15299 added the template `_d_newarrayU`, but not its corresponding trace-GC hook `_d_newarrayUTrace`. This commit adds the latter as a wrapper on top of `_d_newarrayUPureNothrow` so `_d_newarrayUTrace` can be called from such contexts. Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
) PR #15299 added the template `_d_newarrayU`, but not its corresponding trace-GC hook `_d_newarrayUTrace`. This commit adds the latter as a wrapper on top of `_d_newarrayUPureNothrow` so `_d_newarrayUTrace` can be called from such contexts. Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
|
This PR introduced a regression #22517 |
This achieves the following:
_d_newarray{U,iT,T}to a single template_d_newarrayTthat handles arrays of elements that either have an init symbol or are zero-initialised.NewExp.loweringrt.lifetime.dtocore.internal.array.utils.d. Some cannot be removed fromrt.lifetime.dbecause they're still used by non-template hooks and it's impossible to get a type from aTypeInfoargument at compile time as required by templates.This is still a draft because some tests are failing locally and I don't see how they're related to my changes. I just wanted to see if they also fail when running the tests remotely.