From c5e372db40bcc9da47cea4499e65ca6818bfc08e Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 21 Jan 2016 02:10:12 +0000 Subject: [PATCH] Simplify function signature. NFC. StringTable is a member variable, so we don't need to pass it around. llvm-svn: 258382 --- lld/ELF/InputFiles.cpp | 7 +++---- lld/ELF/InputFiles.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 867cc497f065..b43a9b393094 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -266,7 +266,7 @@ template void ObjectFile::initializeSymbols() { uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end()); SymbolBodies.reserve(NumSymbols); for (const Elf_Sym &Sym : Syms) - SymbolBodies.push_back(createSymbolBody(this->StringTable, &Sym)); + SymbolBodies.push_back(createSymbolBody(&Sym)); } template @@ -281,9 +281,8 @@ ObjectFile::getSection(const Elf_Sym &Sym) const { } template -SymbolBody *ObjectFile::createSymbolBody(StringRef StringTable, - const Elf_Sym *Sym) { - ErrorOr NameOrErr = Sym->getName(StringTable); +SymbolBody *ObjectFile::createSymbolBody(const Elf_Sym *Sym) { + ErrorOr NameOrErr = Sym->getName(this->StringTable); error(NameOrErr); StringRef Name = *NameOrErr; diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index 45d403c0125c..f28a0ab2f722 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -134,7 +134,7 @@ private: void initializeSymbols(); InputSectionBase *createInputSection(const Elf_Shdr &Sec); - SymbolBody *createSymbolBody(StringRef StringTable, const Elf_Sym *Sym); + SymbolBody *createSymbolBody(const Elf_Sym *Sym); // List of all sections defined by this file. std::vector *> Sections;