-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-variant layouts for generators #59897
Merged
+804
−331
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
52e4407
Update comment for liveness_of_locals
tmandry 9e06f25
Test debuginfo of different var liveness in generators
tmandry 70c1b6c
Define generator discriminant type in only one place
tmandry 4de2d8a
Give GeneratorLayout a list of fields for each variant
tmandry 5a7af54
Support variantful generators
tmandry 961ba95
Describe generator variants in debuginfo
tmandry 6e2e17d
Make generator object debuginfo easier to read
tmandry f772c39
Include generator locals as field names in debuginfo
tmandry b8f6de4
Generalize discriminant info calls for generators and ADTs
tmandry 9ef2c30
Preserve visibility scopes in stored generator locals
tmandry f7c2f24
Make variant_fields inner an IndexVec
tmandry 15dbe65
Split out debuginfo from type info in MIR GeneratorLayout
tmandry 77a6d29
Address review comments
tmandry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Include generator locals as field names in debuginfo
- 1.85.0
- 1.84.1
- 1.84.0
- 1.83.0
- 1.82.0
- 1.81.0
- 1.80.1
- 1.80.0
- 1.79.0
- 1.78.0
- 1.77.2
- 1.77.1
- 1.77.0
- 1.76.0
- 1.75.0
- 1.74.1
- 1.74.0
- 1.73.0
- 1.72.1
- 1.72.0
- 1.71.1
- 1.71.0
- 1.70.0
- 1.69.0
- 1.68.2
- 1.68.1
- 1.68.0
- 1.67.1
- 1.67.0
- 1.66.1
- 1.66.0
- 1.65.0
- 1.64.0
- 1.63.0
- 1.62.1
- 1.62.0
- 1.61.0
- 1.60.0
- 1.59.0
- 1.58.1
- 1.58.0
- 1.57.0
- 1.56.1
- 1.56.0
- 1.55.0
- 1.54.0
- 1.53.0
- 1.52.1
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.48.0
- 1.47.0
- 1.46.0
- 1.45.2
- 1.45.1
- 1.45.0
- 1.44.1
- 1.44.0
- 1.43.1
- 1.43.0
- 1.42.0
- 1.41.1
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.36.0
commit f772c39bf9fb3af982bb9a4728d4fdc7308a8bbd
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the inner
Vec
could beIndexVec<Field
.Also, surprised this is
LocalDecl
, is that only for debuginfo?If so, can you add something similar to
__upvar_debuginfo_codegen_only_do_not_use
, to ensure there is no cross-talk between debuginfo and non-debuginfo usecases?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, no, we also use it to get the type of the fields in
GeneratorSubsts::state_tys()
. I suppose I can turn it into a struct with something like__upvar_debuginfo_codegen_only_do_not_use
and whatever struct we should be using here. (What should we be using? Right now we only need the type, I think.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that
GeneratorLayout
should only haveTy<'tcx>
, and that debuginfo should be separate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I separated these out and made a
GeneratorField
newtype. That way our layout code will also know when the same field is in two variants so it can lay them out correctly (see the FIXME I added).