MoveOnlyAddressChecker: Confine analysis to current formal access. #64850
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Code can only locally interact with a mutable memory location within a formal access, and is only responsible for maintaining its invariants during that access, so the move-only address checker does not need to, and should not, observe operations that occur outside of the access marked with the
mark_must_check
instruction. And for immutable memory locations, although there are no explicit formal accesses, that's because every access other than the initialization must be read-only, so although individual accesses are not delimited, they are all compatible as far as move-only checking is concerned. So we can back out the changes to SILGen to re-project a memory location from its origin on every access, a change which breaks invariants assumed by other SIL passes.rdar://106204488