diff options
| author | bors <bors@rust-lang.org> | 2019-05-22 04:42:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-22 04:42:20 +0000 |
| commit | 1cc822c261f5c94a41eb725755fdda7ca6efbda2 (patch) | |
| tree | 7cef8fc95f0d6c858dcebd6741f51db0b1be441e /src/test/ui/thinlto | |
| parent | dbfe70dfcdb0eab5e1e21f419c718e58cf62029b (diff) | |
| parent | 26c37d7b168781d8be0236fdcdcb502b6c2b8ee2 (diff) | |
| download | rust-1cc822c261f5c94a41eb725755fdda7ca6efbda2.tar.gz rust-1cc822c261f5c94a41eb725755fdda7ca6efbda2.zip | |
Auto merge of #60840 - tmandry:preserve-scope-in-generator-mir, r=cramertj
Preserve local scopes in generator MIR Part of #52924, depended upon by the generator layout optimization #60187. This PR adds `StorageDead` statements in more places in generators, so we can see when non-`Drop` locals have gone out of scope and recover their storage. The reason this is only done for generators is compiler performance. See https://github.com/rust-lang/rust/pull/60187#issuecomment-485637811 for what happens when we do this for all functions. For `Drop` locals, we modify the `MaybeStorageLive` analysis to use `drop` to indicate that storage is no longer live for the local. Once `drop` returns or unwinds to our function, we implicitly assume that the local is `StorageDead`. Instead of using `drop`, it is possible to emit more `StorageDead` statements in the MIR for `Drop` locals so we can handle all locals the same. I am fine with doing it that way, but this was the simplest approach for my purposes. It is also likely to be more performant. r? @Zoxc (feel free to reassign) cc @cramertj @eddyb @RalfJung @rust-lang/wg-async-await
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions
