Commit 4964a66
committed
silgen: inherit eval scope for OpenExistentialExpr
We were not able to use an existential as the base
of an access that strictly borrows the existential,
because SILGen's RValue emission would establish
a fresh evaluation scope just for the existential's
opening, and then copy the opened value out.
This is problematic for noncopyable existentials.
So this patch moves & adds FormalEvaluationScope's
around so they're broad enough to enable a
borrow of an existential. The idea behind this
refactoring is to establish top-level
FormalEvaluationScopes when initially creating
RValue's for Expr's in SILGen. Any more-tightly
scoped operations will already establish their own
nested scope, so this is mostly adding safe-guards.
I've limited the existentials fix to noncopyables
for now.
part of rdar://1590798181 parent 906a4cb commit 4964a66
3 files changed
+21
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1770 | 1770 | | |
1771 | 1771 | | |
1772 | 1772 | | |
| 1773 | + | |
1773 | 1774 | | |
1774 | 1775 | | |
1775 | 1776 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
415 | 416 | | |
416 | 417 | | |
417 | 418 | | |
| |||
6161 | 6162 | | |
6162 | 6163 | | |
6163 | 6164 | | |
| 6165 | + | |
| 6166 | + | |
6164 | 6167 | | |
6165 | 6168 | | |
6166 | 6169 | | |
| |||
6494 | 6497 | | |
6495 | 6498 | | |
6496 | 6499 | | |
6497 | | - | |
| 6500 | + | |
6498 | 6501 | | |
6499 | 6502 | | |
6500 | 6503 | | |
| |||
6529 | 6532 | | |
6530 | 6533 | | |
6531 | 6534 | | |
6532 | | - | |
| 6535 | + | |
| 6536 | + | |
| 6537 | + | |
| 6538 | + | |
| 6539 | + | |
| 6540 | + | |
| 6541 | + | |
| 6542 | + | |
6533 | 6543 | | |
6534 | 6544 | | |
6535 | 6545 | | |
| |||
7514 | 7524 | | |
7515 | 7525 | | |
7516 | 7526 | | |
| 7527 | + | |
| 7528 | + | |
7517 | 7529 | | |
7518 | 7530 | | |
7519 | | - | |
7520 | 7531 | | |
7521 | 7532 | | |
7522 | 7533 | | |
7523 | 7534 | | |
7524 | 7535 | | |
7525 | 7536 | | |
7526 | 7537 | | |
7527 | | - | |
7528 | 7538 | | |
7529 | 7539 | | |
7530 | 7540 | | |
| |||
7559 | 7569 | | |
7560 | 7570 | | |
7561 | 7571 | | |
7562 | | - | |
7563 | 7572 | | |
7564 | 7573 | | |
7565 | 7574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
| 732 | + | |
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
| |||
774 | 775 | | |
775 | 776 | | |
776 | 777 | | |
777 | | - | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
778 | 783 | | |
779 | 784 | | |
780 | 785 | | |
| |||
0 commit comments