[lld] bb3eeac - [ELF] Make InputSection::classof inline. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 28 00:16:50 PST 2022


Author: Fangrui Song
Date: 2022-02-28T00:16:45-08:00
New Revision: bb3eeac77384adf68daf5062c2c9cf52f84fd5cb

URL: https://github.com/llvm/llvm-project/commit/bb3eeac77384adf68daf5062c2c9cf52f84fd5cb
DIFF: https://github.com/llvm/llvm-project/commit/bb3eeac77384adf68daf5062c2c9cf52f84fd5cb.diff

LOG: [ELF] Make InputSection::classof inline. NFC

Added: 
    

Modified: 
    lld/ELF/InputSection.cpp
    lld/ELF/InputSection.h

Removed: 
    


################################################################################
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<ELFT> &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<OutputSection>(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 @@ class InputSection : public InputSectionBase {
   InputSection(ObjFile<ELFT> &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 <class ELFT> void writeTo(uint8_t *buf);
@@ -351,8 +356,6 @@ class InputSection : public InputSectionBase {
   // 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 <class ELFT, class RelTy>


        


More information about the llvm-commits mailing list