diff options
author | Rui Ueyama <ruiu@google.com> | 2015-05-30 19:28:58 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-05-30 19:28:58 +0000 |
commit | e00d651071326111da62344c9468dbd2312ff19b (patch) | |
tree | b4a5b20f12dfa68985bf30c7e3163b808b80c1f5 | |
parent | bfb4aa17915d4bea1e54b1ec6c8b4f183a9b5c3c (diff) | |
download | bcm5719-llvm-e00d651071326111da62344c9468dbd2312ff19b.tar.gz bcm5719-llvm-e00d651071326111da62344c9468dbd2312ff19b.zip |
Use initializer instead of memset to zero out.
llvm-svn: 238662
-rw-r--r-- | lld/COFF/Writer.cpp | 5 | ||||
-rw-r--r-- | lld/COFF/Writer.h | 5 |
2 files changed, 3 insertions, 7 deletions
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp index 9b243682031..e38f65a8fe5 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 429eb683d65..b6d1360c53b 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<Chunk *> Chunks; }; |