[NFC] Make assertion more informative.
authorSean Silva <silvasean@google.com>
Thu, 21 May 2020 20:10:38 +0000 (13:10 -0700)
committerSean Silva <silvasean@google.com>
Thu, 21 May 2020 20:36:21 +0000 (13:36 -0700)
This assert just caught me, and this improved message would have saved
me some time.

mlir/include/mlir/IR/Matchers.h

index 7866206..0f74f1b 100644 (file)
@@ -72,7 +72,7 @@ template <typename AttrT> struct constant_op_binder {
     SmallVector<OpFoldResult, 1> foldedOp;
     LogicalResult result = op->fold(/*operands=*/llvm::None, foldedOp);
     (void)result;
-    assert(succeeded(result) && "expected constant to be foldable");
+    assert(succeeded(result) && "expected ConstantLike op to be foldable");
 
     if (auto attr = foldedOp.front().get<Attribute>().dyn_cast<AttrT>()) {
       if (bind_value)