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

[Flang][Parser] Refactor parse tree enumerations into common header #65339

Closed
wants to merge 1 commit into from

Conversation

skatrak
Copy link
Contributor

@skatrak skatrak commented Sep 5, 2023

This patch moves all ENUM_CLASS definitions from flang/Parser/parse-tree.h to flang/Common/Fortran.h so they can be used without including the much larger header defining all parse tree nodes. This is to address a suggestion to patch D157983.

These enumerations have been renamed, since they are now placed in a more top-level namespace rather than inside of parse tree node classes, so I would be looking for reviewers to also make sure that these names make sense and to propose any changes to improve them.

This patch moves all `ENUM_CLASS` definitions from `flang/Parser/parse-tree.h`
to `flang/Common/Fortran.h` so they can be used without including the much
larger header defining all parse tree nodes.
@skatrak skatrak requested review from a team as code owners September 5, 2023 15:38
@github-actions github-actions bot added the flang Flang issues not falling into any other category label Sep 5, 2023
@klausler
Copy link
Contributor

klausler commented Sep 5, 2023

Many of these types were nested within struct/class definitions, and moving them out of those struct/class definitions and into another file is just doing to make them harder to find. Do not do this.

This restructuring only makes sense for enumerations that are needed both in parse tree definitions and in the symbol table.

@skatrak
Copy link
Contributor Author

skatrak commented Sep 5, 2023

I see, I guess I misunderstood your comment there. I'll close this PR then, and just move a single definition as part of the other patch.

@skatrak skatrak closed this Sep 5, 2023
@skatrak skatrak deleted the fortran-parse-tree-enums branch September 18, 2023 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants