[lld] r256869 - Remove SymbolTable::isUndefined.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 5 12:35:17 PST 2016
Author: ruiu
Date: Tue Jan 5 14:35:16 2016
New Revision: 256869
URL: http://llvm.org/viewvc/llvm-project?rev=256869&view=rev
Log:
Remove SymbolTable::isUndefined.
Because it can be implemented outside of the symbol table.
Modified:
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/ELF/SymbolTable.h
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=256869&r1=256868&r2=256869&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Jan 5 14:35:16 2016
@@ -117,12 +117,6 @@ SymbolBody *SymbolTable<ELFT>::addIgnore
return Sym;
}
-template <class ELFT> bool SymbolTable<ELFT>::isUndefined(StringRef Name) {
- if (SymbolBody *Sym = find(Name))
- return Sym->isUndefined();
- return false;
-}
-
// Returns a file from which symbol B was created.
// If B does not belong to any file, returns a nullptr.
template <class ELFT>
Modified: lld/trunk/ELF/SymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.h?rev=256869&r1=256868&r2=256869&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.h (original)
+++ lld/trunk/ELF/SymbolTable.h Tue Jan 5 14:35:16 2016
@@ -55,7 +55,6 @@ public:
void addSynthetic(StringRef Name, OutputSectionBase<ELFT> &Section,
typename llvm::object::ELFFile<ELFT>::uintX_t Value);
SymbolBody *addIgnored(StringRef Name);
- bool isUndefined(StringRef Name);
void scanShlibUndefined();
SymbolBody *find(StringRef Name);
ELFFileBase<ELFT> *findFile(SymbolBody *B);
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=256869&r1=256868&r2=256869&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Jan 5 14:35:16 2016
@@ -955,10 +955,12 @@ void Writer<ELFT>::addStartStopSymbols(O
StringSaver Saver(Alloc);
StringRef Start = Saver.save("__start_" + S);
StringRef Stop = Saver.save("__stop_" + S);
- if (Symtab.isUndefined(Start))
- Symtab.addSynthetic(Start, *Sec, 0);
- if (Symtab.isUndefined(Stop))
- Symtab.addSynthetic(Stop, *Sec, Sec->getSize());
+ if (SymbolBody *B = Symtab.find(Start))
+ if (B->isUndefined())
+ Symtab.addSynthetic(Start, *Sec, 0);
+ if (SymbolBody *B = Symtab.find(Stop))
+ if (B->isUndefined())
+ Symtab.addSynthetic(Stop, *Sec, Sec->getSize());
}
template <class ELFT> static bool needsPhdr(OutputSectionBase<ELFT> *Sec) {
More information about the llvm-commits
mailing list