From b096ac909288bbf9f34f3e56934ce0842b59dd96 Mon Sep 17 00:00:00 2001 From: Geoffrey Martin-Noble Date: Fri, 6 Aug 2021 15:59:50 -0700 Subject: [PATCH] [MLIR] Improve debug messages in BuiltinTypes It's nice for users to have more information when debugging failures and these are only triggered in a failure path. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D107676 --- mlir/lib/IR/BuiltinTypes.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mlir/lib/IR/BuiltinTypes.cpp b/mlir/lib/IR/BuiltinTypes.cpp index 3589ed1..a87dd55 100644 --- a/mlir/lib/IR/BuiltinTypes.cpp +++ b/mlir/lib/IR/BuiltinTypes.cpp @@ -445,10 +445,14 @@ LogicalResult VectorType::verify(function_ref emitError, return emitError() << "vector types must have at least one dimension"; if (!isValidElementType(elementType)) - return emitError() << "vector elements must be int/index/float type"; + return emitError() + << "vector elements must be int/index/float type but got " + << elementType; if (any_of(shape, [](int64_t i) { return i <= 0; })) - return emitError() << "vector types must have positive constant sizes"; + return emitError() + << "vector types must have positive constant sizes but got " + << shape; return success(); } -- 2.7.4