mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[region-isolation] When assigning RValues into memory, use tuple_addr_constructor instead of doing it in pieces.
I also included changes to the rest of the SIL optimizer pipeline to ensure that the part of the optimizer pipeline before we lower tuple_addr_constructor (which is right after we run TransferNonSendable) work as before. The reason why I am doing this is that this ensures that diagnostic passes can tell the difference in between: ``` x = (a, b, c) ``` and ``` x.0 = a x.1 = b x.2 = c ``` This is important for things like TransferNonSendable where assigning over the entire tuple element is treated differently from if one were to initialize it in pieces using projections. rdar://117880194
This commit is contained in:
@@ -40,7 +40,7 @@ class LowerTupleAddrConstructorTransform : public SILFunctionTransform {
|
||||
|
||||
unsigned count = 0;
|
||||
visitExplodedTupleValue(
|
||||
inst->getDestValue(),
|
||||
inst->getDest(),
|
||||
[&](SILValue value, std::optional<unsigned> index) -> SILValue {
|
||||
if (!index) {
|
||||
SILValue elt = inst->getElement(count);
|
||||
|
||||
Reference in New Issue
Block a user