[lld] r297937 - [ELF] - Detemplate OutputSection::assignOffsets. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 03:24:55 PDT 2017


Author: grimar
Date: Thu Mar 16 05:24:54 2017
New Revision: 297937

URL: http://llvm.org/viewvc/llvm-project?rev=297937&view=rev
Log:
[ELF] - Detemplate OutputSection::assignOffsets. NFC.

Modified:
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/OutputSections.h
    lld/trunk/ELF/Relocations.cpp
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=297937&r1=297936&r2=297937&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Thu Mar 16 05:24:54 2017
@@ -89,7 +89,7 @@ static bool compareByFilePosition(InputS
 template <class ELFT> void OutputSection::finalize() {
   if ((this->Flags & SHF_LINK_ORDER) && !this->Sections.empty()) {
     std::sort(Sections.begin(), Sections.end(), compareByFilePosition<ELFT>);
-    assignOffsets<ELFT>();
+    assignOffsets();
 
     // We must preserve the link order dependency of sections with the
     // SHF_LINK_ORDER flag. The dependency is indicated by the sh_link field. We
@@ -133,7 +133,7 @@ void OutputSection::addSection(InputSect
 
 // This function is called after we sort input sections
 // and scan relocations to setup sections' offsets.
-template <class ELFT> void OutputSection::assignOffsets() {
+void OutputSection::assignOffsets() {
   uint64_t Off = 0;
   for (InputSection *S : Sections) {
     Off = alignTo(Off, S->Alignment);
@@ -398,11 +398,6 @@ template void OutputSection::writeHeader
 template void OutputSection::writeHeaderTo<ELF64LE>(ELF64LE::Shdr *Shdr);
 template void OutputSection::writeHeaderTo<ELF64BE>(ELF64BE::Shdr *Shdr);
 
-template void OutputSection::assignOffsets<ELF32LE>();
-template void OutputSection::assignOffsets<ELF32BE>();
-template void OutputSection::assignOffsets<ELF64LE>();
-template void OutputSection::assignOffsets<ELF64BE>();
-
 template void OutputSection::finalize<ELF32LE>();
 template void OutputSection::finalize<ELF32BE>();
 template void OutputSection::finalize<ELF64LE>();

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=297937&r1=297936&r2=297937&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Thu Mar 16 05:24:54 2017
@@ -83,7 +83,7 @@ public:
   void sortCtorsDtors();
   template <class ELFT> void writeTo(uint8_t *Buf);
   template <class ELFT> void finalize();
-  template <class ELFT> void assignOffsets();
+  void assignOffsets();
   std::vector<InputSection *> Sections;
 
   // Location in the output buffer.

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=297937&r1=297936&r2=297937&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Thu Mar 16 05:24:54 2017
@@ -888,7 +888,7 @@ static void mergeThunks(OutputSection *O
   std::merge(OS->Sections.begin(), OS->Sections.end(), Thunks.begin(),
              Thunks.end(), std::back_inserter(Tmp), MergeCmp);
   OS->Sections = std::move(Tmp);
-  OS->assignOffsets<ELFT>();
+  OS->assignOffsets();
 }
 
 // Process all relocations from the InputSections that have been assigned

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=297937&r1=297936&r2=297937&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Mar 16 05:24:54 2017
@@ -945,7 +945,7 @@ template <class ELFT> void Writer<ELFT>:
   sortCtorsDtors<ELFT>(findSection(".dtors"));
 
   for (OutputSection *Sec : OutputSections)
-    Sec->assignOffsets<ELFT>();
+    Sec->assignOffsets();
 }
 
 template <class ELFT>
@@ -1045,7 +1045,7 @@ static void applySynthetic(const std::ve
   for (SyntheticSection *SS : Sections)
     if (SS && SS->OutSec && !SS->empty()) {
       Fn(SS);
-      SS->OutSec->template assignOffsets<ELFT>();
+      SS->OutSec->assignOffsets();
     }
 }
 
@@ -1207,7 +1207,7 @@ template <class ELFT> void Writer<ELFT>:
   // Add BSS sections.
   auto Add = [=](OutputSection *Sec) {
     if (!Sec->Sections.empty()) {
-      Sec->assignOffsets<ELFT>();
+      Sec->assignOffsets();
       OutputSections.push_back(Sec);
     }
   };




More information about the llvm-commits mailing list