[lld] r344075 - Remove redundant `Symtab->`.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 9 13:22:19 PDT 2018
Author: ruiu
Date: Tue Oct 9 13:22:18 2018
New Revision: 344075
URL: http://llvm.org/viewvc/llvm-project?rev=344075&view=rev
Log:
Remove redundant `Symtab->`.
`SymbolTable` is a singleton class and is a global variable for the
unique instance, so we can always refer the symtab by `Symtab->`.
However, we don't need to use the global varaible from member functions
of SymbolTable class.
Modified:
lld/trunk/ELF/SymbolTable.cpp
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=344075&r1=344074&r2=344075&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Oct 9 13:22:18 2018
@@ -154,9 +154,9 @@ void SymbolTable::trace(StringRef Name)
void SymbolTable::wrap(Symbol *Sym, Symbol *Real, Symbol *Wrap) {
// Swap symbols as instructed by -wrap.
- int &Idx1 = Symtab->SymMap[CachedHashStringRef(Sym->getName())];
- int &Idx2 = Symtab->SymMap[CachedHashStringRef(Real->getName())];
- int &Idx3 = Symtab->SymMap[CachedHashStringRef(Wrap->getName())];
+ int &Idx1 = SymMap[CachedHashStringRef(Sym->getName())];
+ int &Idx2 = SymMap[CachedHashStringRef(Real->getName())];
+ int &Idx3 = SymMap[CachedHashStringRef(Wrap->getName())];
Idx2 = Idx1;
Idx1 = Idx3;
@@ -563,7 +563,7 @@ void SymbolTable::addLazyArchive(StringR
const object::Archive::Symbol Sym) {
Symbol *S;
bool WasInserted;
- std::tie(S, WasInserted) = Symtab->insert(Name);
+ std::tie(S, WasInserted) = insert(Name);
if (WasInserted) {
replaceSymbol<LazyArchive>(S, File, STT_NOTYPE, Sym);
return;
@@ -580,14 +580,14 @@ void SymbolTable::addLazyArchive(StringR
}
if (InputFile *F = File.fetch(Sym))
- Symtab->addFile<ELFT>(F);
+ addFile<ELFT>(F);
}
template <class ELFT>
void SymbolTable::addLazyObject(StringRef Name, LazyObjFile &File) {
Symbol *S;
bool WasInserted;
- std::tie(S, WasInserted) = Symtab->insert(Name);
+ std::tie(S, WasInserted) = insert(Name);
if (WasInserted) {
replaceSymbol<LazyObject>(S, File, STT_NOTYPE, Name);
return;
@@ -604,7 +604,7 @@ void SymbolTable::addLazyObject(StringRe
}
if (InputFile *F = File.fetch())
- Symtab->addFile<ELFT>(F);
+ addFile<ELFT>(F);
}
template <class ELFT> void SymbolTable::fetchLazy(Symbol *Sym) {
More information about the llvm-commits
mailing list