diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-03-08 15:44:30 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-03-08 15:44:30 +0000 |
| commit | 76b6bd355d274f6eb74417a40ea87e8734d8baa4 (patch) | |
| tree | f526f0c1fbf143a1f908a7167725f0d3bdfdb287 /lld/ELF | |
| parent | c86b2cddc8294578162f6d87900e7127b9f99deb (diff) | |
| download | bcm5719-llvm-76b6bd355d274f6eb74417a40ea87e8734d8baa4.tar.gz bcm5719-llvm-76b6bd355d274f6eb74417a40ea87e8734d8baa4.zip | |
Remove unnecessary template. NFC.
llvm-svn: 297287
Diffstat (limited to 'lld/ELF')
| -rw-r--r-- | lld/ELF/ICF.cpp | 5 | ||||
| -rw-r--r-- | lld/ELF/InputSection.cpp | 9 | ||||
| -rw-r--r-- | lld/ELF/InputSection.h | 2 | ||||
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/MapFile.cpp | 8 | ||||
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Relocations.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/SyntheticSections.cpp | 6 | ||||
| -rw-r--r-- | lld/ELF/Target.cpp | 2 |
9 files changed, 15 insertions, 23 deletions
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp index 38cc63f2564..84d4bf0caa8 100644 --- a/lld/ELF/ICF.cpp +++ b/lld/ELF/ICF.cpp @@ -154,7 +154,7 @@ private: // Returns a hash value for S. Note that the information about // relocation targets is not included in the hash value. template <class ELFT> static uint32_t getHash(InputSection *S) { - return hash_combine(S->Flags, S->template getSize<ELFT>(), S->NumRelocations); + return hash_combine(S->Flags, S->getSize(), S->NumRelocations); } // Returns true if section S is subject of ICF. @@ -222,8 +222,7 @@ bool ICF<ELFT>::constantEq(ArrayRef<RelTy> RelsA, ArrayRef<RelTy> RelsB) { template <class ELFT> bool ICF<ELFT>::equalsConstant(const InputSection *A, const InputSection *B) { if (A->NumRelocations != B->NumRelocations || A->Flags != B->Flags || - A->template getSize<ELFT>() != B->template getSize<ELFT>() || - A->Data != B->Data) + A->getSize() != B->getSize() || A->Data != B->Data) return false; if (A->AreRelocsRela) diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index c9d70ac6215..218fcdbccaf 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -86,7 +86,7 @@ InputSectionBase::InputSectionBase(elf::ObjectFile<ELFT> *File, SectionKind) { } -template <class ELFT> size_t InputSectionBase::getSize() const { +size_t InputSectionBase::getSize() const { if (auto *S = dyn_cast<SyntheticSection>(this)) return S->getSize(); @@ -108,7 +108,7 @@ uint64_t InputSectionBase::getOffset(uint64_t Offset) const { // For synthetic sections we treat offset -1 as the end of the section. // The same approach is used for synthetic symbols (DefinedSynthetic). return cast<InputSection>(this)->OutSecOff + - (Offset == uint64_t(-1) ? getSize<ELFT>() : Offset); + (Offset == uint64_t(-1) ? getSize() : Offset); case EHFrame: // The file crtbeginT.o has relocations pointing to the start of an empty // .eh_frame that is known to be the first in the link. It does that to @@ -836,11 +836,6 @@ template uint64_t InputSectionBase::getOffset<ELF32BE>(uint64_t Offset) const; template uint64_t InputSectionBase::getOffset<ELF64LE>(uint64_t Offset) const; template uint64_t InputSectionBase::getOffset<ELF64BE>(uint64_t Offset) const; -template size_t InputSectionBase::getSize<ELF32LE>() const; -template size_t InputSectionBase::getSize<ELF32BE>() const; -template size_t InputSectionBase::getSize<ELF64LE>() const; -template size_t InputSectionBase::getSize<ELF64BE>() const; - template elf::ObjectFile<ELF32LE> *InputSectionBase::getFile<ELF32LE>() const; template elf::ObjectFile<ELF32BE> *InputSectionBase::getFile<ELF32BE>() const; template elf::ObjectFile<ELF64LE> *InputSectionBase::getFile<ELF64LE>() const; diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index 78bd576c290..f7081beb7f6 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -111,7 +111,7 @@ public: llvm::TinyPtrVector<InputSectionBase *> DependentSections; // Returns the size of this section (even if this is a common or BSS.) - template <class ELFT> size_t getSize() const; + size_t getSize() const; template <class ELFT> OutputSection *getOutputSection() const; diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 6f93859f744..45727ee96cb 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -407,7 +407,7 @@ template <class ELFT> void LinkerScript<ELFT>::output(InputSection *S) { uintX_t Pos = IsTbss ? Dot + ThreadBssOffset : Dot; Pos = alignTo(Pos, S->Alignment); S->OutSecOff = Pos - CurOutSec->Addr; - Pos += S->template getSize<ELFT>(); + Pos += S->getSize(); // Update output section size after adding each section. This is so that // SIZEOF works correctly in the case below: diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp index 97b913705ca..e1194b5bf41 100644 --- a/lld/ELF/MapFile.cpp +++ b/lld/ELF/MapFile.cpp @@ -66,8 +66,8 @@ static void writeInputSection(raw_fd_ostream &OS, const InputSection *IS, int Width = ELFT::Is64Bits ? 16 : 8; StringRef Name = IS->Name; if (Name != PrevName) { - writeInSecLine(OS, Width, IS->OutSec->Addr + IS->OutSecOff, - IS->template getSize<ELFT>(), IS->Alignment, Name); + writeInSecLine(OS, Width, IS->OutSec->Addr + IS->OutSecOff, IS->getSize(), + IS->Alignment, Name); OS << '\n'; PrevName = Name; } @@ -75,8 +75,8 @@ static void writeInputSection(raw_fd_ostream &OS, const InputSection *IS, elf::ObjectFile<ELFT> *File = IS->template getFile<ELFT>(); if (!File) return; - writeFileLine(OS, Width, IS->OutSec->Addr + IS->OutSecOff, - IS->template getSize<ELFT>(), IS->Alignment, toString(File)); + writeFileLine(OS, Width, IS->OutSec->Addr + IS->OutSecOff, IS->getSize(), + IS->Alignment, toString(File)); OS << '\n'; for (SymbolBody *Sym : File->getSymbols()) { diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index b697e1a3484..c7b0182d834 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -134,7 +134,7 @@ template <class ELFT> void OutputSection::assignOffsets() { for (InputSection *S : Sections) { Off = alignTo(Off, S->Alignment); S->OutSecOff = Off; - Off += S->template getSize<ELFT>(); + Off += S->getSize(); } this->Size = Off; } diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index c8039e667de..82724bb55a4 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -928,7 +928,7 @@ bool createThunks(ArrayRef<OutputSection *> OutputSections) { if (TS == nullptr) { uint32_t Off = 0; for (auto *IS : OS->Sections) { - Off = IS->OutSecOff + IS->template getSize<ELFT>(); + Off = IS->OutSecOff + IS->getSize(); if ((IS->Flags & SHF_EXECINSTR) == 0) break; } diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 6a93079b85b..637f2ea499f 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1733,8 +1733,7 @@ static InputSectionBase *findSection(ArrayRef<InputSectionBase *> Arr, uint64_t Offset) { for (InputSectionBase *S : Arr) if (S && S != &InputSection::Discarded) - if (Offset >= S->getOffset() && - Offset < S->getOffset() + S->getSize<ELFT>()) + if (Offset >= S->getOffset() && Offset < S->getOffset() + S->getSize()) return S; return nullptr; } @@ -2237,8 +2236,7 @@ void ARMExidxSentinelSection<ELFT>::writeTo(uint8_t *Buf) { auto RI = cast<OutputSection>(this->OutSec)->Sections.rbegin(); InputSection *LE = *(++RI); InputSection *LC = cast<InputSection>(LE->template getLinkOrderDep<ELFT>()); - uint64_t S = LC->OutSec->Addr + - LC->template getOffset<ELFT>(LC->template getSize<ELFT>()); + uint64_t S = LC->OutSec->Addr + LC->template getOffset<ELFT>(LC->getSize()); uint64_t P = this->getVA(); Target->relocateOne(Buf, R_ARM_PREL31, S - P); write32le(Buf + 4, 0x1); diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 85cac56967e..e5269fc080f 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -66,7 +66,7 @@ template <class ELFT> static std::string getErrorLoc(uint8_t *Loc) { continue; uint8_t *ISLoc = cast<OutputSection>(IS->OutSec)->Loc + IS->OutSecOff; - if (ISLoc <= Loc && Loc < ISLoc + IS->template getSize<ELFT>()) + if (ISLoc <= Loc && Loc < ISLoc + IS->getSize()) return IS->template getLocation<ELFT>(Loc - ISLoc) + ": "; } return ""; |

