[lld] r256903 - Simplify. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 5 18:52:24 PST 2016
Author: ruiu
Date: Tue Jan 5 20:52:24 2016
New Revision: 256903
URL: http://llvm.org/viewvc/llvm-project?rev=256903&view=rev
Log:
Simplify. NFC.
Modified:
lld/trunk/ELF/OutputSections.cpp
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=256903&r1=256902&r2=256903&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Jan 5 20:52:24 2016
@@ -1118,9 +1118,9 @@ void MergeOutputSection<ELFT>::addSectio
ArrayRef<uint8_t> D = S->getSectionData();
StringRef Data((const char *)D.data(), D.size());
uintX_t EntSize = S->getSectionHdr()->sh_entsize;
- uintX_t Offset = 0;
if (this->Header.sh_flags & SHF_STRINGS) {
+ uintX_t Offset = 0;
while (!Data.empty()) {
size_t End = findNull(Data, EntSize);
if (End == StringRef::npos)
@@ -1138,8 +1138,7 @@ void MergeOutputSection<ELFT>::addSectio
for (unsigned I = 0, N = Data.size(); I != N; I += EntSize) {
StringRef Entry = Data.substr(I, EntSize);
size_t OutputOffset = Builder.add(Entry);
- S->Offsets.push_back(std::make_pair(Offset, OutputOffset));
- Offset += EntSize;
+ S->Offsets.push_back(std::make_pair(I, OutputOffset));
}
}
}
More information about the llvm-commits
mailing list