[lld] r310925 - Remove SymbolTable::findInCurrentDSO.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 15 09:03:12 PDT 2017
Author: ruiu
Date: Tue Aug 15 09:03:11 2017
New Revision: 310925
URL: http://llvm.org/viewvc/llvm-project?rev=310925&view=rev
Log:
Remove SymbolTable::findInCurrentDSO.
This function doesn't seem to add value to the symbol table as
it is easy to write code without it.
Modified:
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/ELF/SymbolTable.h
lld/trunk/ELF/SyntheticSections.cpp
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=310925&r1=310924&r2=310925&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Aug 15 09:03:11 2017
@@ -527,13 +527,6 @@ SymbolBody *SymbolTable::find(StringRef
return SymVector[V.Idx]->body();
}
-SymbolBody *SymbolTable::findInCurrentDSO(StringRef Name) {
- if (SymbolBody *S = find(Name))
- if (S->isInCurrentDSO())
- return S;
- return nullptr;
-}
-
template <class ELFT>
Symbol *SymbolTable::addLazyArchive(ArchiveFile *F,
const object::Archive::Symbol Sym) {
Modified: lld/trunk/ELF/SymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.h?rev=310925&r1=310924&r2=310925&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.h (original)
+++ lld/trunk/ELF/SymbolTable.h Tue Aug 15 09:03:11 2017
@@ -87,7 +87,6 @@ public:
void scanVersionScript();
SymbolBody *find(StringRef Name);
- SymbolBody *findInCurrentDSO(StringRef Name);
void trace(StringRef Name);
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=310925&r1=310924&r2=310925&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Tue Aug 15 09:03:11 2017
@@ -1135,10 +1135,12 @@ template <class ELFT> void DynamicSectio
add({DT_FINI_ARRAYSZ, Out::FiniArray, Entry::SecSize});
}
- if (SymbolBody *B = Symtab->findInCurrentDSO(Config->Init))
- add({DT_INIT, B});
- if (SymbolBody *B = Symtab->findInCurrentDSO(Config->Fini))
- add({DT_FINI, B});
+ if (SymbolBody *B = Symtab->find(Config->Init))
+ if (B->isInCurrentDSO())
+ add({DT_INIT, B});
+ if (SymbolBody *B = Symtab->find(Config->Fini))
+ if (B->isInCurrentDSO())
+ add({DT_FINI, B});
bool HasVerNeed = In<ELFT>::VerNeed->getNeedNum() != 0;
if (HasVerNeed || In<ELFT>::VerDef)
More information about the llvm-commits
mailing list