diff --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp --- a/mlir/lib/IR/Operation.cpp +++ b/mlir/lib/IR/Operation.cpp @@ -243,7 +243,9 @@ InFlightDiagnostic Operation::emitWarning(const Twine &message) { InFlightDiagnostic diag = mlir::emitWarning(getLoc(), message); if (getContext()->shouldPrintOpOnDiagnostic()) - diag.attachNote(getLoc()) << "see current operation: " << *this; + diag.attachNote(getLoc()) + .append("see current operation: ") + .appendOp(*this, OpPrintingFlags().printGenericOpForm()); return diag; } @@ -252,7 +254,9 @@ InFlightDiagnostic Operation::emitRemark(const Twine &message) { InFlightDiagnostic diag = mlir::emitRemark(getLoc(), message); if (getContext()->shouldPrintOpOnDiagnostic()) - diag.attachNote(getLoc()) << "see current operation: " << *this; + diag.attachNote(getLoc()) + .append("see current operation: ") + .appendOp(*this, OpPrintingFlags().printGenericOpForm()); return diag; }