[lld] r270523 - Use range-based for.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon May 23 19:10:28 PDT 2016
Author: ruiu
Date: Mon May 23 21:10:28 2016
New Revision: 270523
URL: http://llvm.org/viewvc/llvm-project?rev=270523&view=rev
Log:
Use range-based for.
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=270523&r1=270522&r2=270523&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Mon May 23 21:10:28 2016
@@ -1250,12 +1250,9 @@ void MergeOutputSection<ELFT>::addSectio
this->updateAlign(Sec->Align);
this->Header.sh_entsize = Sec->getSectionHdr()->sh_entsize;
- ArrayRef<uint8_t> D = Sec->getSectionData();
- StringRef Data((const char *)D.data(), D.size());
bool IsString = this->Header.sh_flags & SHF_STRINGS;
- for (size_t I = 0, N = Sec->Pieces.size(); I != N; ++I) {
- SectionPiece &Piece = Sec->Pieces[I];
+ for (SectionPiece &Piece : Sec->Pieces) {
if (!Piece.Live)
continue;
uintX_t OutputOffset = Builder.add(toStringRef(Piece.Data));
More information about the llvm-commits
mailing list