Remove unnecessary template. NFC.
llvm-svn: 297287
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 38cc63f..84d4bf0 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -154,7 +154,7 @@
// 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 @@
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 c9d70ac..218fcdb 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -86,7 +86,7 @@
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 @@
// 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<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 78bd576..f7081be 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -111,7 +111,7 @@
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 6f93859..45727ee 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -407,7 +407,7 @@
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 97b9137..e1194b5 100644
--- a/lld/ELF/MapFile.cpp
+++ b/lld/ELF/MapFile.cpp
@@ -66,8 +66,8 @@
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 @@
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 b697e1a..c7b0182 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -134,7 +134,7 @@
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 c8039e6..82724bb 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -928,7 +928,7 @@
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 6a93079..637f2ea 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -1733,8 +1733,7 @@
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 @@
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 85cac56..e5269fc 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -66,7 +66,7 @@
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 "";