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

Rename extensible header files in the the compiler #3213

Merged
merged 2 commits into from
Mar 21, 2019

Conversation

dnakamura
Copy link
Contributor

A number of header files in the compiler are designed to be extened by
the consuming runtime. For these headers we prefix the names with OMR
and provide a new default implementation of the header which simply
includes the OMR prefixed header. (this is in line with existing
extensible headers)

Signed-off-by: Devin Nakamura [email protected]

@dnakamura dnakamura force-pushed the extensible_headers branch 2 times, most recently from 61cdd8d to 82e9601 Compare November 20, 2018 16:23
@charliegracie
Copy link
Contributor

The Lint build breaks with this change

@0xdaryl
Copy link
Contributor

0xdaryl commented Nov 22, 2018

Your commit titles have a double "the". Please fix.

@Leonardo2718
Copy link
Contributor

Leonardo2718 commented Nov 22, 2018

Changes LGTM.

Is there a plan to make similar changes to the corresponding files in downstream projects (e.g. OpenJ9)?

Also, was there any public discussion for why this change is wanted/needed?

@dnakamura
Copy link
Contributor Author

@Leonardo2718 Yes plan is to make changes to downstream projects. Changes are being made so we can do out of tree builds properly (where OMR isnt a sub-directory of consuming project)

@Leonardo2718
Copy link
Contributor

Changes are being made so we can do out of tree builds properly (where OMR isnt a sub-directory of consuming project)

@dnakamura Could you open an umbrella issue for this, so that others can more easily track what's going on?

@Leonardo2718 Leonardo2718 self-assigned this Nov 23, 2018
@Leonardo2718
Copy link
Contributor

@genie-omr build all

@charliegracie
Copy link
Contributor

ping @dnakamura and @Leonardo2718

Copy link
Contributor

@0xdaryl 0xdaryl left a comment

Choose a reason for hiding this comment

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

The reason the OMR compiler needs to smurph its filenames is in support of the extensible class mechanism. Arguably, it doesn't look particularly clean to use the project name "OMR" in the filename of the very project it's used in, but it was needed to work around some of the limitations of the C preprocessor. Hence, I would like as much as possible to do this only where necessary to support extensible classes.

Many of the files involved in this PR aren't extensible classes per se, but do fall in some kind of grey area where they are needed to support the extensible mechanism (e.g., filling in the internals of an extensible table or enum). Therefore, I think I can get behind most of these proposed changes.

However, for runtime/Runtime.hpp, this is neither an extensible class nor anything that depends on the extensibility mechanism. Rather, it's an eclectic collection of bits and pieces needed to support compiled code at runtime. I don't see the rationale for smurphing it with OMR, as it gives the appearance that it's part of the extensibility mechanism--which it isn't. If a downstream project is consuming it with the intent on extending it then I'd argue that's not an appropriate (or intended) use of it, and I suggest solving that in the downstream project instead.

@dnakamura
Copy link
Contributor Author

@0xdaryl I saw downstream consumer extending it in the same manner as the normal extensible headers. I assumed that they were relying on the fact that the omr headers will include "Runtime.hpp" and get their copy (which then includes the omr copy), but I will do a bit more digging to see if that is the case

@charliegracie
Copy link
Contributor

@dnakamura ping?

@dnakamura
Copy link
Contributor Author

For some reason I thought this pr was only dealing with Runtime.hpp which is why i closed it, however there are other useful changes here

}

#endif
#include "compiler/il/OMRILProps.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

In extensible classes, we normally do not use "compiler/" at the start of includes (there is one exception but it doesn't apply in this case):

Suggested change
#include "compiler/il/OMRILProps.hpp"
#include "il/OMRILProps.hpp"

Is there a reason for needing them here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just an oversight on my part

@Leonardo2718
Copy link
Contributor

compiler/aarch64/codegen/TreeEvaluatorTable.hpp and compiler/arm/codegen/TreeEvaluatorTable.hpp still have compiler/ in the includes.

A number of header files in the compiler are designed to be extened by
the consuming runtime. For these headers we prefix the names with OMR
and provide a new default implementation of the header which simply
includes the OMR prefixed header. (this is in line with existing
extensible headers)

Commit is split up into 2 parts in order to help git track the changes
a bit better. First commit renames the files, the second commit creates
stub files (with the old names) which include the new files.

Signed-off-by: Devin Nakamura <[email protected]>
Create stub files which include the renamed files. This is separated out
to give git a better chance at resolveing merge conflicts. See original
commit for details.

Signed-off-by: Devin Nakamura <[email protected]>
@dnakamura
Copy link
Contributor Author

@0xdaryl poke

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

@DanHeidinga
Copy link
Contributor

Whats the next step to get this merged? I see the builds have been run and succeeded.

@dnakamura
Copy link
Contributor Author

@DanHeidinga I believe its just waiting for someone to click the merge button. I believe I have addressed everyone's issues

@Leonardo2718
Copy link
Contributor

All comments have been addressed. Everyone who reviewed has approved. All checks have passed. Merging.

@Leonardo2718 Leonardo2718 merged commit ded9f8c into eclipse-omr:master Mar 21, 2019
@dnakamura dnakamura deleted the extensible_headers branch March 21, 2019 19:33
dnakamura added a commit to dnakamura/openj9 that referenced this pull request Mar 21, 2019
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.

6 participants