Change printInstruction to not print a trailing newline. Value::dump
authorDan Gohman <gohman@apple.com>
Mon, 13 Jul 2009 18:27:59 +0000 (18:27 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 13 Jul 2009 18:27:59 +0000 (18:27 +0000)
always adds a newline, so this fixes Value::dump printing an
extra blank line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75481 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index 959da81b0d841744b48a4ff654600fc4aab57e33..a49c09a1db1a78a4b88b23dcf1ae3793293dfc42 100644 (file)
@@ -1620,8 +1620,10 @@ void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
   if (AnnotationWriter) AnnotationWriter->emitBasicBlockStartAnnot(BB, Out);
 
   // Output all of the instructions in the basic block...
-  for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I)
+  for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
     printInstruction(*I);
+    Out << '\n';
+  }
 
   if (AnnotationWriter) AnnotationWriter->emitBasicBlockEndAnnot(BB, Out);
 }
@@ -1903,7 +1905,6 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
   }
 
   printInfoComment(I);
-  Out << '\n';
 }