[lld] r258382 - Simplify function signature. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 18:10:12 PST 2016


Author: ruiu
Date: Wed Jan 20 20:10:12 2016
New Revision: 258382

URL: http://llvm.org/viewvc/llvm-project?rev=258382&view=rev
Log:
Simplify function signature. NFC.

StringTable is a member variable, so we don't need to pass it around.

Modified:
    lld/trunk/ELF/InputFiles.cpp
    lld/trunk/ELF/InputFiles.h

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=258382&r1=258381&r2=258382&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Jan 20 20:10:12 2016
@@ -266,7 +266,7 @@ template <class ELFT> void ObjectFile<EL
   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 <class ELFT>
@@ -281,9 +281,8 @@ ObjectFile<ELFT>::getSection(const Elf_S
 }
 
 template <class ELFT>
-SymbolBody *ObjectFile<ELFT>::createSymbolBody(StringRef StringTable,
-                                               const Elf_Sym *Sym) {
-  ErrorOr<StringRef> NameOrErr = Sym->getName(StringTable);
+SymbolBody *ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
+  ErrorOr<StringRef> NameOrErr = Sym->getName(this->StringTable);
   error(NameOrErr);
   StringRef Name = *NameOrErr;
 

Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=258382&r1=258381&r2=258382&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Wed Jan 20 20:10:12 2016
@@ -134,7 +134,7 @@ private:
   void initializeSymbols();
   InputSectionBase<ELFT> *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<InputSectionBase<ELFT> *> Sections;




More information about the llvm-commits mailing list