-
Notifications
You must be signed in to change notification settings - Fork 196
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
[enhancement] : Implement a multi-pass analysis #58
Comments
This is part of a broader problem. For PiranhaJava, multi-pass analysis is not yet implemented.
I am increasing the scope of this issue to address these two issues. |
@mkr-plse @swayamraina is there high level explanation on what needs to be done for a multi pass analysis? may be that could help with contributions. |
In the current single pass analysis (in PiranhaJava), the code associated with the feature flags based on the configured APIs is removed. However, the code that becomes dead code due to the deletions in this pass are not deleted by the current implemenation of PiranhaJava. The goal of the multi pass analysis is to be able to identify such dead code and delete them. This has to be a multi-pass analysis (as opposed to a two pass analysis) because deletions in the second pass can potentially result in more dead code, and enable further deletions. A few scenarios:
For a stale flag Case 1:
should be refactored to
Currently, it is refactored as
Case 2:
should be refactored to
Currently, it is refactored as
Case 3:
should be refactored to
Currently, it is refactored as
The above are a few examples that we see more often in the refactorings that requires additional manual changes and motivates the need for a multi-pass analysis. @romaninozemtsev Please let me know if that clarifies the problem. |
@mkr-plse @romaninozemtsev Do we have any updates on this milestone for allowing multi-pass refactoring for PiranhaJava? |
@himanshuguptan We are working on making this much easier with a newer implementation of Piranha. See here. Please check it out as we expect it to be very customizable and adaptable for various use cases. cc @ketkarameya |
@swayamraina @himanshuguptan we have developed the initial version of polyglot piranha. Let us know, if it is performing the "deep" cleans that you want. |
while working on #57 and #35 i noticed we do not clean up empty methods.
Ideally we should delete methods which result in no-code and also delete their references in parent methods
The text was updated successfully, but these errors were encountered: