diff --git a/mlir/lib/Bindings/Python/IRAffine.cpp b/mlir/lib/Bindings/Python/IRAffine.cpp --- a/mlir/lib/Bindings/Python/IRAffine.cpp +++ b/mlir/lib/Bindings/Python/IRAffine.cpp @@ -347,7 +347,7 @@ } // namespace -bool PyAffineExpr::operator==(const PyAffineExpr &other) { +bool PyAffineExpr::operator==(const PyAffineExpr &other) const { return mlirAffineExprEqual(affineExpr, other.affineExpr); } @@ -406,7 +406,7 @@ }; } // namespace -bool PyAffineMap::operator==(const PyAffineMap &other) { +bool PyAffineMap::operator==(const PyAffineMap &other) const { return mlirAffineMapEqual(affineMap, other.affineMap); } @@ -483,7 +483,7 @@ }; } // namespace -bool PyIntegerSet::operator==(const PyIntegerSet &other) { +bool PyIntegerSet::operator==(const PyIntegerSet &other) const { return mlirIntegerSetEqual(integerSet, other.integerSet); } diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp --- a/mlir/lib/Bindings/Python/IRCore.cpp +++ b/mlir/lib/Bindings/Python/IRCore.cpp @@ -1736,7 +1736,7 @@ // PyAttribute. //------------------------------------------------------------------------------ -bool PyAttribute::operator==(const PyAttribute &other) { +bool PyAttribute::operator==(const PyAttribute &other) const { return mlirAttributeEqual(attr, other.attr); } @@ -1768,7 +1768,7 @@ // PyType. //------------------------------------------------------------------------------ -bool PyType::operator==(const PyType &other) { +bool PyType::operator==(const PyType &other) const { return mlirTypeEqual(type, other.type); } diff --git a/mlir/lib/Bindings/Python/IRModule.h b/mlir/lib/Bindings/Python/IRModule.h --- a/mlir/lib/Bindings/Python/IRModule.h +++ b/mlir/lib/Bindings/Python/IRModule.h @@ -808,7 +808,7 @@ public: PyType(PyMlirContextRef contextRef, MlirType type) : BaseContextObject(std::move(contextRef)), type(type) {} - bool operator==(const PyType &other); + bool operator==(const PyType &other) const; operator MlirType() const { return type; } MlirType get() const { return type; } @@ -878,7 +878,7 @@ public: PyAttribute(PyMlirContextRef contextRef, MlirAttribute attr) : BaseContextObject(std::move(contextRef)), attr(attr) {} - bool operator==(const PyAttribute &other); + bool operator==(const PyAttribute &other) const; operator MlirAttribute() const { return attr; } MlirAttribute get() const { return attr; } @@ -1003,7 +1003,7 @@ public: PyAffineExpr(PyMlirContextRef contextRef, MlirAffineExpr affineExpr) : BaseContextObject(std::move(contextRef)), affineExpr(affineExpr) {} - bool operator==(const PyAffineExpr &other); + bool operator==(const PyAffineExpr &other) const; operator MlirAffineExpr() const { return affineExpr; } MlirAffineExpr get() const { return affineExpr; } @@ -1030,7 +1030,7 @@ public: PyAffineMap(PyMlirContextRef contextRef, MlirAffineMap affineMap) : BaseContextObject(std::move(contextRef)), affineMap(affineMap) {} - bool operator==(const PyAffineMap &other); + bool operator==(const PyAffineMap &other) const; operator MlirAffineMap() const { return affineMap; } MlirAffineMap get() const { return affineMap; } @@ -1051,7 +1051,7 @@ public: PyIntegerSet(PyMlirContextRef contextRef, MlirIntegerSet integerSet) : BaseContextObject(std::move(contextRef)), integerSet(integerSet) {} - bool operator==(const PyIntegerSet &other); + bool operator==(const PyIntegerSet &other) const; operator MlirIntegerSet() const { return integerSet; } MlirIntegerSet get() const { return integerSet; }