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

Isolate mutation on func_ir._definitions #3940

Closed
wants to merge 5 commits into from

Conversation

sklam
Copy link
Member

@sklam sklam commented Apr 3, 2019

WIP. DO NOT MERGE

This is a refactor on the func_ir._definitions attribute usage.

._definitions is now immutable and autogenerated from the IR so it is never out-of-sync.
• a new .temp_definitions is added to find places that does temporary mutation on it (like in array_analysis.py and inline_closurecall.py). These temporary mutations are not yet visible in the IR, yet. (TODO: refactor these mutations so we get remove .temp_definitions.

@sklam
Copy link
Member Author

sklam commented Apr 8, 2019

It is failing on py27 due to ChainMap usage. Once we get rid of .temp_definitions, we can get rid of ChainMap as well.

@ehsantn
Copy link
Collaborator

ehsantn commented Apr 8, 2019

how should transformations that change definitions as they go work?

@sklam
Copy link
Member Author

sklam commented Apr 8, 2019

Now that the definition-changing code is isolated, I think we can pull temp_definitions out of func_ir. Once the transformation is done, temp_definitions can be discarded and the IR should reflect new definitions.

@sklam
Copy link
Member Author

sklam commented Apr 8, 2019

If code transformation should fail, the func_ir state is still self-consistent.

@github-actions
Copy link

This pull request is marked as stale as it has had no activity in the past 3 months. Please respond to this comment if you're still interested in working on this. Many thanks!

@github-actions github-actions bot added the stale Marker label for stale issues. label May 13, 2023
@github-actions github-actions bot added the abandoned - stale PRs automatically closed due to stale status label May 20, 2023
@github-actions github-actions bot closed this May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress abandoned - stale PRs automatically closed due to stale status stale Marker label for stale issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants