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

rename redefined variables #67

Merged
merged 3 commits into from
Mar 25, 2024
Merged

Conversation

ailrst
Copy link

@ailrst ailrst commented Mar 22, 2024

Adds a transform pass that renames variables that have multiple definitions in the same scope.

Fixes #43

Copy link
Member

@katrinafyi katrinafyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if you've fixed these already.

it would be good if the indentation is fixed, and everything else is just commentary.

@katrinafyi
Copy link
Member

katrinafyi commented Mar 25, 2024

This changeset slows dune runtest by 10 seconds in total, investigating. (also visible in CI where the change is more pronounced)

Edit: seems to be the globals initialisation within scoped_bindings.

      let globals =  Seq.map (fun f -> (f, {name=f; index=0})) (IdentSet.to_seq globals) in

pushing an empty IdentMap instead seems to work ok..? there shouldn't be any redeclarations of global variables.

@ailrst ailrst force-pushed the rename-redefined-variables branch from f3123da to 1d181b1 Compare March 25, 2024 03:41
@ailrst ailrst force-pushed the rename-redefined-variables branch from 2121916 to f524b4b Compare March 25, 2024 05:50
@katrinafyi katrinafyi enabled auto-merge (squash) March 25, 2024 06:33
@katrinafyi katrinafyi merged commit 00984c6 into partial_eval Mar 25, 2024
1 check passed
@katrinafyi katrinafyi deleted the rename-redefined-variables branch April 15, 2024 06:05
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.

local variables are re-declared when used within for loops.
2 participants