[Mlir-commits] [mlir] cce026b - [mlir][test] Fix -Wsign-compare in TestDialect.cpp (NFC)

Jie Fu llvmlistbot at llvm.org
Tue Apr 16 02:20:31 PDT 2024


Author: Jie Fu
Date: 2024-04-16T17:19:45+08:00
New Revision: cce026bf8f7dcf5aa402a6da20f0d4da56aee8b5

URL: https://github.com/llvm/llvm-project/commit/cce026bf8f7dcf5aa402a6da20f0d4da56aee8b5
DIFF: https://github.com/llvm/llvm-project/commit/cce026bf8f7dcf5aa402a6da20f0d4da56aee8b5.diff

LOG: [mlir][test] Fix -Wsign-compare in TestDialect.cpp (NFC)

llvm-project/mlir/test/lib/Dialect/Test/TestDialect.cpp:597:31:
error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long') [-Werror,-Wsign-compare]
  if (getVarOperands().size() != expectedNumOperands)
      ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~
1 error generated.

Added: 
    

Modified: 
    mlir/test/lib/Dialect/Test/TestDialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/test/lib/Dialect/Test/TestDialect.cpp b/mlir/test/lib/Dialect/Test/TestDialect.cpp
index 36d7606fe1345b..a23ed89c4b04d1 100644
--- a/mlir/test/lib/Dialect/Test/TestDialect.cpp
+++ b/mlir/test/lib/Dialect/Test/TestDialect.cpp
@@ -594,7 +594,7 @@ LogicalResult CompareOp::verify() {
         "'compose' not supported when 'lhs_map' or 'rhs_map' is present");
   int64_t expectedNumOperands = getLhsMap() ? getLhsMap()->getNumInputs() : 1;
   expectedNumOperands += getRhsMap() ? getRhsMap()->getNumInputs() : 1;
-  if (getVarOperands().size() != expectedNumOperands)
+  if (getVarOperands().size() != size_t(expectedNumOperands))
     return emitOpError("expected ")
            << expectedNumOperands << " operands, but got "
            << getVarOperands().size();


        


More information about the Mlir-commits mailing list