[lld] r297732 - [ELF] - Remove unnecessary template #5. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 04:23:34 PDT 2017


Author: grimar
Date: Tue Mar 14 06:23:33 2017
New Revision: 297732

URL: http://llvm.org/viewvc/llvm-project?rev=297732&view=rev
Log:
[ELF] - Remove unnecessary template #5. NFC.

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=297732&r1=297731&r2=297732&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Mar 14 06:23:33 2017
@@ -229,7 +229,6 @@ getComparator(SortSectionPolicy K) {
   }
 }
 
-template <class ELFT>
 static bool matchConstraints(ArrayRef<InputSectionBase *> Sections,
                              ConstraintKind Kind) {
   if (Kind == ConstraintKind::NoConstraint)
@@ -375,7 +374,7 @@ void LinkerScript<ELFT>::processCommands
       //
       // Because we'll iterate over Commands many more times, the easiest
       // way to "make it as if it wasn't present" is to just remove it.
-      if (!matchConstraints<ELFT>(V, Cmd->Constraint)) {
+      if (!matchConstraints(V, Cmd->Constraint)) {
         for (InputSectionBase *S : V)
           S->Assigned = false;
         Opt.Commands.erase(Iter);
@@ -414,14 +413,14 @@ void LinkerScript<ELFT>::addOrphanSectio
       Factory.addInputSec(S, getOutputSectionName(S->Name));
 }
 
-template <class ELFT> static bool isTbss(OutputSection *Sec) {
+static bool isTbss(OutputSection *Sec) {
   return (Sec->Flags & SHF_TLS) && Sec->Type == SHT_NOBITS;
 }
 
 template <class ELFT> void LinkerScript<ELFT>::output(InputSection *S) {
   if (!AlreadyOutputIS.insert(S).second)
     return;
-  bool IsTbss = isTbss<ELFT>(CurOutSec);
+  bool IsTbss = isTbss(CurOutSec);
 
   uint64_t Pos = IsTbss ? Dot + ThreadBssOffset : Dot;
   Pos = alignTo(Pos, S->Alignment);
@@ -469,7 +468,7 @@ template <class ELFT> void LinkerScript<
   CurOutSec = Sec;
 
   Dot = alignTo(Dot, CurOutSec->Alignment);
-  CurOutSec->Addr = isTbss<ELFT>(CurOutSec) ? Dot + ThreadBssOffset : Dot;
+  CurOutSec->Addr = isTbss(CurOutSec) ? Dot + ThreadBssOffset : Dot;
 
   // If neither AT nor AT> is specified for an allocatable section, the linker
   // will set the LMA such that the difference between VMA and LMA for the




More information about the llvm-commits mailing list