Skip to content

Commit 67c45e5

Browse files
committed
[mlir][emitc] NFC
1 parent 125466a commit 67c45e5

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

mlir/lib/Dialect/EmitC/IR/EmitC.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,16 +1179,14 @@ ParseResult SwitchOp::parse(OpAsmParser &parser, OperationState &result) {
11791179
}
11801180

11811181
void SwitchOp::print(OpAsmPrinter &p) {
1182-
p << ' ';
1183-
p << getArg();
1182+
p << ' ' << getArg();
11841183
SmallVector<StringRef, 2> elidedAttrs;
11851184
elidedAttrs.push_back("cases");
11861185
p.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
11871186
p << ' ';
11881187
printSwitchCases(p, *this, getCasesAttr(), getCaseRegions());
11891188
p.printNewline();
1190-
p << "default";
1191-
p << ' ';
1189+
p << "default ";
11921190
p.printRegion(getDefaultRegion(), /*printEntryBlockArgs=*/true,
11931191
/*printBlockTerminators=*/true);
11941192
}
@@ -1207,6 +1205,7 @@ static LogicalResult verifyRegion(emitc::SwitchOp op, Region &region,
12071205
.attachNote(yield.getLoc())
12081206
<< "see yield operation here";
12091207
}
1208+
12101209
return success();
12111210
}
12121211

mlir/lib/Target/Cpp/TranslateToCpp.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,7 @@ static LogicalResult printOperation(CppEmitter &emitter,
467467
os << "\nswitch (" << emitter.getOrCreateName(switchOp.getArg()) << ") {";
468468

469469
for (auto pair : llvm::zip(switchOp.getCases(), switchOp.getCaseRegions())) {
470-
os << "\ncase "
471-
<< "(" << std::get<0>(pair) << ")"
472-
<< ": {\n";
470+
os << "\ncase (" << std::get<0>(pair) << "): {\n";
473471
os.indent();
474472

475473
if (failed(emitSwitchCase(emitter, os, std::get<1>(pair))))

0 commit comments

Comments
 (0)