[mlir] Fix ReturnInst printing for zero operands
No longer prints a trailing ':'.
PiperOrigin-RevId: 207103812
diff --git a/lib/IR/AsmPrinter.cpp b/lib/IR/AsmPrinter.cpp
index 3db030b..d84bdc3 100644
--- a/lib/IR/AsmPrinter.cpp
+++ b/lib/IR/AsmPrinter.cpp
@@ -945,9 +945,10 @@
void CFGFunctionPrinter::print(const ReturnInst *inst) {
os << "return";
- if (inst->getNumOperands() != 0)
- os << ' ';
+ if (inst->getNumOperands() == 0)
+ return;
+ os << ' ';
interleaveComma(inst->getOperands(),
[&](const CFGValue *operand) { printValueID(operand); });
os << " : ";