forked from OSchip/llvm-project
[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:
parent
fdfdee98ac
commit
231c554abc
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue