-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[TableGen] Add a field to filter out GenericTable entries #65458
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] Add a field to filter out GenericTable entries #65458
Conversation
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.
The change looks OK to me, but this should surely have a test in llvm/test/TableGen
.
You don't say what the use case for this is. I'm guessing it might be so you can construct two GenericTable
s with the same FilterClass
, so that they select from the same overall set of records, but assign them different FilterClassField
values so that they include different subsets of the records of that class?
Perhaps demonstrating that in the new test would be a good idea, and maybe mentioning it in the documentation too. (Documentation is at least as much for "what feature can I use to do this thing?" as "what does this feature do?")
Thanks! I was planning to add a test but I can't find existed tests for
Yes! This can be a scenario! And I posted another PR #65460 to show the usage.
Will do, thanks! |
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.
LGTM, thanks!
A field `FilterClassField` is added to `GenericTable` class, which is an optional bit field of `FilterClass`. If specified, only those records with this field being true will have corresponding entries in the table.
Add a test in `llvm/test/TableGen/generic-tables.td` and make detailed document
70c41be
to
c1864aa
Compare
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.
LGTM
Address comments
A field
FilterClassField
is added toGenericTable
class, whichis an optional bit field of
FilterClass
. If specified, only thoserecords with this field being true will have corresponding entries
in the table.