[lld] r297943 - [ELF] - Detemplate SymbolBody::getOutputSection(). NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 04:06:13 PDT 2017


Author: grimar
Date: Thu Mar 16 06:06:13 2017
New Revision: 297943

URL: http://llvm.org/viewvc/llvm-project?rev=297943&view=rev
Log:
[ELF] - Detemplate SymbolBody::getOutputSection(). NFC.

Modified:
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/Symbols.cpp
    lld/trunk/ELF/Symbols.h
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=297943&r1=297942&r2=297943&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Mar 16 06:06:13 2017
@@ -939,7 +939,7 @@ template <class ELFT> bool LinkerScript<
 template <class ELFT>
 OutputSection *LinkerScript<ELFT>::getSymbolSection(StringRef S) {
   if (SymbolBody *Sym = Symtab<ELFT>::X->find(S))
-    return Sym->getOutputSection<ELFT>();
+    return Sym->getOutputSection();
   return CurOutSec;
 }
 

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=297943&r1=297942&r2=297943&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Thu Mar 16 06:06:13 2017
@@ -198,7 +198,7 @@ template <class ELFT> typename ELFT::uin
   return 0;
 }
 
-template <class ELFT> OutputSection *SymbolBody::getOutputSection() const {
+OutputSection *SymbolBody::getOutputSection() const {
   if (auto *S = dyn_cast<DefinedRegular>(this)) {
     if (S->Section)
       return S->Section->getOutputSection();
@@ -213,7 +213,7 @@ template <class ELFT> OutputSection *Sym
 
   if (isa<DefinedCommon>(this)) {
     if (Config->DefineCommon)
-      return In<ELFT>::Common->OutSec;
+      return InX::Common->OutSec;
     return nullptr;
   }
 
@@ -411,11 +411,6 @@ template uint32_t SymbolBody::template g
 template uint64_t SymbolBody::template getSize<ELF64LE>() const;
 template uint64_t SymbolBody::template getSize<ELF64BE>() const;
 
-template OutputSection *SymbolBody::template getOutputSection<ELF32LE>() const;
-template OutputSection *SymbolBody::template getOutputSection<ELF32BE>() const;
-template OutputSection *SymbolBody::template getOutputSection<ELF64LE>() const;
-template OutputSection *SymbolBody::template getOutputSection<ELF64BE>() const;
-
 template bool DefinedRegular::template isMipsPIC<ELF32LE>() const;
 template bool DefinedRegular::template isMipsPIC<ELF32BE>() const;
 template bool DefinedRegular::template isMipsPIC<ELF64LE>() const;

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=297943&r1=297942&r2=297943&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Thu Mar 16 06:06:13 2017
@@ -83,7 +83,7 @@ public:
   template <class ELFT> typename ELFT::uint getGotPltVA() const;
   template <class ELFT> typename ELFT::uint getPltVA() const;
   template <class ELFT> typename ELFT::uint getSize() const;
-  template <class ELFT> OutputSection *getOutputSection() const;
+  OutputSection *getOutputSection() const;
 
   // The file from which this symbol was created.
   InputFile *File = nullptr;

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=297943&r1=297942&r2=297943&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Thu Mar 16 06:06:13 2017
@@ -1389,7 +1389,7 @@ template <class ELFT> void SymbolTableSe
     ESym->st_size = Body->getSize<ELFT>();
 
     // Set a section index.
-    if (const OutputSection *OutSec = Body->getOutputSection<ELFT>())
+    if (const OutputSection *OutSec = Body->getOutputSection())
       ESym->st_shndx = OutSec->SectionIndex;
     else if (isa<DefinedRegular>(Body))
       ESym->st_shndx = SHN_ABS;




More information about the llvm-commits mailing list