-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix: move analyzer regression with variants #1311
fix: move analyzer regression with variants #1311
Conversation
* move switch lowering into separate procedure * don't require a mutable `MirBody`, use the `MirTree`s + mutable `Changeset` signature * apply destructor-injection/move-analysis and switch lowering concurrently in a single batch
The field name and argument were not separated by a colon.
Aren't they applied more sequentially, and not concurrently? |
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.
One minor question about the PR message body, but otherwise it's good to go.
Previously, both passes were implemented in the
now, application change to:
that is, both passes are applied to the same tree and the changes are then (effectively) merged. While it would have been possibly to keep |
/merge Thanks for the detailed explanation, the diagrams are super handy. |
Merge requested by: @saem Contents after the first section break of the PR description has been removed and preserved below:
|
Summary
Separate the
switch
lowering and destructor injection into two properpasses and apply them concurrently, fixing a move analyzer regression.
Details
switch
lowering out ofinjectDestructorCalls
Changeset
instead of a mutableMirBody
to the two passesin
injectdestructors
switch
lowering are applied in a singlebatch by
backends.process
switch
lowering is still disabled for the VM backendinjectDestructorCalls
to reflect realityMove Analyzer
Applying both passes concurrently - instead of the destructor-
injection/move-analysis after
switch
lowering - fixes a regressionfrom ae54312
The move analyzer now sees a discriminator assignment as:
x.discr = y
instead of:
allowing it to perform automatic moves from non-variant fields again
(refer to
tmove_from_non_variant_field.nim
).Misc
missing between the field and value