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

[TableGen] Support type aliases via new keyword deftype #79570

Conversation

wangpc-pp
Copy link
Contributor

@wangpc-pp wangpc-pp commented Jan 26, 2024

We can use deftype (not using typedef here to be consistent
with def, defm, defset, defvar, etc) to define type aliases.

Currently, only primitive types and type aliases are supported to be
the source type and deftype statements can only appear at the top
level.

Created using spr 1.3.4
@wangpc-pp wangpc-pp requested review from fpetrogalli, Artem-B and jroelofs and removed request for fpetrogalli January 26, 2024 10:23
Created using spr 1.3.4
@Artem-B Artem-B requested a review from nhaehnle January 26, 2024 18:01
Created using spr 1.3.4
Created using spr 1.3.4
Created using spr 1.3.4
Copy link
Collaborator

@nhaehnle nhaehnle left a comment

Choose a reason for hiding this comment

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

Thanks, I think this fits nicely with the language.

The change has a check whether a deftype conflicts with a pre-existing class definition, but it does not check whether a class definition conflicts with a pre-existing type alias. Please add that. Apart from that, this LGTM.

Copy link
Collaborator

@nhaehnle nhaehnle left a comment

Choose a reason for hiding this comment

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

Thanks!

@wangpc-pp wangpc-pp merged commit acf6811 into main Feb 2, 2024
5 checks passed
@wangpc-pp wangpc-pp deleted the users/wangpc-pp/spr/tablegen-support-type-aliases-via-new-keyword-deftype branch February 2, 2024 09:41
agozillon pushed a commit to agozillon/llvm-project that referenced this pull request Feb 5, 2024
We can use `deftype` (not using `typedef` here to be consistent
with `def`, `defm`, `defset`, `defvar`, etc) to define type aliases.

Currently, only primitive types and type aliases are supported to be
the source type and `deftype` statements can only appear at the top
level.

Reviewers: fpetrogalli, Artem-B, nhaehnle, jroelofs

Reviewed By: jroelofs, nhaehnle, Artem-B

Pull Request: llvm#79570
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.

None yet

5 participants