[lld] r301668 - Remove trailing whitespace from the -Map output.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 11:54:08 PDT 2017


Author: ruiu
Date: Fri Apr 28 13:54:08 2017
New Revision: 301668

URL: http://llvm.org/viewvc/llvm-project?rev=301668&view=rev
Log:
Remove trailing whitespace from the -Map output.

If a string is shorter than 7 characters, we used to print out
trailing whitespace characters.

Modified:
    lld/trunk/ELF/MapFile.cpp

Modified: lld/trunk/ELF/MapFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.cpp?rev=301668&r1=301667&r2=301668&view=diff
==============================================================================
--- lld/trunk/ELF/MapFile.cpp (original)
+++ lld/trunk/ELF/MapFile.cpp Fri Apr 28 13:54:08 2017
@@ -98,7 +98,7 @@ template <class ELFT> PrettyPrinter<ELFT
     raw_string_ostream OS(Str[I]);
     writeHeader<ELFT>(OS, Syms[I]->getVA(), Syms[I]->template getSize<ELFT>(),
                       0);
-    OS << indent(3) << left_justify(toString(*Syms[I]), 7) << '\n';
+    OS << indent(3) << toString(*Syms[I]) << '\n';
   });
   for (size_t I = 0, E = Syms.size(); I < E; ++I)
     SymStr[Syms[I]] = std::move(Str[I]);
@@ -120,7 +120,7 @@ void PrettyPrinter<ELFT>::writeInputSect
   if (IS->Name != CurSection) {
     writeHeader<ELFT>(OS, IS->OutSec->Addr + IS->OutSecOff, IS->getSize(),
                       IS->Alignment);
-    OS << indent(1) << left_justify(IS->Name, 7) << '\n';
+    OS << indent(1) << IS->Name << '\n';
     CurSection = IS->Name;
   }
 
@@ -131,7 +131,7 @@ void PrettyPrinter<ELFT>::writeInputSect
 
   writeHeader<ELFT>(OS, IS->OutSec->Addr + IS->OutSecOff, IS->getSize(),
                     IS->Alignment);
-  OS << indent(2) << left_justify(toString(File), 7) << '\n';
+  OS << indent(2) << toString(File) << '\n';
 
   for (DefinedRegular *Sym : Symbols[IS])
     OS << SymStr[Sym];
@@ -148,7 +148,7 @@ void PrettyPrinter<ELFT>::print(raw_ostr
   // Print out a mapfile.
   for (OutputSection *Sec : OutputSections) {
     writeHeader<ELFT>(OS, Sec->Addr, Sec->Size, Sec->Alignment);
-    OS << left_justify(Sec->Name, 7) << '\n';
+    OS << Sec->Name << '\n';
 
     StringRef CurSection;
     for (InputSection *IS : Sec->Sections)




More information about the llvm-commits mailing list