Conversation
|
Thanks for your pull request and interest in making D better, @teodutu! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. 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 + druntime#3587" |
1e9b037 to
2eaed68
Compare
|
@teodutu @RazvanN7 have you considered casting away void _d_arrayctor(T)(return scope T[] to, scope const(T)[] from);
struct S {};
const S[2] b;
const S[2] a = b; // gets lowered to:
const S[2] a = void;
_d_arrayctor!S(cast(S[]) a, b);Essentially, Also, why does |
Not yet, but this might work. Thanks!
This is necessary for constructors where you might do something like this: struct S
{
int[3] a, b;
this (ref int[3] c)
{
a = b = c;
// this would be lowered to: _d_arrayctor(a, _d_arrayctor(b, c))
}
} |
|
@PetarKirov But isn't that going to make the call to |
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
2eaed68 to
254c1e2
Compare
254c1e2 to
1a82c3e
Compare
druntime PR: dlang/druntime#3587 Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
druntime PR: dlang/druntime#3587 Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
This undoes the changes brought by dlang#3611 Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
1a82c3e to
18e0799
Compare
druntime PR: dlang/druntime#3587 Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
druntime PR: dlang/druntime#3587 Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
|
Please follow-up on deleting the |
druntime PR: dlang/druntime#3587 Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* Lower array construction to _d_array{,set}ctor
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
* Remove backend code for _d_array{,set}ctor
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
* Intercept and handle _d_array{,set}ctor for CTFE
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
* Merge similar branches
* Fix failing test errors
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* Update frontend.h with symbols for new templates
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* Fix _d_array functions position in frontend.h
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* _d_arrayctor: Update CTFE for weakly pure hook
druntime PR: dlang/druntime#3587
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
Co-authored-by: Dan Printzell <xwildn00bx@gmail.com>
* Lower array construction to _d_array{,set}ctor
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
* Remove backend code for _d_array{,set}ctor
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
* Intercept and handle _d_array{,set}ctor for CTFE
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
* Merge similar branches
* Fix failing test errors
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* Update frontend.h with symbols for new templates
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* Fix _d_array functions position in frontend.h
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* _d_arrayctor: Update CTFE for weakly pure hook
druntime PR: dlang/druntime#3587
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
Co-authored-by: Dan Printzell <xwildn00bx@gmail.com>
This PR changes
_d_arrayctorfrom a pure function to a weakly pure function.This change is required because the removal of the
_d_arrayctorhook implemented in this PR: dlang/dmd#13116, lowers constructions such as the one below to calls to_d_arrayctor:The above code is lowered to
_d_arrayctor(a, b). For const and immutable arguments, the function is strongly pure, and since its return value is ignored, the compiler might choose to remove the call altogether.In order to avoid this behaviour,
_d_arrayctorhas to be made weakly pure, which is what the added 3rd parameter does.