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

Changing the name of OMR::AutomaticSymbol::getKind() to getOpCodeKind() #3241

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

samasri
Copy link
Contributor

@samasri samasri commented Nov 26, 2018

Changed the name of getKind in OMR::AutomaticSymbol to have less ambiguity in function names.

getKind() function is being defined in two classes of the same hierarchy, but with different return types:

  • OMR::Symbol::getKind() returns an int32_t
  • OMR::AutomaticSymbol::getKind() returns an TR::ILOpCodes object
  • OMR::AutomaticSymbol indirectly inherits from OMR::Symbol

As part of our work to virtualize the class hierarchies of Eclipse OMR (see motivation of #3235 for more info), we stumbled upon this case. Virtualizing getKind() here is not possible due to the different return type. In order to move on with our process and help OMR have a clearer design (less ambiguity in function names), we suggest changing the getKind() function in OMR::AutomaticSymbol to getOpCodeKind(), which describes the functionality of this method more clearly.

Signed-off-by: Samer AL Masri [email protected]

@Leonardo2718
Copy link
Contributor

@genie-omr build all

Copy link
Contributor

@Leonardo2718 Leonardo2718 left a comment

Choose a reason for hiding this comment

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

Changes LGTM (though it would be nice to squash the commits). @vijaysun-omr should review this.

One question, would it make more sense to use the name getOpCode() instead, since that is what is being returned, not a "kind"?

@nbhuiyan
Copy link
Contributor

Thanks for the contribution @samasri ! Just another minor thing: your commits are not following the commit format specified in Contributing.md. In the first commit, for example, you are going over 70 characters in the first line and into the body of the commit message. The second commit is meant to amend what you missed in the first commit, and could perhaps be squashed.

@samasri samasri force-pushed the Removing-Ambiguous-getKind branch 4 times, most recently from c9062ce to 9f6835a Compare November 26, 2018 21:52
* OMR::Symbol::getKind() returns an int32_t
* OMR::AutomaticSymbol::getKind() returns an TR::ILOpCodes object
* OMR::AutomaticSymbol indirectly inherits from OMR::Symbol

A derived class cannot virtually override a method that returns a different type than the parent class method
getKind() is renamed to remove ambiguity and allow the virtualization of that function

Signed-off-by: Samer AL Masri <[email protected]>
@samasri samasri force-pushed the Removing-Ambiguous-getKind branch 2 times, most recently from 6a528c1 to fceb94b Compare November 29, 2018 15:31
@Leonardo2718
Copy link
Contributor

@samasri

More commits seem to have been pushed to this branch that are unrelated to this PR. Was this intentional?

@samasri samasri force-pushed the Removing-Ambiguous-getKind branch from 6a528c1 to fceb94b Compare December 18, 2018 23:32
@samasri
Copy link
Contributor Author

samasri commented Dec 18, 2018

Sorry, that was by mistake; I fixed it now.

Copy link
Contributor

@Leonardo2718 Leonardo2718 left a comment

Choose a reason for hiding this comment

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

LGTM! ✔️

@Leonardo2718
Copy link
Contributor

@genie-omr build all

@Leonardo2718 Leonardo2718 self-assigned this Dec 19, 2018
@Leonardo2718 Leonardo2718 merged commit b28e964 into eclipse-omr:master Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants