You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
core: Implement MemrefLayoutAttr base class and use in parser. #2718
We currently annotate the base Attribute class with a name ClassVar. I.e., it is expected that any subclass defines a name - including further attribute base classes, used as interfaces for example.
The only practical issue with this I've observed is in IRDL verifiers, that actually uses this transparently. Then, using such a base class errors if it has no name.
More on the principles side of things, I feel they should all define a name if we so say in the base class indeed. So we could:
Not expect all of them to have a name anymore, but only at the irdl_attr_definition stage
Or just enforce indeed that they all have names.
The text was updated successfully, but these errors were encountered:
My take on this is that we don't want inheritance in IRDL, if we can avoid it, so the approach in #2718, with an override of a class variable, is not ideal. This is separate to our Python implementation, where inheritance seems like the most ergonomic approach. What I'm trying to say is that it would be great to use this task to track a discussion of how to define abstract attributes and use them in constraints, and also how to map these to PyRDL.
As brought up in:
We currently annotate the base
Attribute
class with a nameClassVar
. I.e., it is expected that any subclass defines a name - including further attribute base classes, used as interfaces for example.The only practical issue with this I've observed is in IRDL verifiers, that actually uses this transparently. Then, using such a base class errors if it has no name.
More on the principles side of things, I feel they should all define a name if we so say in the base class indeed. So we could:
irdl_attr_definition
stageThe text was updated successfully, but these errors were encountered: