From a91cfd1990255aea545683083329c2ad3fee4518 Mon Sep 17 00:00:00 2001 From: Uday Bondhugula Date: Tue, 14 Sep 2021 14:12:50 +0530 Subject: [PATCH] [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 --- mlir/lib/IR/Operation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp index f2b981390f93..457c993b92ad 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(); }