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

Better dead code elimination #915

Draft
wants to merge 37 commits into
base: pharo-12
Choose a base branch
from

Conversation

RenaudFondeur
Copy link
Contributor

@RenaudFondeur RenaudFondeur commented Feb 7, 2025

Add a better class for dead code elimination allowing the suppressions of almost all of the hidden hundreds warnings related to unused variables.

Also makes some change in Slang:

  • Move some Slang related transformation before dead code elimination as they are generating dead code.
  • Fix some AST transformations that made exploration/operation incorrect (by breaking parents' links or using the same node in multiple places).

Follow up task:

  • The transformation moved are in expandsAST. They are now duplicated (to avoid breaking existing tests), the second call does nothing.
  • Currently Slang doesn't know how to determine if a selector has a side effect, so the new class uses a list of simple hard coded selectors (- + = > ...), it would be nice for Slang to be able to determine this automatically and support more selectors.
  • The tests of the old algorithm have not been transferred to the new yet.

add a visitor pattern and support for caseStatement and switch
…e in multiple part of the ast, add it to a sender
@RenaudFondeur RenaudFondeur changed the base branch from pharo-10 to pharo-12 February 7, 2025 14:54
@RenaudFondeur RenaudFondeur marked this pull request as draft February 7, 2025 14:55
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.

1 participant