[Mlir-commits] [mlir] [mlir] NamedAttribute utility generator (PR #75118)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Dec 14 12:35:08 PST 2023


sjw36 wrote:

> I don't quite get this part? Is this just making the `setDiscardableAttr()` API typed? Is the whole thing here trying to make it so that the string attribute name key can only be set with a specific attribute type?

Yes, this is a wrapper around a specific Key for the NamedAttribute and static typed accessors to the Value on an Operation.
Unfortunately I don't see a way to enforce that a particular NameAttribute must have a specified Value Type.

I cleaned it up a bit to remove the inherent check and so it is now only dialect-qualified keys for discardable attributes.
Also added unit test.

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


More information about the Mlir-commits mailing list