Commit ac01ca6
SILGen: revise emission of UnreachableExpr
The prior emission strategy produced some scary SIL where
we have a copy of uninitialized memory:
```
ignored_use %14
%16 = alloc_stack $T
unreachable
bb1:
copy_addr [take] %16 to [init] %0
dealloc_stack %16
```
I assume this was done to dodge the SILVerifier, which
will catch a take of an uninitialized address, had the
alloc_stack been in any reachable predecessor.
We already have a representation for an undefined value
in SIL, so I'd rather use that than try to sneak one
past the verifier.
This adjusted emission also is opaque values friendly,
as it doesn't assume the result value is an address.
resolves rdar://1622395571 parent 94b1435 commit ac01ca6
File tree
3 files changed
+50
-8
lines changed- lib/SILGen
- test/SILGen
3 files changed
+50
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2637 | 2637 | | |
2638 | 2638 | | |
2639 | 2639 | | |
2640 | | - | |
2641 | | - | |
2642 | | - | |
2643 | | - | |
| 2640 | + | |
2644 | 2641 | | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
2645 | 2647 | | |
| 2648 | + | |
| 2649 | + | |
2646 | 2650 | | |
2647 | | - | |
| 2651 | + | |
| 2652 | + | |
2648 | 2653 | | |
2649 | | - | |
2650 | | - | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
2651 | 2662 | | |
2652 | | - | |
| 2663 | + | |
| 2664 | + | |
2653 | 2665 | | |
2654 | 2666 | | |
2655 | 2667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
433 | 443 | | |
434 | 444 | | |
435 | 445 | | |
0 commit comments