[Mlir-commits] [mlir] [mlir] Expose type and attribute names in the MLIRContext and abstract type/attr classes (PR #72189)

Fehr Mathieu llvmlistbot at llvm.org
Tue Nov 14 07:55:45 PST 2023


================
@@ -55,6 +55,10 @@ class DataLayoutEntryAttr
 
   /// Prints this attribute.
   void print(AsmPrinter &os) const;
+
+  static constexpr StringRef getAttrName() {
----------------
math-fehr wrote:

Yes, that makes sense. The only problem I would see is that ODS would forbid `name` instead of `typeName` or `attrName`.
One alternative solution would maybe to just have `static constexpr StringLiteral name = "dialect.name";`, instead of a method. I guess that would solve this issue, though it would be different than how `Operation` works (with `getOperationName`).
What do you think?


https://github.com/llvm/llvm-project/pull/72189


More information about the Mlir-commits mailing list