Skip to content

[NFC][TableGen] Refactor JSON and detailed record emitter #105770

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

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Aug 23, 2024

  • Fix JSON and detailed record emitters to use const reference and pointers.
  • Fix code to use C++ structured bindings and range based loops, include reverse() range for locations.
  • Eliminate NL define for "\n".
  • Change JSON emitter to populate instance_list in an earlier loop over superclasses instead of a separate loop.
  • Rename variables in JSON emitter to conform to LLVM naming conventions.
  • Eliminate unused headers in detailed record emitter.

@jurahul jurahul force-pushed the tg_constref_backends branch from 116013b to 00665b8 Compare August 23, 2024 11:06
@jurahul jurahul marked this pull request as ready for review August 23, 2024 13:26
@jurahul jurahul force-pushed the tg_constref_backends branch from 00665b8 to 9c42393 Compare August 26, 2024 19:52
Copy link
Contributor

@s-barannikov s-barannikov left a comment

Choose a reason for hiding this comment

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

LGTM
A note for the future: it would be much easier to review if formatting changes like variable renaming were in a separate commin (not necessarily in separate PR).

@jurahul
Copy link
Contributor Author

jurahul commented Aug 26, 2024

A note for the future: it would be much easier to review if formatting changes like variable renaming were in a separate commin (not necessarily in separate PR).

Thanks, and agreed. The PR evolved over time. I was actually working on splitting it up since the JSON one has many changes (const ref, var name, no else after return etc), so I was thinking of splitting the JSON and Detailed as 2 separate PR. Let me know if that helps. (Its easy enough to do that)

@s-barannikov
Copy link
Contributor

I think it is fine as is.

- Fix JSON and detailed record emitters to use const reference and
  pointers.
- Fix code to use C++ structured bindings and range based loops,
  include reverse() range for locations.
- Eliminate `NL` define for "\n".
- Change JSON emitter to populate `instance_list` in an earlier
  loop over superclasses instead of a separate loop.
@jurahul jurahul force-pushed the tg_constref_backends branch from 9c42393 to 6f69fd5 Compare August 26, 2024 20:32
@jurahul jurahul merged commit bcde45b into llvm:main Aug 26, 2024
8 checks passed
@jurahul jurahul deleted the tg_constref_backends branch August 26, 2024 23:57
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.

2 participants