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

Jakub Kuderski llvmlistbot at llvm.org
Mon Nov 13 21:41:11 PST 2023


================
@@ -72,6 +72,9 @@ class StructType : public mlir::Type::TypeBase<StructType, mlir::Type,
 
   /// Returns the number of element type held by this struct.
   size_t getNumElementTypes() { return getElementTypes().size(); }
+
+  /// Returns the name of this struct type.
+  static constexpr StringRef getTypeName() { return "toy.struct"; }
----------------
kuhar wrote:

Why not `StringLiteral`?

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


More information about the Mlir-commits mailing list