swift
a571357c - [move-only] Change noncopyable lets to be emitted as boxes like vars.

Commit
2 years ago
[move-only] Change noncopyable lets to be emitted as boxes like vars. Some notes: 1. This ensures that if we capture them, we just capture the box by reference. 2. We are still using the old incorrect semantics for captures. I am doing this so I can bring this up in separate easy to understand patches all of which pass all of the moveonly tests. 3. Most of the test edits are due to small differences in error messages in between the object and address checker. 4. I had to add a little support to the move only address checker for a small pattern that doesn't occur with vars but do es occur for lets when we codegen like this, specifically around enums. The pattern is we perform a load_borrow and then copy_value and then use the result of the copy_value. Rather than fight SILGen pattern I introduced a small canonicalization into the address checker which transforms that pattern into a load [copy] + begin_borrow to restore the codegen to a pattern the checker expects. 5. I left noimplicitcopy alone for now. But we should come back around and fix it in a similar way. I just did not have time to do so.
Author
Committer
Parents
Loading