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

Refactor: Several Improvements #2160

Merged
merged 8 commits into from
Jul 16, 2023

Conversation

Shaikh-Ubaid
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@czgdp1807 czgdp1807 left a comment

Choose a reason for hiding this comment

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

For a compiler like ours which is in fast pace development mode, I wouldn’t remove code which never gets triggered by the tests. Instead I would prefer adding tests which trigger that code. Its a time consuming process but that’s better than removing unused code because they might be having some important logic we might have written but missed to add tests for it (< 100% code coverage is very normal).

@Shaikh-Ubaid
Copy link
Collaborator Author

Shaikh-Ubaid commented Jul 15, 2023

For a compiler like ours which is in fast pace development mode, I wouldn’t remove code which never gets triggered by the tests.

reference: Remove code that never gets triggered.

Actually, it is not about the tests. The current_module value is always nulltpr (it is assigned this value during its initialization and its value is never updated. Since current_module is always nulltptr, the if part would never be executed. Thus, I think the code itself is dead code.

@Shaikh-Ubaid
Copy link
Collaborator Author

Ready.

@certik
Copy link
Contributor

certik commented Jul 15, 2023

Can you send a PR to LFortran for this change in libasr as well? Let's see if it breaks anything there.

@Shaikh-Ubaid
Copy link
Collaborator Author

Can you send a PR to LFortran for this change in libasr as well? Let's see if it breaks anything there.

Sure, please see lfortran/lfortran#1989.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

I think that this is fine, it works in LFortran.

@Shaikh-Ubaid Shaikh-Ubaid merged commit a14d2c8 into lcompilers:main Jul 16, 2023
9 checks passed
@Shaikh-Ubaid Shaikh-Ubaid deleted the refactor_improvements branch July 16, 2023 04:34
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