[lld] r280856 - Delete dead field. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 13:37:35 PDT 2016


Author: rafael
Date: Wed Sep  7 15:37:34 2016
New Revision: 280856

URL: http://llvm.org/viewvc/llvm-project?rev=280856&view=rev
Log:
Delete dead field. NFC.

Modified:
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/ELF/InputSection.h
    lld/trunk/ELF/Relocations.cpp
    lld/trunk/ELF/Relocations.h

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=280856&r1=280855&r2=280856&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Wed Sep  7 15:37:34 2016
@@ -346,7 +346,7 @@ void InputSectionBase<ELFT>::relocate(ui
   }
 
   const unsigned Bits = sizeof(uintX_t) * 8;
-  for (const Relocation<ELFT> &Rel : Relocations) {
+  for (const Relocation &Rel : Relocations) {
     uintX_t Offset = getOffset(Rel.Offset);
     uint8_t *BufLoc = Buf + Offset;
     uint32_t Type = Rel.Type;

Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=280856&r1=280855&r2=280856&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Wed Sep  7 15:37:34 2016
@@ -102,7 +102,7 @@ public:
   void uncompress();
 
   void relocate(uint8_t *Buf, uint8_t *BufEnd);
-  std::vector<Relocation<ELFT>> Relocations;
+  std::vector<Relocation> Relocations;
 };
 
 template <class ELFT> InputSectionBase<ELFT> InputSectionBase<ELFT>::Discarded;

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=280856&r1=280855&r2=280856&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Wed Sep  7 15:37:34 2016
@@ -97,7 +97,7 @@ handleMipsTlsRelocation(uint32_t Type, S
       Out<ELFT>::RelaDyn->addReloc({Target->TlsModuleIndexRel, Out<ELFT>::Got,
                                     Out<ELFT>::Got->getTlsIndexOff(), false,
                                     nullptr, 0});
-    C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body});
+    C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
     return 1;
   }
   if (Target->isTlsGlobalDynamicRel(Type)) {
@@ -110,7 +110,7 @@ handleMipsTlsRelocation(uint32_t Type, S
                                     Off + (uintX_t)sizeof(uintX_t), false,
                                     &Body, 0});
     }
-    C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body});
+    C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
     return 1;
   }
   return 0;
@@ -141,7 +141,7 @@ static unsigned handleTlsRelocation(uint
           {Target->TlsDescRel, Out<ELFT>::Got, Off, false, &Body, 0});
     }
     if (Expr != R_HINT)
-      C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body});
+      C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
     return 1;
   }
 
@@ -149,21 +149,21 @@ static unsigned handleTlsRelocation(uint
     // Local-Dynamic relocs can be relaxed to Local-Exec.
     if (!Config->Shared) {
       C.Relocations.push_back(
-          {R_RELAX_TLS_LD_TO_LE, Type, &C, Offset, Addend, &Body});
+          {R_RELAX_TLS_LD_TO_LE, Type, Offset, Addend, &Body});
       return 2;
     }
     if (Out<ELFT>::Got->addTlsIndex())
       Out<ELFT>::RelaDyn->addReloc({Target->TlsModuleIndexRel, Out<ELFT>::Got,
                                     Out<ELFT>::Got->getTlsIndexOff(), false,
                                     nullptr, 0});
-    C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body});
+    C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
     return 1;
   }
 
   // Local-Dynamic relocs can be relaxed to Local-Exec.
   if (Target->isTlsLocalDynamicRel(Type) && !Config->Shared) {
     C.Relocations.push_back(
-        {R_RELAX_TLS_LD_TO_LE, Type, &C, Offset, Addend, &Body});
+        {R_RELAX_TLS_LD_TO_LE, Type, Offset, Addend, &Body});
     return 1;
   }
 
@@ -182,7 +182,7 @@ static unsigned handleTlsRelocation(uint
                                         Off + (uintX_t)sizeof(uintX_t), false,
                                         &Body, 0});
       }
-      C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body});
+      C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
       return 1;
     }
 
@@ -191,7 +191,7 @@ static unsigned handleTlsRelocation(uint
     if (isPreemptible(Body, Type)) {
       C.Relocations.push_back(
           {Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_IE), Type,
-           &C, Offset, Addend, &Body});
+           Offset, Addend, &Body});
       if (!Body.isInGot()) {
         Out<ELFT>::Got->addEntry(Body);
         Out<ELFT>::RelaDyn->addReloc({Target->TlsGotRel, Out<ELFT>::Got,
@@ -201,7 +201,7 @@ static unsigned handleTlsRelocation(uint
       return Target->TlsGdRelaxSkip;
     }
     C.Relocations.push_back(
-        {Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_LE), Type, &C,
+        {Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_LE), Type,
          Offset, Addend, &Body});
     return Target->TlsGdRelaxSkip;
   }
@@ -211,7 +211,7 @@ static unsigned handleTlsRelocation(uint
   if (Target->isTlsInitialExecRel(Type) && !Config->Shared &&
       !isPreemptible(Body, Type)) {
     C.Relocations.push_back(
-        {R_RELAX_TLS_IE_TO_LE, Type, &C, Offset, Addend, &Body});
+        {R_RELAX_TLS_IE_TO_LE, Type, Offset, Addend, &Body});
     return 1;
   }
   return 0;
@@ -609,7 +609,7 @@ static void scanRelocs(InputSectionBase<
       // when outputting this section. We also have to do it if the format
       // uses Elf_Rel, since in that case the written value is the addend.
       if (Constant || !RelTy::IsRela)
-        C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body});
+        C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
     } else {
       // We don't know anything about the finaly symbol. Just ask the dynamic
       // linker to handle the relocation for us.

Modified: lld/trunk/ELF/Relocations.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.h?rev=280856&r1=280855&r2=280856&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.h (original)
+++ lld/trunk/ELF/Relocations.h Wed Sep  7 15:37:34 2016
@@ -15,6 +15,7 @@
 namespace lld {
 namespace elf {
 class SymbolBody;
+class InputSectionData;
 template <class ELFT> class InputSection;
 template <class ELFT> class InputSectionBase;
 
@@ -66,10 +67,9 @@ enum RelExpr {
   R_TLSLD_PC
 };
 
-template <class ELFT> struct Relocation {
+struct Relocation {
   RelExpr Expr;
   uint32_t Type;
-  InputSectionBase<ELFT> *InputSec;
   uint64_t Offset;
   uint64_t Addend;
   SymbolBody *Sym;




More information about the llvm-commits mailing list