From 5e434b3f11ab3f8480477baba92bd371d7ec86ec Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 8 Mar 2017 16:08:36 +0000 Subject: [PATCH] Remove unnecessary template. llvm-svn: 297293 --- lld/ELF/InputSection.cpp | 8 +------- lld/ELF/InputSection.h | 2 +- lld/ELF/Symbols.cpp | 4 ++-- lld/ELF/SyntheticSections.cpp | 5 ++--- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index cb5f7daa35b0..99d4db351f4e 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -122,7 +122,6 @@ uint64_t InputSectionBase::getOffset(uint64_t Offset) const { llvm_unreachable("invalid section kind"); } -template OutputSection *InputSectionBase::getOutputSection() const { if (auto *MS = dyn_cast(this)) return MS->MergeSec ? MS->MergeSec->OutSec : nullptr; @@ -503,7 +502,7 @@ void InputSectionBase::relocate(uint8_t *Buf, uint8_t *BufEnd) { uint8_t *BufLoc = Buf + Offset; uint32_t Type = Rel.Type; - uintX_t AddrLoc = getOutputSection()->Addr + Offset; + uintX_t AddrLoc = getOutputSection()->Addr + Offset; RelExpr Expr = Rel.Expr; uint64_t TargetVA = SignExtend64( getRelocTargetVA(Type, Rel.Addend, AddrLoc, *Rel.Sym, Expr)); @@ -810,11 +809,6 @@ template InputSectionBase *InputSectionBase::getLinkOrderDep() const; template InputSectionBase *InputSectionBase::getLinkOrderDep() const; template InputSectionBase *InputSectionBase::getLinkOrderDep() const; -template OutputSection *InputSectionBase::getOutputSection() const; -template OutputSection *InputSectionBase::getOutputSection() const; -template OutputSection *InputSectionBase::getOutputSection() const; -template OutputSection *InputSectionBase::getOutputSection() const; - template InputSectionBase *InputSection::getRelocatedSection(); template InputSectionBase *InputSection::getRelocatedSection(); template InputSectionBase *InputSection::getRelocatedSection(); diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index a417a720fcf7..b22e21469cd1 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -113,7 +113,7 @@ public: // Returns the size of this section (even if this is a common or BSS.) size_t getSize() const; - template OutputSection *getOutputSection() const; + OutputSection *getOutputSection() const; template ObjectFile *getFile() const; diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp index 18ba5daa47b9..d8c459795b33 100644 --- a/lld/ELF/Symbols.cpp +++ b/lld/ELF/Symbols.cpp @@ -85,7 +85,7 @@ static typename ELFT::uint getSymVA(const SymbolBody &Body, int64_t &Addend) { Addend = 0; } - const OutputSection *OutSec = IS->getOutputSection(); + 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 const OutputSection *SymbolBody::getOutputSection() const { if (auto *S = dyn_cast(this)) { if (S->Section) - return S->Section->template getOutputSection(); + return S->Section->getOutputSection(); return nullptr; } diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 3ccf0a0271b1..fca7d2ca2bd3 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -717,8 +717,7 @@ void MipsGotSection::addEntry(SymbolBody &Sym, int64_t Addend, // method calculate number of "pages" required to cover all saved output // section and allocate appropriate number of GOT entries. auto *DefSym = cast(&Sym); - PageIndexMap.insert( - {DefSym->Section->template getOutputSection(), 0}); + PageIndexMap.insert({DefSym->Section->getOutputSection(), 0}); return; } if (Sym.isTls()) { @@ -789,7 +788,7 @@ typename MipsGotSection::uintX_t MipsGotSection::getPageEntryOffset(const SymbolBody &B, int64_t Addend) const { const OutputSection *OutSec = - cast(&B)->Section->template getOutputSection(); + cast(&B)->Section->getOutputSection(); uintX_t SecAddr = getMipsPageAddr(OutSec->Addr); uintX_t SymAddr = getMipsPageAddr(B.getVA(Addend)); uintX_t Index = PageIndexMap.lookup(OutSec) + (SymAddr - SecAddr) / 0xffff;