[lld] r249895 - Simplify. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 9 13:32:54 PDT 2015
Author: ruiu
Date: Fri Oct 9 15:32:54 2015
New Revision: 249895
URL: http://llvm.org/viewvc/llvm-project?rev=249895&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=249895&r1=249894&r2=249895&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Fri Oct 9 15:32:54 2015
@@ -278,11 +278,10 @@ template <class ELFT> void DynamicSectio
if (FiniArraySec)
NumEntries += 2;
- const std::vector<std::unique_ptr<SharedFileBase>> &SharedFiles =
- SymTab.getSharedFiles();
- for (const std::unique_ptr<SharedFileBase> &File : SharedFiles)
- Out<ELFT>::DynStrTab->add(File->getSoName());
- NumEntries += SharedFiles.size();
+ for (const std::unique_ptr<SharedFileBase> &F : SymTab.getSharedFiles()) {
+ Out<ELFT>::DynStrTab->add(F->getSoName());
+ ++NumEntries;
+ }
if (Symbol *S = SymTab.getSymbols().lookup(Config->Init))
InitSym = dyn_cast<ELFSymbolBody<ELFT>>(S->Body);
@@ -356,10 +355,8 @@ template <class ELFT> void DynamicSectio
WriteArray(DT_INIT_ARRAY, DT_INIT_ARRAYSZ, InitArraySec);
WriteArray(DT_FINI_ARRAY, DT_FINI_ARRAYSZ, FiniArraySec);
- const std::vector<std::unique_ptr<SharedFileBase>> &SharedFiles =
- SymTab.getSharedFiles();
- for (const std::unique_ptr<SharedFileBase> &File : SharedFiles)
- WriteVal(DT_NEEDED, Out<ELFT>::DynStrTab->getFileOff(File->getSoName()));
+ for (const std::unique_ptr<SharedFileBase> &F : SymTab.getSharedFiles())
+ WriteVal(DT_NEEDED, Out<ELFT>::DynStrTab->getFileOff(F->getSoName()));
if (InitSym)
WritePtr(DT_INIT, getSymVA<ELFT>(*InitSym));
More information about the llvm-commits
mailing list