Skip to content

Commit c79ddcd

Browse files
committed
PR suggestions
1 parent e21a21f commit c79ddcd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mlir/lib/Target/IRDLToCpp/IRDLToCpp.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,27 +466,29 @@ static LogicalResult verifySupported(irdl::DialectOp dialect) {
466466
.Case<irdl::OperationOp>(
467467
([](irdl::OperationOp) { return success(); }))
468468
.Case<irdl::TypeOp>(([](irdl::TypeOp) { return success(); }))
469-
.Case<irdl::OperandsOp>(([](irdl::OperandsOp op) {
469+
.Case<irdl::OperandsOp>(([](irdl::OperandsOp op) -> LogicalResult {
470470
if (llvm::all_of(
471471
op.getVariadicity(), [](irdl::VariadicityAttr attr) {
472472
return attr.getValue() == irdl::Variadicity::single;
473473
}))
474474
return success();
475-
return failure();
475+
return op.emitError("IRDL C++ translation does not yet support "
476+
"variadic operations");
476477
}))
477-
.Case<irdl::ResultsOp>(([](irdl::ResultsOp op) {
478+
.Case<irdl::ResultsOp>(([](irdl::ResultsOp op) -> LogicalResult {
478479
if (llvm::all_of(
479480
op.getVariadicity(), [](irdl::VariadicityAttr attr) {
480481
return attr.getValue() == irdl::Variadicity::single;
481482
}))
482483
return success();
483-
return failure();
484+
return op.emitError(
485+
"IRDL C++ translation does not yet support variadic results");
484486
}))
485487
.Case<irdl::AnyOp>(([](irdl::AnyOp) { return success(); }))
486488
.Default([](mlir::Operation *op) -> LogicalResult {
487489
return op->emitError("IRDL C++ translation does not yet support "
488490
"translation of ")
489-
<< op->getName() << "operation";
491+
<< op->getName() << " operation";
490492
});
491493

492494
if (failed(res))

0 commit comments

Comments
 (0)