[lld] r196991 - [PECOFF] WriterPECOFF::ExecutableWriter: Small cleanup.
Rui Ueyama
ruiu at google.com
Tue Dec 10 17:07:52 PST 2013
Author: ruiu
Date: Tue Dec 10 19:07:52 2013
New Revision: 196991
URL: http://llvm.org/viewvc/llvm-project?rev=196991&view=rev
Log:
[PECOFF] WriterPECOFF::ExecutableWriter: Small cleanup.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=196991&r1=196990&r2=196991&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Tue Dec 10 19:07:52 2013
@@ -890,13 +890,11 @@ void ExecutableWriter::build(const File
addChunk(dataDirectory);
addChunk(sectionTable);
- std::vector<SectionChunk *> sectionChunks;
for (auto i : atoms) {
StringRef sectionName = i.first;
std::vector<const DefinedAtom *> &contents = i.second;
auto *section = new GenericSectionChunk(_PECOFFLinkingContext, sectionName,
contents);
- sectionChunks.push_back(section);
addSectionChunk(section, sectionTable);
}
@@ -918,7 +916,10 @@ void ExecutableWriter::build(const File
setImageSizeOnDisk();
- for (SectionChunk *section : sectionChunks) {
+ for (std::unique_ptr<Chunk> &chunk : _chunks) {
+ SectionChunk *section = dyn_cast<SectionChunk>(chunk.get());
+ if (!section)
+ continue;
if (section->getSectionName() == ".text") {
peHeader->setBaseOfCode(section->getVirtualAddress());
setAddressOfEntryPoint(section, peHeader);
More information about the llvm-commits
mailing list