[lld] r252006 - [elf2] Use value-initialization instead of memset.

Michael J. Spencer via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 3 14:43:11 PST 2015


Author: mspencer
Date: Tue Nov  3 16:43:11 2015
New Revision: 252006

URL: http://llvm.org/viewvc/llvm-project?rev=252006&view=rev
Log:
[elf2] Use value-initialization instead of memset.

Modified:
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=252006&r1=252005&r2=252006&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Nov  3 16:43:11 2015
@@ -692,8 +692,7 @@ template <class ELFT> void Writer<ELFT>:
   setPhdr(&Phdrs[++PhdrIdx], PT_LOAD, PF_R, 0, getVAStart(), FileOff,
           Target->getPageSize());
 
-  Elf_Phdr TlsPhdr;
-  std::memset(&TlsPhdr, 0, sizeof(Elf_Phdr));
+  Elf_Phdr TlsPhdr{};
   uintX_t ThreadBSSOffset = 0;
   // Create phdrs as we assign VAs and file offsets to all output sections.
   SmallPtrSet<Elf_Phdr *, 8> Closed;




More information about the llvm-commits mailing list