[Mlir-commits] [mlir] a91cfd1 - [MLIR] Improve op parse error message for AtLeastNOperands trait

Uday Bondhugula llvmlistbot at llvm.org
Tue Sep 14 02:32:19 PDT 2021


Author: Uday Bondhugula
Date: 2021-09-14T15:01:51+05:30
New Revision: a91cfd1990255aea545683083329c2ad3fee4518

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

LOG: [MLIR] Improve op parse error message for AtLeastNOperands trait

Improve parse error message for "at least N operands" op trait.

Differential Revision: https://reviews.llvm.org/D109747

Added: 
    

Modified: 
    mlir/lib/IR/Operation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp
index f2b981390f93b..457c993b92ad3 100644
--- a/mlir/lib/IR/Operation.cpp
+++ b/mlir/lib/IR/Operation.cpp
@@ -727,7 +727,8 @@ LogicalResult OpTrait::impl::verifyAtLeastNOperands(Operation *op,
                                                     unsigned numOperands) {
   if (op->getNumOperands() < numOperands)
     return op->emitOpError()
-           << "expected " << numOperands << " or more operands";
+           << "expected " << numOperands << " or more operands, but found "
+           << op->getNumOperands();
   return success();
 }
 


        


More information about the Mlir-commits mailing list