Move newline printed with op to function/basic block printer.
Allows printing the instruction to string without trailing newline. Making it easier to reuse print to annotate instructions during lowering. And removes need for newline in the print functions of ops.
PiperOrigin-RevId: 204630791
diff --git a/lib/IR/StandardOps.cpp b/lib/IR/StandardOps.cpp
index 01d91bb..d1ddf65 100644
--- a/lib/IR/StandardOps.cpp
+++ b/lib/IR/StandardOps.cpp
@@ -21,7 +21,7 @@
using namespace mlir;
void AddFOp::print(raw_ostream &os) const {
- os << "addf xx, yy : sometype\n";
+ os << "addf xx, yy : sometype";
}
// Return an error message on failure.
@@ -33,7 +33,7 @@
}
void DimOp::print(raw_ostream &os) const {
- os << "dim xxx, " << getIndex() << " : sometype\n";
+ os << "dim xxx, " << getIndex() << " : sometype";
}
const char *DimOp::verify() const {