[Mlir-commits] [mlir] [mlir][spirv] Add support for structs decorations (PR #149793)
Jakub Kuderski
llvmlistbot at llvm.org
Tue Jul 22 07:23:46 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 {
----------------
kuhar wrote:
I didn't look at the surrounding code much and commented from first principles mostly. If we can reuse some code by sticking to the same conventions, then adapting those makes sense to me, or when mixing two styles makes a file an eye sore... Otherwise I'm biased towards making new code adhere to the contemporary coding standards and best practices.
Here, I'd think that we can simplify the code a bit by not having the `hasValue` field if we can inspect `decorationValue` instead.
https://github.com/llvm/llvm-project/pull/149793
More information about the Mlir-commits
mailing list