[lld] r298353 - [ELF] - Detemplate InputSection::getRelocatedSection(). NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 02:13:27 PDT 2017


Author: grimar
Date: Tue Mar 21 04:13:27 2017
New Revision: 298353

URL: http://llvm.org/viewvc/llvm-project?rev=298353&view=rev
Log:
[ELF] - Detemplate InputSection::getRelocatedSection(). NFC.

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

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=298353&r1=298352&r2=298353&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Tue Mar 21 04:13:27 2017
@@ -219,9 +219,9 @@ bool InputSectionBase::classof(const Sec
   return S->kind() != Output;
 }
 
-template <class ELFT> InputSectionBase *InputSection::getRelocatedSection() {
+InputSectionBase *InputSection::getRelocatedSection() {
   assert(this->Type == SHT_RELA || this->Type == SHT_REL);
-  ArrayRef<InputSectionBase *> Sections = this->getFile<ELFT>()->getSections();
+  ArrayRef<InputSectionBase *> Sections = this->File->getSections();
   return Sections[this->Info];
 }
 
@@ -230,7 +230,7 @@ template <class ELFT> InputSectionBase *
 // for each relocation. So we copy relocations one by one.
 template <class ELFT, class RelTy>
 void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) {
-  InputSectionBase *RelocatedSection = getRelocatedSection<ELFT>();
+  InputSectionBase *RelocatedSection = getRelocatedSection();
 
   // Loop is slow and have complexity O(N*M), where N - amount of
   // relocations and M - amount of symbols in symbol table.
@@ -823,11 +823,6 @@ template void InputSection::writeTo<ELF3
 template void InputSection::writeTo<ELF64LE>(uint8_t *Buf);
 template void InputSection::writeTo<ELF64BE>(uint8_t *Buf);
 
-template InputSectionBase *InputSection::getRelocatedSection<ELF32LE>();
-template InputSectionBase *InputSection::getRelocatedSection<ELF32BE>();
-template InputSectionBase *InputSection::getRelocatedSection<ELF64LE>();
-template InputSectionBase *InputSection::getRelocatedSection<ELF64BE>();
-
 template elf::ObjectFile<ELF32LE> *InputSectionBase::getFile<ELF32LE>() const;
 template elf::ObjectFile<ELF32BE> *InputSectionBase::getFile<ELF32BE>() const;
 template elf::ObjectFile<ELF64LE> *InputSectionBase::getFile<ELF64LE>() const;

Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=298353&r1=298352&r2=298353&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Tue Mar 21 04:13:27 2017
@@ -300,7 +300,7 @@ public:
 
   static bool classof(const SectionBase *S);
 
-  template <class ELFT> InputSectionBase *getRelocatedSection();
+  InputSectionBase *getRelocatedSection();
 
   template <class ELFT, class RelTy>
   void relocateNonAlloc(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels);

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=298353&r1=298352&r2=298353&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Mar 21 04:13:27 2017
@@ -107,7 +107,7 @@ template <class ELFT> void OutputSection
   this->Link = In<ELFT>::SymTab->OutSec->SectionIndex;
   // sh_info for SHT_REL[A] sections should contain the section header index of
   // the section to which the relocation applies.
-  InputSectionBase *S = First->getRelocatedSection<ELFT>();
+  InputSectionBase *S = First->getRelocatedSection();
   this->Info = S->OutSec->SectionIndex;
 }
 




More information about the llvm-commits mailing list