Remove redundant argument. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 5 Apr 2016 11:47:46 +0000 (11:47 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 5 Apr 2016 11:47:46 +0000 (11:47 +0000)
llvm-svn: 265386

lld/ELF/InputFiles.cpp
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h

index fcc38f6..e58814d 100644 (file)
@@ -306,13 +306,12 @@ elf::ObjectFile<ELFT>::getSection(const Elf_Sym &Sym) const {
 
 template <class ELFT>
 SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
-  uint32_t NameOffset = Sym->st_name;
-  unsigned char Binding = Sym->getBinding();
+   unsigned char Binding = Sym->getBinding();
   InputSectionBase<ELFT> *Sec = getSection(*Sym);
   if (Binding == STB_LOCAL) {
     if (Sym->st_shndx == SHN_UNDEF)
-      return new (Alloc) UndefinedElf<ELFT>(NameOffset, *Sym);
-    return new (Alloc) DefinedRegular<ELFT>(NameOffset, *Sym, Sec);
+      return new (Alloc) UndefinedElf<ELFT>(*Sym);
+    return new (Alloc) DefinedRegular<ELFT>(*Sym, Sec);
   }
 
   StringRef Name = check(Sym->getName(this->StringTable));
index cdf9979..05402ca 100644 (file)
@@ -261,7 +261,7 @@ UndefinedElf<ELFT>::UndefinedElf(StringRef N, const Elf_Sym &Sym)
       Size(Sym.st_size) {}
 
 template <typename ELFT>
-UndefinedElf<ELFT>::UndefinedElf(uint32_t NameOffset, const Elf_Sym &Sym)
+UndefinedElf<ELFT>::UndefinedElf(const Elf_Sym &Sym)
     : Undefined(SymbolBody::UndefinedElfKind, NameOffset, Sym.st_other,
                 Sym.getType()),
       Size(Sym.st_size) {
index 5327b8c..72d7d81 100644 (file)
@@ -225,9 +225,8 @@ public:
         Value(Sym.st_value), Size(Sym.st_size),
         Section(Section ? Section->Repl : NullInputSection) {}
 
-  DefinedRegular(uint32_t NameOffset, const Elf_Sym &Sym,
-                 InputSectionBase<ELFT> *Section)
-      : Defined(SymbolBody::DefinedRegularKind, NameOffset, Sym.st_other,
+  DefinedRegular(const Elf_Sym &Sym, InputSectionBase<ELFT> *Section)
+      : Defined(SymbolBody::DefinedRegularKind, Sym.st_name, Sym.st_other,
                 Sym.getType()),
         Value(Sym.st_value), Size(Sym.st_size),
         Section(Section ? Section->Repl : NullInputSection) {
@@ -307,7 +306,7 @@ template <class ELFT> class UndefinedElf : public Undefined {
 
 public:
   UndefinedElf(StringRef N, const Elf_Sym &Sym);
-  UndefinedElf(uint32_t NameOffset, const Elf_Sym &Sym);
+  UndefinedElf(const Elf_Sym &Sym);
 
   uintX_t Size;