[llvm] 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:
    llvm/trunk/lib/WindowsManifest/WindowsManifestMerger.cpp
    llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp

Modified: llvm/trunk/lib/WindowsManifest/WindowsManifestMerger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/WindowsManifest/WindowsManifestMerger.cpp?rev=369695&r1=369694&r2=369695&view=diff
==============================================================================
--- llvm/trunk/lib/WindowsManifest/WindowsManifestMerger.cpp (original)
+++ llvm/trunk/lib/WindowsManifest/WindowsManifestMerger.cpp Thu Aug 22 12:43:27 2019
@@ -58,7 +58,7 @@ private:
 
 #if LLVM_LIBXML2_ENABLED
 
-static const std::pair<StringRef, StringRef> MtNsHrefsPrefixes[] = {
+static constexpr std::pair<StringLiteral, StringLiteral> MtNsHrefsPrefixes[] = {
     {"urn:schemas-microsoft-com:asm.v1", "ms_asmv1"},
     {"urn:schemas-microsoft-com:asm.v2", "ms_asmv2"},
     {"urn:schemas-microsoft-com:asm.v3", "ms_asmv3"},

Modified: llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp?rev=369695&r1=369694&r2=369695&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp Thu Aug 22 12:43:27 2019
@@ -397,7 +397,7 @@ void SectionWriter::visit(const OwnedDat
   llvm::copy(Sec.Data, Out.getBufferStart() + Sec.Offset);
 }
 
-static const std::vector<uint8_t> ZlibGnuMagic = {'Z', 'L', 'I', 'B'};
+static constexpr std::array<uint8_t, 4> ZlibGnuMagic = {'Z', 'L', 'I', 'B'};
 
 static bool isDataGnuCompressed(ArrayRef<uint8_t> Data) {
   return Data.size() > ZlibGnuMagic.size() &&




More information about the llvm-commits mailing list