[llvm-commits] [llvm] r163693 - /llvm/trunk/lib/VMCore/AsmWriter.cpp

Duncan Sands baldrick at free.fr
Wed Sep 12 02:55:51 PDT 2012


Author: baldrick
Date: Wed Sep 12 04:55:51 2012
New Revision: 163693

URL: http://llvm.org/viewvc/llvm-project?rev=163693&view=rev
Log:
When calling print directly on a global (eg from the debugger) it
was printing a newline that doesn't occur when printing other kinds
of LLVM values.  Move the printing of that newline elsewhere, making
globals print the same as other values while leaving the output when
printing an entire module unchanged.  Patch by Saša Tomić.

Modified:
    llvm/trunk/lib/VMCore/AsmWriter.cpp

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=163693&r1=163692&r2=163693&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Sep 12 04:55:51 2012
@@ -1288,8 +1288,9 @@
   // Output all globals.
   if (!M->global_empty()) Out << '\n';
   for (Module::const_global_iterator I = M->global_begin(), E = M->global_end();
-       I != E; ++I)
-    printGlobal(I);
+       I != E; ++I) {
+    printGlobal(I); Out << '\n';
+  }
 
   // Output all aliases.
   if (!M->alias_empty()) Out << "\n";
@@ -1439,7 +1440,6 @@
     Out << ", align " << GV->getAlignment();
 
   printInfoComment(*GV);
-  Out << '\n';
 }
 
 void AssemblyWriter::printAlias(const GlobalAlias *GA) {





More information about the llvm-commits mailing list