IR: Drop newline from AssemblyWriter::printMDNodeBody()

Remove a newline from `AssemblyWriter::printMDNodeBody()`, and add one
to `AssemblyWriter::writeMDNode()`.  NFCI for assembly output.

However, this drops an inconsistent newline from `Metadata::print()`
when `this` is an `MDNode`.  Now the newline added by `Metadata::dump()`
won't look so verbose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230565 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-02-25 22:46:38 +00:00
parent 8e3ef7f186
commit 344ea29148
2 changed files with 2 additions and 2 deletions

View File

@ -3000,6 +3000,7 @@ static void WriteMDNodeComment(const MDNode *Node,
void AssemblyWriter::writeMDNode(unsigned Slot, const MDNode *Node) {
Out << '!' << Slot << " = ";
printMDNodeBody(Node);
Out << "\n";
}
void AssemblyWriter::writeAllMDNodes() {
@ -3017,7 +3018,6 @@ void AssemblyWriter::writeAllMDNodes() {
void AssemblyWriter::printMDNodeBody(const MDNode *Node) {
WriteMDNodeBodyInternal(Out, Node, &TypePrinter, &Machine, TheModule);
WriteMDNodeComment(Node, Out);
Out << "\n";
}
void AssemblyWriter::writeAllAttributeGroups() {

View File

@ -228,7 +228,7 @@ TEST_F(MDNodeTest, Print) {
MDNode *Nodes[] = {N0, N1, N2};
for (auto *Node : Nodes)
OS << ", <" << (void *)Node << ">";
OS << "}\n";
OS << "}";
}
std::string Actual;