[lld] r285952 - Simplify by directly using this->Symbols. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 11:20:08 PDT 2016


Author: ruiu
Date: Thu Nov  3 13:20:08 2016
New Revision: 285952

URL: http://llvm.org/viewvc/llvm-project?rev=285952&view=rev
Log:
Simplify by directly using this->Symbols. NFC.

Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=285952&r1=285951&r2=285952&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Nov  3 13:20:08 2016
@@ -434,10 +434,8 @@ elf::ObjectFile<ELFT>::createInputSectio
 
 template <class ELFT>
 void elf::ObjectFile<ELFT>::initializeSymbols(ArrayRef<Elf_Shdr> Sections) {
-  Elf_Sym_Range Syms = this->getElfSymbols(false);
-  uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end());
-  SymbolBodies.reserve(NumSymbols);
-  for (const Elf_Sym &Sym : Syms)
+  SymbolBodies.reserve(this->Symbols.size());
+  for (const Elf_Sym &Sym : this->Symbols)
     SymbolBodies.push_back(createSymbolBody(&Sym));
 }
 




More information about the llvm-commits mailing list