[lld] r369695 - Fight a bit against global initializers. NFC.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 12:43:27 PDT 2019


Author: d0k
Date: Thu Aug 22 12:43:27 2019
New Revision: 369695

URL: http://llvm.org/viewvc/llvm-project?rev=369695&view=rev
Log:
Fight a bit against global initializers. NFC.

Modified:
    lld/trunk/COFF/MapFile.cpp
    lld/trunk/ELF/MapFile.cpp

Modified: lld/trunk/COFF/MapFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/MapFile.cpp?rev=369695&r1=369694&r2=369695&view=diff
==============================================================================
--- lld/trunk/COFF/MapFile.cpp (original)
+++ lld/trunk/COFF/MapFile.cpp Thu Aug 22 12:43:27 2019
@@ -35,8 +35,8 @@ using namespace lld::coff;
 using SymbolMapTy =
     DenseMap<const SectionChunk *, SmallVector<DefinedRegular *, 4>>;
 
-static const std::string indent8 = "        ";          // 8 spaces
-static const std::string indent16 = "                "; // 16 spaces
+static constexpr char indent8[] = "        ";          // 8 spaces
+static constexpr char indent16[] = "                "; // 16 spaces
 
 // Print out the first three columns of a line.
 static void writeHeader(raw_ostream &os, uint64_t addr, uint64_t size,

Modified: lld/trunk/ELF/MapFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.cpp?rev=369695&r1=369694&r2=369695&view=diff
==============================================================================
--- lld/trunk/ELF/MapFile.cpp (original)
+++ lld/trunk/ELF/MapFile.cpp Thu Aug 22 12:43:27 2019
@@ -39,8 +39,8 @@ using namespace lld::elf;
 
 using SymbolMapTy = DenseMap<const SectionBase *, SmallVector<Defined *, 4>>;
 
-static const std::string indent8 = "        ";          // 8 spaces
-static const std::string indent16 = "                "; // 16 spaces
+static constexpr char indent8[] = "        ";          // 8 spaces
+static constexpr char indent16[] = "                "; // 16 spaces
 
 // Print out the first three columns of a line.
 static void writeHeader(raw_ostream &os, uint64_t vma, uint64_t lma,




More information about the llvm-commits mailing list