about summary refs log tree commit diff
path: root/src/test/ui/thinlto
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-05-04 03:18:14 +0000
committerbors <bors@rust-lang.org>2019-05-04 03:18:14 +0000
commite2326366935613816927e679d3b2dc04db44678c (patch)
tree9d9b3fb6ed6d688cf60a74b6072b325e8abb5872 /src/test/ui/thinlto
parent13fde05b12c28e1ed66bd13fdf1ea392f166b811 (diff)
parent77a6d29f483c6a1925a90f7e54b0d5721806d8fa (diff)
downloadrust-e2326366935613816927e679d3b2dc04db44678c.tar.gz
rust-e2326366935613816927e679d3b2dc04db44678c.zip
Auto merge of #59897 - tmandry:variantful-generators, r=eddyb
Multi-variant layouts for generators

This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants.

Required for optimizing generator layouts (#52924).

There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible.

This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator.

Also, fixes #59972.

Future work:
- Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924)
- In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172)
- Preserve debuginfo scopes across generator yield points
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions