From 76a7ecb3aeb4ed43ee146dd532f322bbff2adb8f Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 15 Mar 2019 06:58:23 +0000 Subject: [PATCH] [ELF] De-template wrapSymbols, isReserved and addGotEntry. NFC llvm-svn: 356237 --- lld/ELF/Driver.cpp | 4 ++-- lld/ELF/MarkLive.cpp | 4 ++-- lld/ELF/Relocations.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index f3abd3f..6b1fc8e 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1424,7 +1424,7 @@ static std::vector addWrappedSymbols(opt::InputArgList &Args) { // 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 static void wrapSymbols(ArrayRef Wrapped) { +static void wrapSymbols(ArrayRef Wrapped) { DenseMap Map; for (const WrappedSymbol &W : Wrapped) { Map[W.Sym] = W.Wrap; @@ -1600,7 +1600,7 @@ template void LinkerDriver::link(opt::InputArgList &Args) { // Apply symbol renames for -wrap. if (!Wrapped.empty()) - wrapSymbols(Wrapped); + wrapSymbols(Wrapped); // Now that we have a complete list of input files. // Beyond this point, no new files are added. diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index e603203..c8a7b94 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -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 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 static void doGcSections() { if (Sec->Flags & SHF_LINK_ORDER) continue; - if (isReserved(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); diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 569b985..cc8b6e7 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -792,7 +792,7 @@ static void addPltEntry(PltSection *Plt, GotPltSection *GotPlt, {Type, GotPlt, Sym.getGotPltOffset(), !Sym.IsPreemptible, &Sym, 0}); } -template 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 &Sec, OffsetGetter &GetOffset, RelTy *&I, // 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(Sym); + addGotEntry(Sym); } } } else { @@ -1211,7 +1211,7 @@ static void scanReloc(InputSectionBase &Sec, OffsetGetter &GetOffset, RelTy *&I, // We don't need to worry about creating a MIPS GOT here because ifuncs // aren't a thing on MIPS. Sym.GotInIgot = false; - addGotEntry(Sym); + addGotEntry(Sym); } } } -- 2.7.4