Skip to content

Conversation

gottesmm
Copy link
Contributor

The reason why we are doing this is that this combination of read/set forces the compiler to emit a copy if we want to emit a modify operation.

The reason why we are forced to emit such a copy is that:

  1. _read provides a guaranteed value in memory
  2. performing a modify requires an owned value in memory.

This together implies that the only way we can do this is to copy from the _read into temporary memory. But we have a noncopyable type so we can't do this.

rdar://112915525

…pes.

The reason why we are doing this is that this combination of read/set forces the
compiler to emit a copy if we want to emit a modify operation.

The reason why we are forced to emit such a copy is that:

1. _read provides a guaranteed value in memory
2. performing a modify requires an owned value in memory.

This together implies that the only way we can do this is to copy from the _read
into temporary memory. But we have a noncopyable type so we can't do this.

rdar://112915525
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm merged commit 8c82b6b into swiftlang:main Jul 26, 2023
@gottesmm gottesmm deleted the pr-9bcf05ac3fb12f2872cc63507f782c766eba18b7 branch July 26, 2023 23:44
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.

1 participant