[lld] r297293 - Remove unnecessary template.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 08:08:37 PST 2017


Author: rafael
Date: Wed Mar  8 10:08:36 2017
New Revision: 297293

URL: http://llvm.org/viewvc/llvm-project?rev=297293&view=rev
Log:
Remove unnecessary template.

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

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=297293&r1=297292&r2=297293&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Wed Mar  8 10:08:36 2017
@@ -122,7 +122,6 @@ uint64_t InputSectionBase::getOffset(uin
   llvm_unreachable("invalid section kind");
 }
 
-template <class ELFT>
 OutputSection *InputSectionBase::getOutputSection() const {
   if (auto *MS = dyn_cast<MergeInputSection>(this))
     return MS->MergeSec ? MS->MergeSec->OutSec : nullptr;
@@ -503,7 +502,7 @@ void InputSectionBase::relocate(uint8_t
     uint8_t *BufLoc = Buf + Offset;
     uint32_t Type = Rel.Type;
 
-    uintX_t AddrLoc = getOutputSection<ELFT>()->Addr + Offset;
+    uintX_t AddrLoc = getOutputSection()->Addr + Offset;
     RelExpr Expr = Rel.Expr;
     uint64_t TargetVA = SignExtend64<Bits>(
         getRelocTargetVA<ELFT>(Type, Rel.Addend, AddrLoc, *Rel.Sym, Expr));
@@ -810,11 +809,6 @@ template InputSectionBase *InputSectionB
 template InputSectionBase *InputSectionBase::getLinkOrderDep<ELF64LE>() const;
 template InputSectionBase *InputSectionBase::getLinkOrderDep<ELF64BE>() const;
 
-template OutputSection *InputSectionBase::getOutputSection<ELF32LE>() const;
-template OutputSection *InputSectionBase::getOutputSection<ELF32BE>() const;
-template OutputSection *InputSectionBase::getOutputSection<ELF64LE>() const;
-template OutputSection *InputSectionBase::getOutputSection<ELF64BE>() const;
-
 template InputSectionBase *InputSection::getRelocatedSection<ELF32LE>();
 template InputSectionBase *InputSection::getRelocatedSection<ELF32BE>();
 template InputSectionBase *InputSection::getRelocatedSection<ELF64LE>();

Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=297293&r1=297292&r2=297293&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Wed Mar  8 10:08:36 2017
@@ -113,7 +113,7 @@ public:
   // Returns the size of this section (even if this is a common or BSS.)
   size_t getSize() const;
 
-  template <class ELFT> OutputSection *getOutputSection() const;
+  OutputSection *getOutputSection() const;
 
   template <class ELFT> ObjectFile<ELFT> *getFile() const;
 

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=297293&r1=297292&r2=297293&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Wed Mar  8 10:08:36 2017
@@ -85,7 +85,7 @@ static typename ELFT::uint getSymVA(cons
       Addend = 0;
     }
 
-    const OutputSection *OutSec = IS->getOutputSection<ELFT>();
+    const OutputSection *OutSec = IS->getOutputSection();
 
     // In the typical case, this is actually very simple and boils
     // down to adding together 3 numbers:
@@ -206,7 +206,7 @@ template <class ELFT>
 const OutputSection *SymbolBody::getOutputSection() const {
   if (auto *S = dyn_cast<DefinedRegular>(this)) {
     if (S->Section)
-      return S->Section->template getOutputSection<ELFT>();
+      return S->Section->getOutputSection();
     return nullptr;
   }
 

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=297293&r1=297292&r2=297293&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Mar  8 10:08:36 2017
@@ -717,8 +717,7 @@ void MipsGotSection<ELFT>::addEntry(Symb
     // method calculate number of "pages" required to cover all saved output
     // section and allocate appropriate number of GOT entries.
     auto *DefSym = cast<DefinedRegular>(&Sym);
-    PageIndexMap.insert(
-        {DefSym->Section->template getOutputSection<ELFT>(), 0});
+    PageIndexMap.insert({DefSym->Section->getOutputSection(), 0});
     return;
   }
   if (Sym.isTls()) {
@@ -789,7 +788,7 @@ typename MipsGotSection<ELFT>::uintX_t
 MipsGotSection<ELFT>::getPageEntryOffset(const SymbolBody &B,
                                          int64_t Addend) const {
   const OutputSection *OutSec =
-      cast<DefinedRegular>(&B)->Section->template getOutputSection<ELFT>();
+      cast<DefinedRegular>(&B)->Section->getOutputSection();
   uintX_t SecAddr = getMipsPageAddr(OutSec->Addr);
   uintX_t SymAddr = getMipsPageAddr(B.getVA<ELFT>(Addend));
   uintX_t Index = PageIndexMap.lookup(OutSec) + (SymAddr - SecAddr) / 0xffff;




More information about the llvm-commits mailing list