Simplify now that this is only used for global symbols.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Nov 2016 20:48:57 +0000 (20:48 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Nov 2016 20:48:57 +0000 (20:48 +0000)
llvm-svn: 285966

lld/ELF/InputFiles.cpp
lld/ELF/InputFiles.h
lld/ELF/Relocations.cpp

index a56361c7fd7b2bd54ceedf18718664265334eb1d..4a278542eb9489e5dd9d10150961c2b985ce8f09 100644 (file)
@@ -117,10 +117,8 @@ ELFFileBase<ELFT>::ELFFileBase(Kind K, MemoryBufferRef MB) : InputFile(K, MB) {
 }
 
 template <class ELFT>
-typename ELFT::SymRange ELFFileBase<ELFT>::getElfSymbols(bool OnlyGlobals) {
-  if (OnlyGlobals)
+typename ELFT::SymRange ELFFileBase<ELFT>::getGlobalSymbols() {
     return makeArrayRef(Symbols.begin() + FirstNonLocal, Symbols.end());
-  return Symbols;
 }
 
 template <class ELFT>
@@ -647,7 +645,7 @@ template <class ELFT> void SharedFile<ELFT>::parseRest() {
   const Elf_Versym *Versym = nullptr;
   std::vector<const Elf_Verdef *> Verdefs = parseVerdefs(Versym);
 
-  Elf_Sym_Range Syms = this->getElfSymbols(true);
+  Elf_Sym_Range Syms = this->getGlobalSymbols();
   for (const Elf_Sym &Sym : Syms) {
     unsigned VersymIndex = 0;
     if (Versym) {
index b45643d8d369ccb24fad39765f89bcdbd171043e..63f9fff419f6f624d4a77c0c94d5bfabe077d56e 100644 (file)
@@ -108,7 +108,7 @@ public:
 
   uint32_t getSectionIndex(const Elf_Sym &Sym) const;
 
-  Elf_Sym_Range getElfSymbols(bool OnlyGlobals);
+  Elf_Sym_Range getGlobalSymbols();
 
 protected:
   ArrayRef<Elf_Sym> Symbols;
index 23d929fc3e8474fea53bbe3f6c60ffcbfbd52201..bf9eac2bfaa544d71936f6f8c96bc838ee05fb6e 100644 (file)
@@ -402,7 +402,7 @@ template <class ELFT> static void addCopyRelSymbol(SharedSymbol<ELFT> *SS) {
   // Look through the DSO's dynamic symbol table for aliases and create a
   // dynamic symbol for each one. This causes the copy relocation to correctly
   // interpose any aliases.
-  for (const Elf_Sym &S : SS->file()->getElfSymbols(true)) {
+  for (const Elf_Sym &S : SS->file()->getGlobalSymbols()) {
     if (S.st_shndx != Shndx || S.st_value != Value)
       continue;
     auto *Alias = dyn_cast_or_null<SharedSymbol<ELFT>>(