[lld] r302848 - Detemplate compareSectionsNonScript. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 16:33:19 PDT 2017


Author: rafael
Date: Thu May 11 18:33:19 2017
New Revision: 302848

URL: http://llvm.org/viewvc/llvm-project?rev=302848&view=rev
Log:
Detemplate compareSectionsNonScript. NFC.

Modified:
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=302848&r1=302847&r2=302848&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu May 11 18:33:19 2017
@@ -645,7 +645,6 @@ bool elf::isRelroSection(const OutputSec
          S == ".eh_frame" || S == ".openbsd.randomdata";
 }
 
-template <class ELFT>
 static bool compareSectionsNonScript(const OutputSection *A,
                                      const OutputSection *B) {
   // Put .interp first because some loaders want to see that section
@@ -1001,9 +1000,8 @@ findOrphanPos(std::vector<OutputSection
   }
 
   // Find the fist position that Sec compares less to.
-  return std::find_if(B, E, [=](OutputSection *S) {
-    return compareSectionsNonScript<ELFT>(Sec, S);
-  });
+  return std::find_if(
+      B, E, [=](OutputSection *S) { return compareSectionsNonScript(Sec, S); });
 }
 
 template <class ELFT> void Writer<ELFT>::sortSections() {
@@ -1013,7 +1011,7 @@ template <class ELFT> void Writer<ELFT>:
     return;
   if (!Script->Opt.HasSections) {
     std::stable_sort(OutputSections.begin(), OutputSections.end(),
-                     compareSectionsNonScript<ELFT>);
+                     compareSectionsNonScript);
     return;
   }
   Script->adjustSectionsBeforeSorting();




More information about the llvm-commits mailing list