[Mlir-commits] [mlir] [mlir][spirv] Add support for structs decorations (PR #149793)
Igor Wodiany
llvmlistbot at llvm.org
Tue Jul 22 05:34:25 PDT 2025
================
@@ -327,10 +327,33 @@ class StructType
}
};
+ // Type for specifying the decoration(s) on the struct itself
+ struct StructDecorationInfo {
+ bool hasValue;
+ Decoration decoration;
+ Attribute decorationValue;
+
+ StructDecorationInfo(bool hasValue, Decoration decoration,
+ Attribute decorationValue)
+ : hasValue(hasValue), decoration(decoration),
+ decorationValue(decorationValue) {}
+
+ bool operator==(const StructDecorationInfo &other) const {
+ return (this->decoration == other.decoration) &&
+ (this->decorationValue == other.decorationValue);
+ }
+
+ bool operator<(const StructDecorationInfo &other) const {
----------------
IgWod-IMG wrote:
I implemented this inside the struct to be consistent with member decorations. In this case should I change both to use free standing friend functions? Regarding `hasValue`, again I followed member decorations, but in the hindsight comparing it makes sense. If we decide to get rid of `hasValue` the problem will disappear anyway, otherwise I'll add it.
https://github.com/llvm/llvm-project/pull/149793
More information about the Mlir-commits
mailing list