-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace aliases
in Aliases_of_canonical_element.t
with 3 fields
#383
base: flambda2.0-stable
Are you sure you want to change the base?
Conversation
`Aliases_of_canonical_element.t` carries around a map from `Name_mode.t` to `Simple.Set.t` so that it can compute the earliest element in each name mode. This is less efficient than simply having a field for each name mode. Furthermore, we don't need the sets if we just track the earliest for each name mode (along with its binding time).
@poechsel is going to review this! |
update_all_earliest t ~f:(fun earliest -> | ||
match earliest with | ||
| Earliest { name; _ } when Simple.is_var name -> No_alias | ||
| _ -> earliest) |
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.
Please use No_alias in that case
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.
Sorry, which case?
{ t with all; } | ||
|
||
let move_variables_to_mode_in_types t = | ||
update_all_earliest t ~f:(fun earliest -> |
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.
This looks wrong. I would expect earliest
and earliest_ge_in_types
to be left unchanged by this function.
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.
(Although #393 gets rid of this function completely, so maybe it isn't that important anyway)
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.
!! Yes, of course.
Aliases_of_canonical_element.t
carries around a map fromName_mode.t
to
Simple.Set.t
so that it can compute the earliest element in eachname mode. This is less efficient than simply having a field for each
name mode. Furthermore, we don't need the sets if we just track the
earliest for each name mode (along with its binding time).