-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[TableGen] Support type aliases via new keyword deftype #79570
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
Created using spr 1.3.4
Created using spr 1.3.4
Created using spr 1.3.4
Created using spr 1.3.4
Created using spr 1.3.4
There was a problem hiding this 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.
Created using spr 1.3.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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
We can use
deftype
(not usingtypedef
here to be consistentwith
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 toplevel.