[lld] r303155 - [ELF] - Detemplate elf::addSyntheticLocal(). NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 03:11:37 PDT 2017


Author: grimar
Date: Tue May 16 05:11:36 2017
New Revision: 303155

URL: http://llvm.org/viewvc/llvm-project?rev=303155&view=rev
Log:
[ELF] - Detemplate elf::addSyntheticLocal(). NFC.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp
    lld/trunk/ELF/SyntheticSections.h
    lld/trunk/ELF/Target.cpp
    lld/trunk/ELF/Thunks.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=303155&r1=303154&r2=303155&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Tue May 16 05:11:36 2017
@@ -293,7 +293,6 @@ InputSection *elf::createInterpSection()
   return Sec;
 }
 
-template <class ELFT>
 SymbolBody *elf::addSyntheticLocal(StringRef Name, uint8_t Type, uint64_t Value,
                                    uint64_t Size, InputSectionBase *Section) {
   auto *S = make<DefinedRegular>(Name, /*IsLocal*/ true, STV_DEFAULT, Type,
@@ -2270,19 +2269,6 @@ template MergeInputSection *elf::createC
 template MergeInputSection *elf::createCommentSection<ELF64LE>();
 template MergeInputSection *elf::createCommentSection<ELF64BE>();
 
-template SymbolBody *elf::addSyntheticLocal<ELF32LE>(StringRef, uint8_t,
-                                                     uint64_t, uint64_t,
-                                                     InputSectionBase *);
-template SymbolBody *elf::addSyntheticLocal<ELF32BE>(StringRef, uint8_t,
-                                                     uint64_t, uint64_t,
-                                                     InputSectionBase *);
-template SymbolBody *elf::addSyntheticLocal<ELF64LE>(StringRef, uint8_t,
-                                                     uint64_t, uint64_t,
-                                                     InputSectionBase *);
-template SymbolBody *elf::addSyntheticLocal<ELF64BE>(StringRef, uint8_t,
-                                                     uint64_t, uint64_t,
-                                                     InputSectionBase *);
-
 template class elf::MipsAbiFlagsSection<ELF32LE>;
 template class elf::MipsAbiFlagsSection<ELF32BE>;
 template class elf::MipsAbiFlagsSection<ELF64LE>;

Modified: lld/trunk/ELF/SyntheticSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=303155&r1=303154&r2=303155&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.h (original)
+++ lld/trunk/ELF/SyntheticSections.h Tue May 16 05:11:36 2017
@@ -747,7 +747,7 @@ private:
 template <class ELFT> InputSection *createCommonSection();
 InputSection *createInterpSection();
 template <class ELFT> MergeInputSection *createCommentSection();
-template <class ELFT>
+
 SymbolBody *addSyntheticLocal(StringRef Name, uint8_t Type, uint64_t Value,
                               uint64_t Size, InputSectionBase *Section);
 

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=303155&r1=303154&r2=303155&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Tue May 16 05:11:36 2017
@@ -1762,8 +1762,8 @@ void ARMTargetInfo::writePltHeader(uint8
 
 void ARMTargetInfo::addPltHeaderSymbols(InputSectionBase *ISD) const {
   auto *IS = cast<InputSection>(ISD);
-  addSyntheticLocal<ELF32LE>("$a", STT_NOTYPE, 0, 0, IS);
-  addSyntheticLocal<ELF32LE>("$d", STT_NOTYPE, 16, 0, IS);
+  addSyntheticLocal("$a", STT_NOTYPE, 0, 0, IS);
+  addSyntheticLocal("$d", STT_NOTYPE, 16, 0, IS);
 }
 
 void ARMTargetInfo::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr,
@@ -1785,8 +1785,8 @@ void ARMTargetInfo::writePlt(uint8_t *Bu
 
 void ARMTargetInfo::addPltSymbols(InputSectionBase *ISD, uint64_t Off) const {
   auto *IS = cast<InputSection>(ISD);
-  addSyntheticLocal<ELF32LE>("$a", STT_NOTYPE, Off, 0, IS);
-  addSyntheticLocal<ELF32LE>("$d", STT_NOTYPE, Off + 12, 0, IS);
+  addSyntheticLocal("$a", STT_NOTYPE, Off, 0, IS);
+  addSyntheticLocal("$d", STT_NOTYPE, Off + 12, 0, IS);
 }
 
 bool ARMTargetInfo::needsThunk(RelExpr Expr, uint32_t RelocType,

Modified: lld/trunk/ELF/Thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Thunks.cpp?rev=303155&r1=303154&r2=303155&view=diff
==============================================================================
--- lld/trunk/ELF/Thunks.cpp (original)
+++ lld/trunk/ELF/Thunks.cpp Tue May 16 05:11:36 2017
@@ -124,10 +124,10 @@ void ARMV7ABSLongThunk<ELFT>::writeTo(ui
 
 template <class ELFT>
 void ARMV7ABSLongThunk<ELFT>::addSymbols(ThunkSection &IS) {
-  this->ThunkSym = addSyntheticLocal<ELFT>(
+  this->ThunkSym = addSyntheticLocal(
       Saver.save("__ARMv7ABSLongThunk_" + this->Destination.getName()),
       STT_FUNC, this->Offset, size(), &IS);
-  addSyntheticLocal<ELFT>("$a", STT_NOTYPE, this->Offset, 0, &IS);
+  addSyntheticLocal("$a", STT_NOTYPE, this->Offset, 0, &IS);
 }
 
 template <class ELFT>
@@ -145,10 +145,10 @@ void ThumbV7ABSLongThunk<ELFT>::writeTo(
 
 template <class ELFT>
 void ThumbV7ABSLongThunk<ELFT>::addSymbols(ThunkSection &IS) {
-  this->ThunkSym = addSyntheticLocal<ELFT>(
+  this->ThunkSym = addSyntheticLocal(
       Saver.save("__Thumbv7ABSLongThunk_" + this->Destination.getName()),
       STT_FUNC, this->Offset, size(), &IS);
-  addSyntheticLocal<ELFT>("$t", STT_NOTYPE, this->Offset, 0, &IS);
+  addSyntheticLocal("$t", STT_NOTYPE, this->Offset, 0, &IS);
 }
 
 template <class ELFT>
@@ -168,10 +168,10 @@ void ARMV7PILongThunk<ELFT>::writeTo(uin
 
 template <class ELFT>
 void ARMV7PILongThunk<ELFT>::addSymbols(ThunkSection &IS) {
-  this->ThunkSym = addSyntheticLocal<ELFT>(
+  this->ThunkSym = addSyntheticLocal(
       Saver.save("__ARMV7PILongThunk_" + this->Destination.getName()), STT_FUNC,
       this->Offset, size(), &IS);
-  addSyntheticLocal<ELFT>("$a", STT_NOTYPE, this->Offset, 0, &IS);
+  addSyntheticLocal("$a", STT_NOTYPE, this->Offset, 0, &IS);
 }
 
 template <class ELFT>
@@ -191,10 +191,10 @@ void ThumbV7PILongThunk<ELFT>::writeTo(u
 
 template <class ELFT>
 void ThumbV7PILongThunk<ELFT>::addSymbols(ThunkSection &IS) {
-  this->ThunkSym = addSyntheticLocal<ELFT>(
+  this->ThunkSym = addSyntheticLocal(
       Saver.save("__ThumbV7PILongThunk_" + this->Destination.getName()),
       STT_FUNC, this->Offset, size(), &IS);
-  addSyntheticLocal<ELFT>("$t", STT_NOTYPE, this->Offset, 0, &IS);
+  addSyntheticLocal("$t", STT_NOTYPE, this->Offset, 0, &IS);
 }
 
 // Write MIPS LA25 thunk code to call PIC function from the non-PIC one.
@@ -212,7 +212,7 @@ void MipsThunk<ELFT>::writeTo(uint8_t *B
 }
 
 template <class ELFT> void MipsThunk<ELFT>::addSymbols(ThunkSection &IS) {
-  this->ThunkSym = addSyntheticLocal<ELFT>(
+  this->ThunkSym = addSyntheticLocal(
       Saver.save("__LA25Thunk_" + this->Destination.getName()), STT_FUNC,
       this->Offset, size(), &IS);
 }




More information about the llvm-commits mailing list