Skip to content

Translate _d_newitem{U,T,iT} to a template#14664

Merged
RazvanN7 merged 1 commit intodlang:masterfrom
teodutu:template-_d_newitemT
May 12, 2023
Merged

Translate _d_newitem{U,T,iT} to a template#14664
RazvanN7 merged 1 commit intodlang:masterfrom
teodutu:template-_d_newitemT

Conversation

@teodutu
Copy link
Member

@teodutu teodutu commented Dec 2, 2022

This contributes to dlang/project-ideas#25 and makes the following changes:

  • Replace _d_newitem{U,T,iT} with a template _d_newitemT that allocates memory for the new struct and performs the required initialisation
  • Move lowering call to _d_newitemT from e2ir.d to expressionsem.d
  • Add lowering field to NewExp that contains the lowered call and use it in e2ir.d
  • Remove _d_newitem{,i}T from rt.lifetime.d

@teodutu teodutu requested a review from ibuclaw as a code owner December 2, 2022 01:10
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @teodutu!

Bugzilla references

Your 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 locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14664"

@UplinkCoder
Copy link
Member

tests seem to be failing.

@teodutu teodutu force-pushed the template-_d_newitemT branch from 97942db to 2d9def4 Compare December 2, 2022 04:08
@teodutu
Copy link
Member Author

teodutu commented Dec 2, 2022

Yeah @UplinkCoder, uniformctor.d fails because __traits(isZeroInit) seems to be true for enums. I'm not sure why implicit.d fails yet.

@teodutu
Copy link
Member Author

teodutu commented Jan 23, 2023

runnable/implicit.d is failing because of this bug: https://issues.dlang.org/show_bug.cgi?id=23650.

@teodutu
Copy link
Member Author

teodutu commented Apr 24, 2023

I managed to avoid https://issues.dlang.org/show_bug.cgi?id=23650 by avoiding the lowering altogether inside __traits(compiles).

@PetarKirov
Copy link
Member

@teodutu please rebase

@teodutu teodutu force-pushed the template-_d_newitemT branch from 1d245f5 to eea4973 Compare May 8, 2023 03:51
@teodutu teodutu force-pushed the template-_d_newitemT branch from eea4973 to 8ccce9e Compare May 8, 2023 04:04
@teodutu
Copy link
Member Author

teodutu commented May 8, 2023

Done @PetarKirov. I'll look into the traceGC errors later this week.

@teodutu teodutu force-pushed the template-_d_newitemT branch 2 times, most recently from 206e85b to 5400302 Compare May 10, 2023 08:19
@teodutu teodutu force-pushed the template-_d_newitemT branch from 5400302 to fedf8e5 Compare May 10, 2023 09:16
@teodutu teodutu requested a review from RazvanN7 May 10, 2023 09:16
@RazvanN7
Copy link
Contributor

cc @dkorpel @PetarKirov this seems to be green now.

@RazvanN7 RazvanN7 added the Merge:72h no objection -> merge The PR will be merged if there are no objections raised. label May 10, 2023
Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly style nits

@teodutu teodutu force-pushed the template-_d_newitemT branch from fedf8e5 to 7077de1 Compare May 11, 2023 05:21
@teodutu
Copy link
Member Author

teodutu commented May 11, 2023

Done @dkorpel. Take another look when you can.

@teodutu teodutu force-pushed the template-_d_newitemT branch 3 times, most recently from 207c374 to 1e21a7c Compare May 11, 2023 05:37
This makes the following changes:
- Replace `_d_newitem{U,T,iT}` with a template `_d_newitemT` that
allocates memory for the new `struct` and performs the required
initialisation
- Move lowering call to `_d_newitemT` from e2ir.d to expressionsem.d
- Add `lowering` field to `NewExp` that contains the lowered call and
use it in e2ir.d
- Remove `_d_newitem{,i}T` from rt.lifetime

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
@teodutu teodutu force-pushed the template-_d_newitemT branch from 1e21a7c to 960326c Compare May 12, 2023 06:47
Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you were going to forward Unqual!T in druntime, but unqualifying in the compiler works too.

@RazvanN7 RazvanN7 merged commit 159a880 into dlang:master May 12, 2023
nybzmr added a commit to nybzmr/dmd that referenced this pull request Mar 19, 2025
thewilsonator pushed a commit that referenced this pull request Mar 19, 2025
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge:72h no objection -> merge The PR will be merged if there are no objections raised.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants