[lld] r256894 - Remove redundant this->.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 17:14:12 PST 2016


Author: ruiu
Date: Tue Jan  5 19:14:11 2016
New Revision: 256894

URL: http://llvm.org/viewvc/llvm-project?rev=256894&view=rev
Log:
Remove redundant this->.

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=256894&r1=256893&r2=256894&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Tue Jan  5 19:14:11 2016
@@ -62,8 +62,7 @@ template <class ELFT>
 uint32_t ELFFileBase<ELFT>::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<ELFT>::createInputSection(con
   // 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<ELFT>(this, &Sec);
+    MipsReginfo = new (Alloc) MipsReginfoInputSection<ELFT>(this, &Sec);
     return MipsReginfo;
   }
 
   if (Name == ".eh_frame")
-    return new (this->EHAlloc.Allocate()) EHInputSection<ELFT>(this, &Sec);
+    return new (EHAlloc.Allocate()) EHInputSection<ELFT>(this, &Sec);
   if (shouldMerge<ELFT>(Sec))
-    return new (this->MAlloc.Allocate()) MergeInputSection<ELFT>(this, &Sec);
-  return new (this->Alloc) InputSection<ELFT>(this, &Sec);
+    return new (MAlloc.Allocate()) MergeInputSection<ELFT>(this, &Sec);
+  return new (Alloc) InputSection<ELFT>(this, &Sec);
 }
 
 template <class ELFT> void ObjectFile<ELFT>::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 <class ELFT>
@@ -289,11 +288,11 @@ SymbolBody *ObjectFile<ELFT>::createSymb
 
   switch (Sym->st_shndx) {
   case SHN_UNDEF:
-    return new (this->Alloc) UndefinedElf<ELFT>(Name, *Sym);
+    return new (Alloc) UndefinedElf<ELFT>(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<ELFT>::createSymb
   case STB_GNU_UNIQUE: {
     InputSectionBase<ELFT> *Sec = getSection(*Sym);
     if (Sec == &InputSection<ELFT>::Discarded)
-      return new (this->Alloc) UndefinedElf<ELFT>(Name, *Sym);
-    return new (this->Alloc) DefinedRegular<ELFT>(Name, *Sym, Sec);
+      return new (Alloc) UndefinedElf<ELFT>(Name, *Sym);
+    return new (Alloc) DefinedRegular<ELFT>(Name, *Sym, Sec);
   }
   }
 }
@@ -381,7 +380,7 @@ template <class ELFT> void SharedFile<EL
   }
 
   this->initStringTable();
-  this->SoName = this->getName();
+  SoName = this->getName();
 
   if (!DynamicSec)
     return;
@@ -394,7 +393,7 @@ template <class ELFT> void SharedFile<EL
       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;
     }
   }

Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=256894&r1=256893&r2=256894&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Tue Jan  5 19:14:11 2016
@@ -101,7 +101,7 @@ public:
     return F->kind() == Base::ObjectKind;
   }
 
-  ArrayRef<SymbolBody *> getSymbols() { return this->SymbolBodies; }
+  ArrayRef<SymbolBody *> getSymbols() { return SymbolBodies; }
 
   explicit ObjectFile(MemoryBufferRef M);
   void parse(llvm::DenseSet<StringRef> &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();




More information about the llvm-commits mailing list