From: Rui Ueyama Date: Sat, 30 May 2015 19:28:58 +0000 (+0000) Subject: Use initializer instead of memset to zero out. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e00d651071326111da62344c9468dbd2312ff19b;p=platform%2Fupstream%2Fllvm.git Use initializer instead of memset to zero out. llvm-svn: 238662 --- diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp index 9b24368..e38f65a 100644 --- a/lld/COFF/Writer.cpp +++ b/lld/COFF/Writer.cpp @@ -41,11 +41,6 @@ static const int HeaderSize = namespace lld { namespace coff { -OutputSection::OutputSection(StringRef N, uint32_t SI) - : Name(N), SectionIndex(SI) { - memset(&Header, 0, sizeof(Header)); -} - void OutputSection::setRVA(uint64_t RVA) { Header.VirtualAddress = RVA; for (Chunk *C : Chunks) diff --git a/lld/COFF/Writer.h b/lld/COFF/Writer.h index 429eb68..b6d1360 100644 --- a/lld/COFF/Writer.h +++ b/lld/COFF/Writer.h @@ -30,7 +30,8 @@ const uint32_t PermMask = 0xF00000F0; // non-overlapping file offsets and RVAs. class OutputSection { public: - OutputSection(StringRef Name, uint32_t SectionIndex); + OutputSection(StringRef N, uint32_t SI) + : Name(N), SectionIndex(SI), Header({}) {} void setRVA(uint64_t); void setFileOffset(uint64_t); void addChunk(Chunk *C); @@ -59,9 +60,9 @@ public: void setStringTableOff(uint32_t V) { StringTableOff = V; } private: - coff_section Header; StringRef Name; uint32_t SectionIndex; + coff_section Header; uint32_t StringTableOff = 0; std::vector Chunks; };