[lld] r298072 - [ELF] - Detemplate DynamicReloc class. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 05:07:44 PDT 2017


Author: grimar
Date: Fri Mar 17 07:07:44 2017
New Revision: 298072

URL: http://llvm.org/viewvc/llvm-project?rev=298072&view=rev
Log:
[ELF] - Detemplate DynamicReloc class. NFC.

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

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=298072&r1=298071&r2=298072&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Fri Mar 17 07:07:44 2017
@@ -654,7 +654,7 @@ static void scanRelocs(InputSectionBase
   if (!Config->ZText)
     IsWrite = true;
 
-  auto AddDyn = [=](const DynamicReloc<ELFT> &Reloc) {
+  auto AddDyn = [=](const DynamicReloc &Reloc) {
     In<ELFT>::RelaDyn->addReloc(Reloc);
   };
 

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=298072&r1=298071&r2=298072&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Fri Mar 17 07:07:44 2017
@@ -1197,18 +1197,17 @@ template <class ELFT> void DynamicSectio
   }
 }
 
-template <class ELFT>
-uint64_t DynamicReloc<ELFT>::getOffset() const {
+uint64_t DynamicReloc::getOffset() const {
   return InputSec->OutSec->Addr + InputSec->getOffset(OffsetInSec);
 }
 
-template <class ELFT> int64_t DynamicReloc<ELFT>::getAddend() const {
+int64_t DynamicReloc::getAddend() const {
   if (UseSymVA)
     return Sym->getVA(Addend);
   return Addend;
 }
 
-template <class ELFT> uint32_t DynamicReloc<ELFT>::getSymIndex() const {
+uint32_t DynamicReloc::getSymIndex() const {
   if (Sym && !UseSymVA)
     return Sym->DynsymIndex;
   return 0;
@@ -1223,7 +1222,7 @@ RelocationSection<ELFT>::RelocationSecti
 }
 
 template <class ELFT>
-void RelocationSection<ELFT>::addReloc(const DynamicReloc<ELFT> &Reloc) {
+void RelocationSection<ELFT>::addReloc(const DynamicReloc &Reloc) {
   if (Reloc.Type == Target->RelativeRel)
     ++NumRelativeRelocs;
   Relocs.push_back(Reloc);
@@ -1241,7 +1240,7 @@ static bool compRelocations(const RelTy
 
 template <class ELFT> void RelocationSection<ELFT>::writeTo(uint8_t *Buf) {
   uint8_t *BufBegin = Buf;
-  for (const DynamicReloc<ELFT> &Rel : Relocs) {
+  for (const DynamicReloc &Rel : Relocs) {
     auto *P = reinterpret_cast<Elf_Rela *>(Buf);
     Buf += Config->isRela() ? sizeof(Elf_Rela) : sizeof(Elf_Rel);
 

Modified: lld/trunk/ELF/SyntheticSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=298072&r1=298071&r2=298072&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.h (original)
+++ lld/trunk/ELF/SyntheticSections.h Fri Mar 17 07:07:44 2017
@@ -313,7 +313,7 @@ private:
   std::vector<StringRef> Strings;
 };
 
-template <class ELFT> class DynamicReloc {
+class DynamicReloc {
 public:
   DynamicReloc(uint32_t Type, const InputSectionBase *InputSec,
                uint64_t OffsetInSec, bool UseSymVA, SymbolBody *Sym,
@@ -388,7 +388,7 @@ template <class ELFT> class RelocationSe
 
 public:
   RelocationSection(StringRef Name, bool Sort);
-  void addReloc(const DynamicReloc<ELFT> &Reloc);
+  void addReloc(const DynamicReloc &Reloc);
   unsigned getRelocOffset();
   void finalizeContents() override;
   void writeTo(uint8_t *Buf) override;
@@ -399,7 +399,7 @@ public:
 private:
   bool Sort;
   size_t NumRelativeRelocs = 0;
-  std::vector<DynamicReloc<ELFT>> Relocs;
+  std::vector<DynamicReloc> Relocs;
 };
 
 struct SymbolTableEntry {




More information about the llvm-commits mailing list