[lld] r356237 - [ELF] De-template wrapSymbols, isReserved and addGotEntry. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 23:58:24 PDT 2019


Author: maskray
Date: Thu Mar 14 23:58:23 2019
New Revision: 356237

URL: http://llvm.org/viewvc/llvm-project?rev=356237&view=rev
Log:
[ELF] De-template wrapSymbols, isReserved and addGotEntry. NFC

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/MarkLive.cpp
    lld/trunk/ELF/Relocations.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=356237&r1=356236&r2=356237&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Mar 14 23:58:23 2019
@@ -1424,7 +1424,7 @@ static std::vector<WrappedSymbol> addWra
 // When this function is executed, only InputFiles and symbol table
 // contain pointers to symbol objects. We visit them to replace pointers,
 // so that wrapped symbols are swapped as instructed by the command line.
-template <class ELFT> static void wrapSymbols(ArrayRef<WrappedSymbol> Wrapped) {
+static void wrapSymbols(ArrayRef<WrappedSymbol> Wrapped) {
   DenseMap<Symbol *, Symbol *> Map;
   for (const WrappedSymbol &W : Wrapped) {
     Map[W.Sym] = W.Wrap;
@@ -1600,7 +1600,7 @@ template <class ELFT> void LinkerDriver:
 
   // Apply symbol renames for -wrap.
   if (!Wrapped.empty())
-    wrapSymbols<ELFT>(Wrapped);
+    wrapSymbols(Wrapped);
 
   // Now that we have a complete list of input files.
   // Beyond this point, no new files are added.

Modified: lld/trunk/ELF/MarkLive.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=356237&r1=356236&r2=356237&view=diff
==============================================================================
--- lld/trunk/ELF/MarkLive.cpp (original)
+++ lld/trunk/ELF/MarkLive.cpp Thu Mar 14 23:58:23 2019
@@ -168,7 +168,7 @@ scanEhFrameSection(EhInputSection &EH,
 // Some sections are used directly by the loader, so they should never be
 // garbage-collected. This function returns true if a given section is such
 // section.
-template <class ELFT> static bool isReserved(InputSectionBase *Sec) {
+static bool isReserved(InputSectionBase *Sec) {
   switch (Sec->Type) {
   case SHT_FINI_ARRAY:
   case SHT_INIT_ARRAY:
@@ -250,7 +250,7 @@ template <class ELFT> static void doGcSe
     if (Sec->Flags & SHF_LINK_ORDER)
       continue;
 
-    if (isReserved<ELFT>(Sec) || Script->shouldKeep(Sec)) {
+    if (isReserved(Sec) || Script->shouldKeep(Sec)) {
       Enqueue(Sec, 0);
     } else if (isValidCIdentifier(Sec->Name)) {
       CNamedSections[Saver.save("__start_" + Sec->Name)].push_back(Sec);

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=356237&r1=356236&r2=356237&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Thu Mar 14 23:58:23 2019
@@ -792,7 +792,7 @@ static void addPltEntry(PltSection *Plt,
       {Type, GotPlt, Sym.getGotPltOffset(), !Sym.IsPreemptible, &Sym, 0});
 }
 
-template <class ELFT> static void addGotEntry(Symbol &Sym) {
+static void addGotEntry(Symbol &Sym) {
   In.Got->addEntry(Sym);
 
   RelExpr Expr = Sym.isTls() ? R_TLS : R_ABS;
@@ -1102,7 +1102,7 @@ static void scanReloc(InputSectionBase &
         // ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
         In.MipsGot->addEntry(*Sec.File, Sym, Addend, Expr);
       } else if (!Sym.isInGot()) {
-        addGotEntry<ELFT>(Sym);
+        addGotEntry(Sym);
       }
     }
   } else {
@@ -1211,7 +1211,7 @@ static void scanReloc(InputSectionBase &
         // We don't need to worry about creating a MIPS GOT here because ifuncs
         // aren't a thing on MIPS.
         Sym.GotInIgot = false;
-        addGotEntry<ELFT>(Sym);
+        addGotEntry(Sym);
       }
     }
   }




More information about the llvm-commits mailing list