[Mlir-commits] [mlir] [mlir][spirv][nfc] Refactor member decorations in StructType (PR #150218)

Igor Wodiany llvmlistbot at llvm.org
Thu Jul 24 02:21:34 PDT 2025


================
@@ -316,17 +316,18 @@ class StructType
 
     friend bool operator==(const MemberDecorationInfo &lhs,
                            const MemberDecorationInfo &rhs) {
-      return (lhs.memberIndex == rhs.memberIndex) &&
-             (lhs.decoration == rhs.decoration) &&
-             (lhs.decorationValue == rhs.decorationValue);
+      return lhs.memberIndex == rhs.memberIndex &&
+             lhs.decoration == rhs.decoration &&
+             lhs.decorationValue == rhs.decorationValue;
     }
 
     friend bool operator<(const MemberDecorationInfo &lhs,
                           const MemberDecorationInfo &rhs) {
       return lhs.memberIndex < rhs.memberIndex ||
-             (lhs.memberIndex == rhs.memberIndex &&
-              llvm::to_underlying(lhs.decoration) <
-                  llvm::to_underlying(rhs.decoration));
+             std::make_tuple(lhs.memberIndex,
+                             llvm::to_underlying(lhs.decoration)) <
+                 std::make_tuple(rhs.memberIndex,
+                                 llvm::to_underlying(rhs.decoration));
----------------
IgWod-IMG wrote:

Thanks! I wasn't aware of this use of `tie`. Now I see it, I can't believe what I came up with :) Anyway, it's fixed now.

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


More information about the Mlir-commits mailing list