[lld] r255857 - ELF: Remove accessors that don't hide anything.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 16:12:05 PST 2015


Author: ruiu
Date: Wed Dec 16 18:12:04 2015
New Revision: 255857

URL: http://llvm.org/viewvc/llvm-project?rev=255857&view=rev
Log:
ELF: Remove accessors that don't hide anything.

Modified:
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/Symbols.h

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=255857&r1=255856&r2=255857&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed Dec 16 18:12:04 2015
@@ -221,16 +221,16 @@ bool RelocationSection<ELFT>::applyTlsDy
     return false;
 
   if (Target->isTlsOptimized(Type, Body)) {
-    P->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
+    P->setSymbolAndType(Body->DynamicSymbolTableIndex,
                         Target->getTlsGotReloc(), Config->Mips64EL);
     P->r_offset = Out<ELFT>::Got->getEntryAddr(*Body);
     return true;
   }
 
-  P->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
+  P->setSymbolAndType(Body->DynamicSymbolTableIndex,
                       Target->getTlsModuleIndexReloc(), Config->Mips64EL);
   P->r_offset = Out<ELFT>::Got->getGlobalDynAddr(*Body);
-  N->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
+  N->setSymbolAndType(Body->DynamicSymbolTableIndex,
                       Target->getTlsOffsetReloc(), Config->Mips64EL);
   N->r_offset = Out<ELFT>::Got->getGlobalDynAddr(*Body) + sizeof(uintX_t);
   return true;
@@ -264,7 +264,7 @@ template <class ELFT> void RelocationSec
     bool LazyReloc = Body && Target->supportsLazyRelocations() &&
                      Target->relocNeedsPlt(Type, *Body);
 
-    unsigned Sym = CanBePreempted ? Body->getDynamicSymbolTableIndex() : 0;
+    unsigned Sym = CanBePreempted ? Body->DynamicSymbolTableIndex : 0;
     unsigned Reloc;
     if (!CanBePreempted)
       Reloc = Target->getRelativeReloc();
@@ -383,7 +383,7 @@ template <class ELFT> void HashTableSect
 
   for (SymbolBody *Body : Out<ELFT>::DynSymTab->getSymbols()) {
     StringRef Name = Body->getName();
-    unsigned I = Body->getDynamicSymbolTableIndex();
+    unsigned I = Body->DynamicSymbolTableIndex;
     uint32_t Hash = hashSysv(Name) % NumSymbols;
     Chains[I] = Buckets[Hash];
     Buckets[Hash] = I;
@@ -496,7 +496,7 @@ void GnuHashTableSection<ELFT>::writeHas
     int Bucket = Item.Hash % NBuckets;
     assert(PrevBucket <= Bucket);
     if (Bucket != PrevBucket) {
-      Buckets[Bucket] = Item.Body->getDynamicSymbolTableIndex();
+      Buckets[Bucket] = Item.Body->DynamicSymbolTableIndex;
       PrevBucket = Bucket;
       if (I > 0)
         Values[I - 1] |= 1;
@@ -743,7 +743,7 @@ template <class ELFT> void DynamicSectio
     WriteVal(DT_MIPS_SYMTABNO, Out<ELFT>::DynSymTab->getNumSymbols());
     WriteVal(DT_MIPS_LOCAL_GOTNO, Out<ELFT>::Got->getMipsLocalEntriesNum());
     if (const SymbolBody *B = Out<ELFT>::Got->getMipsFirstGlobalEntry())
-      WriteVal(DT_MIPS_GOTSYM, B->getDynamicSymbolTableIndex());
+      WriteVal(DT_MIPS_GOTSYM, B->DynamicSymbolTableIndex);
     else
       WriteVal(DT_MIPS_GOTSYM, Out<ELFT>::DynSymTab->getNumSymbols());
     WritePtr(DT_PLTGOT, Out<ELFT>::Got->getVA());
@@ -1237,7 +1237,7 @@ template <class ELFT> void SymbolTableSe
     std::stable_sort(Symbols.begin(), Symbols.end(), sortMipsSymbols);
   size_t I = 0;
   for (SymbolBody *B : Symbols)
-    B->setDynamicSymbolTableIndex(++I);
+    B->DynamicSymbolTableIndex = ++I;
 }
 
 template <class ELFT>

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=255857&r1=255856&r2=255857&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Wed Dec 16 18:12:04 2015
@@ -84,11 +84,7 @@ public:
 
   uint8_t getVisibility() const { return Visibility; }
 
-  unsigned getDynamicSymbolTableIndex() const {
-    return DynamicSymbolTableIndex;
-  }
-  void setDynamicSymbolTableIndex(unsigned V) { DynamicSymbolTableIndex = V; }
-
+  unsigned DynamicSymbolTableIndex = 0;
   uint32_t GlobalDynIndex = -1;
   uint32_t GotIndex = -1;
   uint32_t GotPltIndex = -1;
@@ -127,7 +123,6 @@ protected:
   unsigned IsUsedInRegularObj : 1;
   unsigned IsUsedInDynamicReloc : 1;
   unsigned IsTls : 1;
-  unsigned DynamicSymbolTableIndex = 0;
   StringRef Name;
   Symbol *Backref = nullptr;
 };




More information about the llvm-commits mailing list