Skip to content
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

Backport PR 10090 #39

Merged
merged 6 commits into from
Aug 2, 2022
Merged

Backport PR 10090 #39

merged 6 commits into from
Aug 2, 2022

Conversation

ccasin
Copy link
Contributor

@ccasin ccasin commented Aug 1, 2022

Pulling in upstream PR 10090.

This is needed for let mutable, because it fixes bugs in how lambda/simplif.ml deals with mutable variables. We initially thought we could get away with a small tweak to simplif to prevent a let binding like let mutable x = .. in .. from being substituted away. But there are trickier cases where subsequent non-mutable lets whose bound variable is defined in terms of x are themselves substituted away (which is bad, as the programmer wanted the value of x at the place it was mentioned). Preventing that requires tracking which variables are mutable in lambda, which is what this PR does, so we may as well just take all of it.

The backport was mostly straightforward, except that translcomprehension.ml needed a lot of work because it used the removed Variable let kind. The printing of lets in printlambda.ml also needed manual merging.

@ccasin ccasin requested a review from stedolan August 1, 2022 20:33
@stedolan stedolan merged commit 97be59d into ocaml-flambda:main Aug 2, 2022
antalsz pushed a commit to antalsz/ocaml-jst that referenced this pull request Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants