diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 660c799463be..1369446d0dd1 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -62,8 +62,7 @@ template uint32_t ELFFileBase::getSectionIndex(const Elf_Sym &Sym) const { uint32_t I = Sym.st_shndx; if (I == ELF::SHN_XINDEX) - return this->ELFObj.getExtendedSymbolTableIndex(&Sym, this->Symtab, - SymtabSHNDX); + return ELFObj.getExtendedSymbolTableIndex(&Sym, Symtab, SymtabSHNDX); if (I >= ELF::SHN_LORESERVE || I == ELF::SHN_ABS) return 0; return I; @@ -249,24 +248,24 @@ ObjectFile::createInputSection(const Elf_Shdr &Sec) { // A MIPS object file has a special section that contains register // usage info, which needs to be handled by the linker specially. if (Config->EMachine == EM_MIPS && Name == ".reginfo") { - MipsReginfo = new (this->Alloc) MipsReginfoInputSection(this, &Sec); + MipsReginfo = new (Alloc) MipsReginfoInputSection(this, &Sec); return MipsReginfo; } if (Name == ".eh_frame") - return new (this->EHAlloc.Allocate()) EHInputSection(this, &Sec); + return new (EHAlloc.Allocate()) EHInputSection(this, &Sec); if (shouldMerge(Sec)) - return new (this->MAlloc.Allocate()) MergeInputSection(this, &Sec); - return new (this->Alloc) InputSection(this, &Sec); + return new (MAlloc.Allocate()) MergeInputSection(this, &Sec); + return new (Alloc) InputSection(this, &Sec); } template void ObjectFile::initializeSymbols() { this->initStringTable(); Elf_Sym_Range Syms = this->getNonLocalSymbols(); uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end()); - this->SymbolBodies.reserve(NumSymbols); + SymbolBodies.reserve(NumSymbols); for (const Elf_Sym &Sym : Syms) - this->SymbolBodies.push_back(createSymbolBody(this->StringTable, &Sym)); + SymbolBodies.push_back(createSymbolBody(this->StringTable, &Sym)); } template @@ -289,11 +288,11 @@ SymbolBody *ObjectFile::createSymbolBody(StringRef StringTable, switch (Sym->st_shndx) { case SHN_UNDEF: - return new (this->Alloc) UndefinedElf(Name, *Sym); + return new (Alloc) UndefinedElf(Name, *Sym); case SHN_COMMON: - return new (this->Alloc) DefinedCommon( - Name, Sym->st_size, Sym->st_value, - Sym->getBinding() == llvm::ELF::STB_WEAK, Sym->getVisibility()); + return new (Alloc) DefinedCommon(Name, Sym->st_size, Sym->st_value, + Sym->getBinding() == llvm::ELF::STB_WEAK, + Sym->getVisibility()); } switch (Sym->getBinding()) { @@ -304,8 +303,8 @@ SymbolBody *ObjectFile::createSymbolBody(StringRef StringTable, case STB_GNU_UNIQUE: { InputSectionBase *Sec = getSection(*Sym); if (Sec == &InputSection::Discarded) - return new (this->Alloc) UndefinedElf(Name, *Sym); - return new (this->Alloc) DefinedRegular(Name, *Sym, Sec); + return new (Alloc) UndefinedElf(Name, *Sym); + return new (Alloc) DefinedRegular(Name, *Sym, Sec); } } } @@ -381,7 +380,7 @@ template void SharedFile::parseSoName() { } this->initStringTable(); - this->SoName = this->getName(); + SoName = this->getName(); if (!DynamicSec) return; @@ -394,7 +393,7 @@ template void SharedFile::parseSoName() { uintX_t Val = Dyn.getVal(); if (Val >= this->StringTable.size()) error("Invalid DT_SONAME entry"); - this->SoName = StringRef(this->StringTable.data() + Val); + SoName = StringRef(this->StringTable.data() + Val); return; } } diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index 78719995adef..c15711a56ca5 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -101,7 +101,7 @@ public: return F->kind() == Base::ObjectKind; } - ArrayRef getSymbols() { return this->SymbolBodies; } + ArrayRef getSymbols() { return SymbolBodies; } explicit ObjectFile(MemoryBufferRef M); void parse(llvm::DenseSet &Comdats); @@ -113,7 +113,7 @@ public: uint32_t FirstNonLocal = this->Symtab->sh_info; if (SymbolIndex < FirstNonLocal) return nullptr; - return this->SymbolBodies[SymbolIndex - FirstNonLocal]; + return SymbolBodies[SymbolIndex - FirstNonLocal]; } Elf_Sym_Range getLocalSymbols();