[Mlir-commits] [mlir] 231c554 - [MLIR][NFC] Fix misleading diagnostic error + clang-tidy fix
Uday Bondhugula
llvmlistbot at llvm.org
Sat Aug 8 23:06:07 PDT 2020
Author: Uday Bondhugula
Date: 2020-08-09T11:35:29+05:30
New Revision: 231c554abc8aad4240705149f785f9e76398d937
URL: https://github.com/llvm/llvm-project/commit/231c554abc8aad4240705149f785f9e76398d937
DIFF: https://github.com/llvm/llvm-project/commit/231c554abc8aad4240705149f785f9e76398d937.diff
LOG: [MLIR][NFC] Fix misleading diagnostic error + clang-tidy fix
Fix misleading diagnostic error in affine.yield verifier + a clang-tidy fix.
Differential Revision: https://reviews.llvm.org/D85587
Added:
Modified:
mlir/lib/Dialect/Affine/IR/AffineOps.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index fa98f63706df..e6236e90c289 100644
--- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
@@ -2641,7 +2641,7 @@ static ParseResult parseAffineParallelOp(OpAsmParser &parser,
}
// Parse optional clause of the form: `reduce ("addf", "maxf")`, where the
- // quoted strings a member of the enum AtomicRMWKind.
+ // quoted strings a member of the enum AtomicRMWKind.
SmallVector<Attribute, 4> reductions;
if (succeeded(parser.parseOptionalKeyword("reduce"))) {
if (parser.parseLParen())
@@ -2691,13 +2691,12 @@ static ParseResult parseAffineParallelOp(OpAsmParser &parser,
//===----------------------------------------------------------------------===//
static LogicalResult verify(AffineYieldOp op) {
- auto parentOp = op.getParentOp();
+ auto *parentOp = op.getParentOp();
auto results = parentOp->getResults();
auto operands = op.getOperands();
if (!isa<AffineParallelOp, AffineIfOp, AffineForOp>(parentOp))
- return op.emitOpError()
- << "affine.terminate only terminates If, For or Parallel regions";
+ return op.emitOpError() << "only terminates affine.if/for/parallel regions";
if (parentOp->getNumResults() != op.getNumOperands())
return op.emitOpError() << "parent of yield must have same number of "
"results as the yield operands";
More information about the Mlir-commits
mailing list