[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
This commit is contained in:
Uday Bondhugula 2020-08-09 03:18:04 +05:30
parent fdfdee98ac
commit 231c554abc
1 changed files with 3 additions and 4 deletions

View File

@ -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";