[ELF] Inline ARMExidxSyntheticSection::classof. NFC

To optimize the only call site `dyn_cast<ARMExidxSyntheticSection>(first)` and
decrease code size.
This commit is contained in:
Fangrui Song 2022-03-15 23:41:30 -07:00
parent 1a590232f4
commit 385573e07b
2 changed files with 4 additions and 5 deletions

View File

@ -3571,10 +3571,6 @@ bool ARMExidxSyntheticSection::isNeeded() const {
[](InputSection *isec) { return isec->isLive(); });
}
bool ARMExidxSyntheticSection::classof(const SectionBase *d) {
return d->kind() == InputSectionBase::Synthetic && d->type == SHT_ARM_EXIDX;
}
ThunkSection::ThunkSection(OutputSection *os, uint64_t off)
: SyntheticSection(SHF_ALLOC | SHF_EXECINSTR, SHT_PROGBITS,
config->emachine == EM_PPC64 ? 16 : 4, ".text.thunk") {

View File

@ -1082,7 +1082,10 @@ public:
void finalizeContents() override;
InputSection *getLinkOrderDep() const;
static bool classof(const SectionBase *d);
static bool classof(const SectionBase *sec) {
return sec->kind() == InputSectionBase::Synthetic &&
sec->type == llvm::ELF::SHT_ARM_EXIDX;
}
// Links to the ARMExidxSections so we can transfer the relocations once the
// layout is known.