[Mlir-commits] [mlir] [mlir] Add the ability to define dialect-specific location attrs. (PR #105584)

River Riddle llvmlistbot at llvm.org
Tue Sep 17 20:01:38 PDT 2024


================
@@ -322,12 +322,19 @@ class AttributeInterface
 // Core AttributeTrait
 //===----------------------------------------------------------------------===//
 
-/// This trait is used to determine if an attribute is mutable or not. It is
-/// attached on an attribute if the corresponding ImplType defines a `mutate`
-/// function with proper signature.
 namespace AttributeTrait {
+/// This trait is used to determine if an attribute is mutable or not. It is
+/// attached on an attribute if the corresponding ConcreteType defines a
+/// `mutate` function with proper signature.
 template <typename ConcreteType>
 using IsMutable = detail::StorageUserTrait::IsMutable<ConcreteType>;
+
+/// This trait is used to determine if an attribute is a location or not. It is
----------------
River707 wrote:

What's the trade off of having a trait for this, vs having an interface? My original expectation for this kind of patch was to effectively just turn LocationAttr into an interface. I suppose going to an interface would be much more costly, but what happens to the API on LocationAttr (e.g. walk?). How do dialect interfaces hook into that handling?

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


More information about the Mlir-commits mailing list