forked from OSchip/llvm-project
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
This commit is contained in:
parent
714abece2b
commit
fbc629702d
|
@ -154,9 +154,9 @@ void SymbolTable::trace(StringRef Name) {
|
||||||
|
|
||||||
void SymbolTable::wrap(Symbol *Sym, Symbol *Real, Symbol *Wrap) {
|
void SymbolTable::wrap(Symbol *Sym, Symbol *Real, Symbol *Wrap) {
|
||||||
// Swap symbols as instructed by -wrap.
|
// Swap symbols as instructed by -wrap.
|
||||||
int &Idx1 = Symtab->SymMap[CachedHashStringRef(Sym->getName())];
|
int &Idx1 = SymMap[CachedHashStringRef(Sym->getName())];
|
||||||
int &Idx2 = Symtab->SymMap[CachedHashStringRef(Real->getName())];
|
int &Idx2 = SymMap[CachedHashStringRef(Real->getName())];
|
||||||
int &Idx3 = Symtab->SymMap[CachedHashStringRef(Wrap->getName())];
|
int &Idx3 = SymMap[CachedHashStringRef(Wrap->getName())];
|
||||||
|
|
||||||
Idx2 = Idx1;
|
Idx2 = Idx1;
|
||||||
Idx1 = Idx3;
|
Idx1 = Idx3;
|
||||||
|
@ -563,7 +563,7 @@ void SymbolTable::addLazyArchive(StringRef Name, ArchiveFile &File,
|
||||||
const object::Archive::Symbol Sym) {
|
const object::Archive::Symbol Sym) {
|
||||||
Symbol *S;
|
Symbol *S;
|
||||||
bool WasInserted;
|
bool WasInserted;
|
||||||
std::tie(S, WasInserted) = Symtab->insert(Name);
|
std::tie(S, WasInserted) = insert(Name);
|
||||||
if (WasInserted) {
|
if (WasInserted) {
|
||||||
replaceSymbol<LazyArchive>(S, File, STT_NOTYPE, Sym);
|
replaceSymbol<LazyArchive>(S, File, STT_NOTYPE, Sym);
|
||||||
return;
|
return;
|
||||||
|
@ -580,14 +580,14 @@ void SymbolTable::addLazyArchive(StringRef Name, ArchiveFile &File,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InputFile *F = File.fetch(Sym))
|
if (InputFile *F = File.fetch(Sym))
|
||||||
Symtab->addFile<ELFT>(F);
|
addFile<ELFT>(F);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
void SymbolTable::addLazyObject(StringRef Name, LazyObjFile &File) {
|
void SymbolTable::addLazyObject(StringRef Name, LazyObjFile &File) {
|
||||||
Symbol *S;
|
Symbol *S;
|
||||||
bool WasInserted;
|
bool WasInserted;
|
||||||
std::tie(S, WasInserted) = Symtab->insert(Name);
|
std::tie(S, WasInserted) = insert(Name);
|
||||||
if (WasInserted) {
|
if (WasInserted) {
|
||||||
replaceSymbol<LazyObject>(S, File, STT_NOTYPE, Name);
|
replaceSymbol<LazyObject>(S, File, STT_NOTYPE, Name);
|
||||||
return;
|
return;
|
||||||
|
@ -604,7 +604,7 @@ void SymbolTable::addLazyObject(StringRef Name, LazyObjFile &File) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InputFile *F = File.fetch())
|
if (InputFile *F = File.fetch())
|
||||||
Symtab->addFile<ELFT>(F);
|
addFile<ELFT>(F);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ELFT> void SymbolTable::fetchLazy(Symbol *Sym) {
|
template <class ELFT> void SymbolTable::fetchLazy(Symbol *Sym) {
|
||||||
|
|
Loading…
Reference in New Issue