[CodeGen] Make ShapeT::operator== const. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 19 Feb 2022 12:23:27 +0000 (13:23 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 19 Feb 2022 12:25:09 +0000 (13:25 +0100)
Otherwise it becomes asymmetric in the types it accepts.

llvm/include/llvm/CodeGen/TileShapeInfo.h

index 4e574bd..1b5f902 100644 (file)
@@ -38,7 +38,7 @@ public:
   ShapeT()
       : Row(nullptr), Col(nullptr), RowImm(InvalidImmShape),
         ColImm(InvalidImmShape) {}
-  bool operator==(const ShapeT &Shape) {
+  bool operator==(const ShapeT &Shape) const {
     MachineOperand *R = Shape.Row;
     MachineOperand *C = Shape.Col;
     if (!R || !C)
@@ -52,7 +52,7 @@ public:
     return false;
   }
 
-  bool operator!=(const ShapeT &Shape) { return !(*this == Shape); }
+  bool operator!=(const ShapeT &Shape) const { return !(*this == Shape); }
 
   MachineOperand *getRow() const { return Row; }