[lld] r285221 - Pass a InputSectionData to classoff.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 11:44:57 PDT 2016


Author: rafael
Date: Wed Oct 26 13:44:57 2016
New Revision: 285221

URL: http://llvm.org/viewvc/llvm-project?rev=285221&view=rev
Log:
Pass a InputSectionData to classoff.

This allows a non template class to hold input sections.

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

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=285221&r1=285220&r2=285221&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Wed Oct 26 13:44:57 2016
@@ -200,7 +200,7 @@ InputSection<ELFT>::InputSection(elf::Ob
     : InputSectionBase<ELFT>(F, Header, Name, Base::Regular) {}
 
 template <class ELFT>
-bool InputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {
+bool InputSection<ELFT>::classof(const InputSectionData *S) {
   return S->kind() == Base::Regular;
 }
 
@@ -527,7 +527,7 @@ EhInputSection<ELFT>::EhInputSection(elf
 }
 
 template <class ELFT>
-bool EhInputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {
+bool EhInputSection<ELFT>::classof(const InputSectionData *S) {
   return S->kind() == InputSectionBase<ELFT>::EHFrame;
 }
 
@@ -664,7 +664,7 @@ template <class ELFT> void MergeInputSec
 }
 
 template <class ELFT>
-bool MergeInputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {
+bool MergeInputSection<ELFT>::classof(const InputSectionData *S) {
   return S->kind() == InputSectionBase<ELFT>::Merge;
 }
 
@@ -766,7 +766,7 @@ MipsReginfoInputSection<ELFT>::MipsRegin
 }
 
 template <class ELFT>
-bool MipsReginfoInputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {
+bool MipsReginfoInputSection<ELFT>::classof(const InputSectionData *S) {
   return S->kind() == InputSectionBase<ELFT>::MipsReginfo;
 }
 
@@ -797,7 +797,7 @@ MipsOptionsInputSection<ELFT>::MipsOptio
 }
 
 template <class ELFT>
-bool MipsOptionsInputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {
+bool MipsOptionsInputSection<ELFT>::classof(const InputSectionData *S) {
   return S->kind() == InputSectionBase<ELFT>::MipsOptions;
 }
 
@@ -816,7 +816,7 @@ MipsAbiFlagsInputSection<ELFT>::MipsAbiF
 }
 
 template <class ELFT>
-bool MipsAbiFlagsInputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {
+bool MipsAbiFlagsInputSection<ELFT>::classof(const InputSectionData *S) {
   return S->kind() == InputSectionBase<ELFT>::MipsAbiFlags;
 }
 

Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=285221&r1=285220&r2=285221&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Wed Oct 26 13:44:57 2016
@@ -162,7 +162,7 @@ template <class ELFT> class MergeInputSe
 public:
   MergeInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header,
                     StringRef Name);
-  static bool classof(const InputSectionBase<ELFT> *S);
+  static bool classof(const InputSectionData *S);
   void splitIntoPieces();
 
   // Mark the piece at a given offset live. Used by GC.
@@ -213,7 +213,7 @@ public:
   typedef typename ELFT::Shdr Elf_Shdr;
   typedef typename ELFT::uint uintX_t;
   EhInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header, StringRef Name);
-  static bool classof(const InputSectionBase<ELFT> *S);
+  static bool classof(const InputSectionData *S);
   void split();
   template <class RelTy> void split(ArrayRef<RelTy> Rels);
 
@@ -254,7 +254,7 @@ public:
   // InputSection that is dependent on us (reverse dependency for GC)
   InputSectionBase<ELFT> *DependentSection = nullptr;
 
-  static bool classof(const InputSectionBase<ELFT> *S);
+  static bool classof(const InputSectionData *S);
 
   InputSectionBase<ELFT> *getRelocatedSection();
 
@@ -309,7 +309,7 @@ class MipsReginfoInputSection : public I
 public:
   MipsReginfoInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Hdr,
                           StringRef Name);
-  static bool classof(const InputSectionBase<ELFT> *S);
+  static bool classof(const InputSectionData *S);
 
   const llvm::object::Elf_Mips_RegInfo<ELFT> *Reginfo = nullptr;
 };
@@ -321,7 +321,7 @@ class MipsOptionsInputSection : public I
 public:
   MipsOptionsInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Hdr,
                           StringRef Name);
-  static bool classof(const InputSectionBase<ELFT> *S);
+  static bool classof(const InputSectionData *S);
 
   const llvm::object::Elf_Mips_RegInfo<ELFT> *Reginfo = nullptr;
 };
@@ -333,7 +333,7 @@ class MipsAbiFlagsInputSection : public
 public:
   MipsAbiFlagsInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Hdr,
                            StringRef Name);
-  static bool classof(const InputSectionBase<ELFT> *S);
+  static bool classof(const InputSectionData *S);
 
   const llvm::object::Elf_Mips_ABIFlags<ELFT> *Flags = nullptr;
 };




More information about the llvm-commits mailing list