diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:08:33 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:08:33 +0000 |
| commit | 20d35e67e67f106f617c939725101223211659f0 (patch) | |
| tree | 64eb963cbf5ba58765e0a6b64a440965d66a7a4d /COFF/MapFile.cpp | |
| parent | ae1a339de31cf4065777531959a11e55a2e5fa00 (diff) | |
Notes
Diffstat (limited to 'COFF/MapFile.cpp')
| -rw-r--r-- | COFF/MapFile.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/COFF/MapFile.cpp b/COFF/MapFile.cpp index 717ed3419ea5d..6ca1b6647bd74 100644 --- a/COFF/MapFile.cpp +++ b/COFF/MapFile.cpp @@ -23,7 +23,6 @@ #include "SymbolTable.h" #include "Symbols.h" #include "Writer.h" - #include "lld/Common/ErrorHandler.h" #include "llvm/Support/Parallel.h" #include "llvm/Support/raw_ostream.h" @@ -37,14 +36,15 @@ using namespace lld::coff; typedef DenseMap<const SectionChunk *, SmallVector<DefinedRegular *, 4>> SymbolMapTy; +static const std::string Indent8 = " "; // 8 spaces +static const std::string Indent16 = " "; // 16 spaces + // Print out the first three columns of a line. static void writeHeader(raw_ostream &OS, uint64_t Addr, uint64_t Size, uint64_t Align) { OS << format("%08llx %08llx %5lld ", Addr, Size, Align); } -static std::string indent(int Depth) { return std::string(Depth * 8, ' '); } - // Returns a list of all symbols that we want to print out. static std::vector<DefinedRegular *> getSymbols() { std::vector<DefinedRegular *> V; @@ -79,7 +79,7 @@ getSymbolStrings(ArrayRef<DefinedRegular *> Syms) { for_each_n(parallel::par, (size_t)0, Syms.size(), [&](size_t I) { raw_string_ostream OS(Str[I]); writeHeader(OS, Syms[I]->getRVA(), 0, 0); - OS << indent(2) << toString(*Syms[I]); + OS << Indent16 << toString(*Syms[I]); }); DenseMap<DefinedRegular *, std::string> Ret; @@ -108,7 +108,7 @@ void coff::writeMapFile(ArrayRef<OutputSection *> OutputSections) { // Print out file contents. for (OutputSection *Sec : OutputSections) { writeHeader(OS, Sec->getRVA(), Sec->getVirtualSize(), /*Align=*/PageSize); - OS << Sec->getName() << '\n'; + OS << Sec->Name << '\n'; for (Chunk *C : Sec->getChunks()) { auto *SC = dyn_cast<SectionChunk>(C); @@ -116,7 +116,7 @@ void coff::writeMapFile(ArrayRef<OutputSection *> OutputSections) { continue; writeHeader(OS, SC->getRVA(), SC->getSize(), SC->Alignment); - OS << indent(1) << SC->File->getName() << ":(" << SC->getSectionName() + OS << Indent8 << SC->File->getName() << ":(" << SC->getSectionName() << ")\n"; for (DefinedRegular *Sym : SectionSyms[SC]) OS << SymStr[Sym] << '\n'; |
