From fbc629702d69bf7ca8a73106f1df52a0c33b54c5 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 9 Oct 2018 20:22:18 +0000 Subject: [PATCH] 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. llvm-svn: 344075 --- lld/ELF/SymbolTable.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 5e40f2f..1af8ca6 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -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(StringRef Name, ArchiveFile &File, 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(S, File, STT_NOTYPE, Sym); return; @@ -580,14 +580,14 @@ void SymbolTable::addLazyArchive(StringRef Name, ArchiveFile &File, } if (InputFile *F = File.fetch(Sym)) - Symtab->addFile(F); + addFile(F); } template 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(S, File, STT_NOTYPE, Name); return; @@ -604,7 +604,7 @@ void SymbolTable::addLazyObject(StringRef Name, LazyObjFile &File) { } if (InputFile *F = File.fetch()) - Symtab->addFile(F); + addFile(F); } template void SymbolTable::fetchLazy(Symbol *Sym) { -- 2.7.4