[lld] r314591 - Make parameter lists of SymbolTable::add* functions more consistent. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 30 05:41:34 PDT 2017
Author: ruiu
Date: Sat Sep 30 05:41:34 2017
New Revision: 314591
URL: http://llvm.org/viewvc/llvm-project?rev=314591&view=rev
Log:
Make parameter lists of SymbolTable::add* functions more consistent. NFC.
Modified:
lld/trunk/ELF/InputFiles.cpp
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/ELF/SymbolTable.h
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=314591&r1=314590&r2=314591&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Sat Sep 30 05:41:34 2017
@@ -616,7 +616,8 @@ ArchiveFile::ArchiveFile(std::unique_ptr
template <class ELFT> void ArchiveFile::parse() {
Symbols.reserve(File->getNumberOfSymbols());
for (const Archive::Symbol &Sym : File->symbols())
- Symbols.push_back(Symtab->addLazyArchive<ELFT>(this, Sym)->body());
+ Symbols.push_back(
+ Symtab->addLazyArchive<ELFT>(Sym.getName(), this, Sym)->body());
}
// Returns a buffer pointing to a member file containing a given symbol.
@@ -779,14 +780,14 @@ template <class ELFT> void SharedFile<EL
VersymIndex == VER_NDX_GLOBAL ? nullptr : Verdefs[VersymIndex];
if (!Hidden)
- Symtab->addShared(this, Name, Sym, V);
+ Symtab->addShared(Name, this, Sym, V);
// Also add the symbol with the versioned name to handle undefined symbols
// with explicit versions.
if (V) {
StringRef VerName = this->StringTable.data() + V->getAux()->vda_name;
Name = Saver.save(Name + "@" + VerName);
- Symtab->addShared(this, Name, Sym, V);
+ Symtab->addShared(Name, this, Sym, V);
}
}
}
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=314591&r1=314590&r2=314591&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Sat Sep 30 05:41:34 2017
@@ -472,7 +472,7 @@ Symbol *SymbolTable::addRegular(StringRe
}
template <typename ELFT>
-void SymbolTable::addShared(SharedFile<ELFT> *File, StringRef Name,
+void SymbolTable::addShared(StringRef Name, SharedFile<ELFT> *File,
const typename ELFT::Sym &Sym,
const typename ELFT::Verdef *Verdef) {
// DSO symbols do not affect visibility in the output, so we pass STV_DEFAULT
@@ -533,11 +533,10 @@ void SymbolTable::defsym(Symbol *Dst, Sy
}
template <class ELFT>
-Symbol *SymbolTable::addLazyArchive(ArchiveFile *F,
+Symbol *SymbolTable::addLazyArchive(StringRef Name, ArchiveFile *F,
const object::Archive::Symbol Sym) {
Symbol *S;
bool WasInserted;
- StringRef Name = Sym.getName();
std::tie(S, WasInserted) = insert(Name);
if (WasInserted) {
replaceBody<LazyArchive>(S, F, Sym, SymbolBody::UnknownType);
@@ -840,16 +839,16 @@ template DefinedRegular *SymbolTable::ad
template DefinedRegular *SymbolTable::addIgnored<ELF64BE>(StringRef, uint8_t);
template Symbol *
-SymbolTable::addLazyArchive<ELF32LE>(ArchiveFile *,
+SymbolTable::addLazyArchive<ELF32LE>(StringRef, ArchiveFile *,
const object::Archive::Symbol);
template Symbol *
-SymbolTable::addLazyArchive<ELF32BE>(ArchiveFile *,
+SymbolTable::addLazyArchive<ELF32BE>(StringRef, ArchiveFile *,
const object::Archive::Symbol);
template Symbol *
-SymbolTable::addLazyArchive<ELF64LE>(ArchiveFile *,
+SymbolTable::addLazyArchive<ELF64LE>(StringRef, ArchiveFile *,
const object::Archive::Symbol);
template Symbol *
-SymbolTable::addLazyArchive<ELF64BE>(ArchiveFile *,
+SymbolTable::addLazyArchive<ELF64BE>(StringRef, ArchiveFile *,
const object::Archive::Symbol);
template void SymbolTable::addLazyObject<ELF32LE>(StringRef, LazyObjFile &);
@@ -857,16 +856,16 @@ template void SymbolTable::addLazyObject
template void SymbolTable::addLazyObject<ELF64LE>(StringRef, LazyObjFile &);
template void SymbolTable::addLazyObject<ELF64BE>(StringRef, LazyObjFile &);
-template void SymbolTable::addShared<ELF32LE>(SharedFile<ELF32LE> *, StringRef,
+template void SymbolTable::addShared<ELF32LE>(StringRef, SharedFile<ELF32LE> *,
const typename ELF32LE::Sym &,
const typename ELF32LE::Verdef *);
-template void SymbolTable::addShared<ELF32BE>(SharedFile<ELF32BE> *, StringRef,
+template void SymbolTable::addShared<ELF32BE>(StringRef, SharedFile<ELF32BE> *,
const typename ELF32BE::Sym &,
const typename ELF32BE::Verdef *);
-template void SymbolTable::addShared<ELF64LE>(SharedFile<ELF64LE> *, StringRef,
+template void SymbolTable::addShared<ELF64LE>(StringRef, SharedFile<ELF64LE> *,
const typename ELF64LE::Sym &,
const typename ELF64LE::Verdef *);
-template void SymbolTable::addShared<ELF64BE>(SharedFile<ELF64BE> *, StringRef,
+template void SymbolTable::addShared<ELF64BE>(StringRef, SharedFile<ELF64BE> *,
const typename ELF64BE::Sym &,
const typename ELF64BE::Verdef *);
Modified: lld/trunk/ELF/SymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.h?rev=314591&r1=314590&r2=314591&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.h (original)
+++ lld/trunk/ELF/SymbolTable.h Sat Sep 30 05:41:34 2017
@@ -62,18 +62,20 @@ public:
SectionBase *Section, InputFile *File);
template <class ELFT>
- void addShared(SharedFile<ELFT> *F, StringRef Name,
+ void addShared(StringRef Name, SharedFile<ELFT> *F,
const typename ELFT::Sym &Sym,
const typename ELFT::Verdef *Verdef);
template <class ELFT>
- Symbol *addLazyArchive(ArchiveFile *F, const llvm::object::Archive::Symbol S);
+ Symbol *addLazyArchive(StringRef Name, ArchiveFile *F,
+ const llvm::object::Archive::Symbol S);
+
template <class ELFT> void addLazyObject(StringRef Name, LazyObjFile &Obj);
Symbol *addBitcode(StringRef Name, uint8_t Binding, uint8_t StOther,
uint8_t Type, bool CanOmitFromDynSym, BitcodeFile *File);
- Symbol *addCommon(StringRef N, uint64_t Size, uint32_t Alignment,
+ Symbol *addCommon(StringRef Name, uint64_t Size, uint32_t Alignment,
uint8_t Binding, uint8_t StOther, uint8_t Type,
InputFile *File);
More information about the llvm-commits
mailing list