From bb3eeac77384adf68daf5062c2c9cf52f84fd5cb Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 28 Feb 2022 00:16:45 -0800 Subject: [PATCH] [ELF] Make InputSection::classof inline. NFC --- lld/ELF/InputSection.cpp | 5 ----- lld/ELF/InputSection.h | 7 +++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 12f5aefb2695..497d97af2f42 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -323,11 +323,6 @@ InputSection::InputSection(ObjFile &f, const typename ELFT::Shdr &header, StringRef name) : InputSectionBase(f, header, name, InputSectionBase::Regular) {} -bool InputSection::classof(const SectionBase *s) { - return s->kind() == SectionBase::Regular || - s->kind() == SectionBase::Synthetic; -} - OutputSection *InputSection::getParent() const { return cast_or_null(parent); } diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index a6413ff2e11b..3ad6129bc5d1 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -339,6 +339,11 @@ public: InputSection(ObjFile &f, const typename ELFT::Shdr &header, StringRef name); + static bool classof(const SectionBase *s) { + return s->kind() == SectionBase::Regular || + s->kind() == SectionBase::Synthetic; + } + // Write this section to a mmap'ed file, assuming Buf is pointing to // beginning of the output section. template void writeTo(uint8_t *buf); @@ -351,8 +356,6 @@ public: // the beginning of the output section this section was assigned to. uint64_t outSecOff = 0; - static bool classof(const SectionBase *s); - InputSectionBase *getRelocatedSection() const; template