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

Remove dead code from SwitchAnalyzer #5182

Closed
0xdaryl opened this issue May 11, 2020 · 3 comments · Fixed by #5953
Closed

Remove dead code from SwitchAnalyzer #5182

0xdaryl opened this issue May 11, 2020 · 3 comments · Fixed by #5953

Comments

@0xdaryl
Copy link
Contributor

0xdaryl commented May 11, 2020

While investigating a loadaddr issue, I discovered a dead path in SwitchAnalyzer::addTableBlock. It looks to be a remnant of earlier refactoring.

TR::SymbolReference *branchTableSymRef = NULL;

branchTableSymRef and branchTable are never changed from their initial values. Remove and fold code assuming both are 0.

@mrSeoD
Copy link

mrSeoD commented May 12, 2020

@0xdaryl Hey! I love to help on this.
Just to clarify, you would like both "branchTableSymRef" and "branchTable" to be removed from the code and their values "NULL" and "0" are replaced into wherever the variables were written?
Thanks!

@0xdaryl
Copy link
Contributor Author

0xdaryl commented May 12, 2020

Hi... Thanks for volunteering to help. By "fold code" I mean simplifying the code assuming the values of those variables will always be "0". For example, the if (branchTable) will always evaluate to false since branchTable is always 0, which means the code under the if can be deleted because it cannot ever be executed.

@mrSeoD
Copy link

mrSeoD commented May 13, 2020

@0xdaryl Got it! I will make changes and create the pull request!

BradleyWood added a commit to BradleyWood/omr that referenced this issue Apr 22, 2021
…ting issues

Closes eclipse#5182

Signed-off-by: BradleyWood <bradley.wood@ibm.com>
BradleyWood added a commit to BradleyWood/omr that referenced this issue Apr 22, 2021
…ting issues

Closes eclipse#5182

Signed-off-by: BradleyWood <bradley.wood@ibm.com>
BradleyWood added a commit to BradleyWood/omr that referenced this issue Apr 22, 2021
…ting issues

Closes eclipse#5182

Signed-off-by: BradleyWood <bradley.wood@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants