<div dir="ltr"><div class="gmail_extra">Please do not use inheritance. You don't need that at all here.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 15, 2017 at 8:29 AM, George Rimar via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: grimar<br>
Date: Wed Mar 15 10:29:29 2017<br>
New Revision: 297844<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=297844&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=297844&view=rev</a><br>
Log:<br>
[ELF] - Split struct In<ELFT> to have templated and non-templated sections areas.<br>
<br>
Patch splits In<ELFT> into 2 classes: one for non-templated sections,<br>
second contains ELFT templated ones.<br>
That allows to code that was detemplated to access non-templated sections freely,<br>
and should open road for futher detemplation proccess.<br>
<br>
Differential revision: <a href="https://reviews.llvm.org/D30939" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D30939</a><br>
<br>
Modified:<br>
    lld/trunk/ELF/<wbr>SyntheticSections.cpp<br>
    lld/trunk/ELF/<wbr>SyntheticSections.h<br>
<br>
Modified: lld/trunk/ELF/<wbr>SyntheticSections.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=297844&r1=297843&r2=297844&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>SyntheticSections.cpp?rev=<wbr>297844&r1=297843&r2=297844&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/<wbr>SyntheticSections.cpp (original)<br>
+++ lld/trunk/ELF/<wbr>SyntheticSections.cpp Wed Mar 15 10:29:29 2017<br>
@@ -2263,6 +2263,18 @@ InputSection *ThunkSection<ELFT>::getTar<br>
   return T->getTargetInputSection();<br>
 }<br>
<br>
+InputSection *InX::ARMAttributes;<br>
+BssSection *InX::Bss;<br>
+BssSection *InX::BssRelRo;<br>
+InputSection *InX::Common;<br>
+StringTableSection *InX::DynStrTab;<br>
+InputSection *InX::Interp;<br>
+GotPltSection *InX::GotPlt;<br>
+IgotPltSection *InX::IgotPlt;<br>
+MipsRldMapSection *InX::MipsRldMap;<br>
+StringTableSection *InX::ShStrTab;<br>
+StringTableSection *InX::StrTab;<br>
+<br>
 template InputSection *elf::createCommonSection<<wbr>ELF32LE>();<br>
 template InputSection *elf::createCommonSection<<wbr>ELF32BE>();<br>
 template InputSection *elf::createCommonSection<<wbr>ELF64LE>();<br>
<br>
Modified: lld/trunk/ELF/<wbr>SyntheticSections.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=297844&r1=297843&r2=297844&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>SyntheticSections.h?rev=<wbr>297844&r1=297843&r2=297844&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/<wbr>SyntheticSections.h (original)<br>
+++ lld/trunk/ELF/<wbr>SyntheticSections.h Wed Mar 15 10:29:29 2017<br>
@@ -758,14 +758,23 @@ SymbolBody *addSyntheticLocal(StringRef<br>
                               uint64_t Size, InputSectionBase *Section);<br>
<br>
 // Linker generated sections which can be used as inputs.<br>
-template <class ELFT> struct In {<br>
+struct InX {<br>
   static InputSection *ARMAttributes;<br>
-  static BuildIdSection<ELFT> *BuildId;<br>
   static BssSection *Bss;<br>
   static BssSection *BssRelRo;<br>
   static InputSection *Common;<br>
-  static DynamicSection<ELFT> *Dynamic;<br>
   static StringTableSection *DynStrTab;<br>
+  static InputSection *Interp;<br>
+  static GotPltSection *GotPlt;<br>
+  static IgotPltSection *IgotPlt;<br>
+  static MipsRldMapSection *MipsRldMap;<br>
+  static StringTableSection *ShStrTab;<br>
+  static StringTableSection *StrTab;<br>
+};<br>
+<br>
+template <class ELFT> struct In : public InX {<br>
+  static BuildIdSection<ELFT> *BuildId;<br>
+  static DynamicSection<ELFT> *Dynamic;<br>
   static SymbolTableSection<ELFT> *DynSymTab;<br>
   static EhFrameHeader<ELFT> *EhFrameHdr;<br>
   static GnuHashTableSection<ELFT> *GnuHashTab;<br>
@@ -773,31 +782,20 @@ template <class ELFT> struct In {<br>
   static GotSection<ELFT> *Got;<br>
   static EhFrameSection<ELFT> *EhFrame;<br>
   static MipsGotSection<ELFT> *MipsGot;<br>
-  static GotPltSection *GotPlt;<br>
-  static IgotPltSection *IgotPlt;<br>
   static HashTableSection<ELFT> *HashTab;<br>
-  static InputSection *Interp;<br>
-  static MipsRldMapSection *MipsRldMap;<br>
   static PltSection<ELFT> *Plt;<br>
   static PltSection<ELFT> *Iplt;<br>
   static RelocationSection<ELFT> *RelaDyn;<br>
   static RelocationSection<ELFT> *RelaPlt;<br>
   static RelocationSection<ELFT> *RelaIplt;<br>
-  static StringTableSection *ShStrTab;<br>
-  static StringTableSection *StrTab;<br>
   static SymbolTableSection<ELFT> *SymTab;<br>
   static VersionDefinitionSection<ELFT> *VerDef;<br>
   static VersionTableSection<ELFT> *VerSym;<br>
   static VersionNeedSection<ELFT> *VerNeed;<br>
 };<br>
<br>
-template <class ELFT> InputSection *In<ELFT>::ARMAttributes;<br>
-template <class ELFT> BssSection *In<ELFT>::Bss;<br>
-template <class ELFT> BssSection *In<ELFT>::BssRelRo;<br>
 template <class ELFT> BuildIdSection<ELFT> *In<ELFT>::BuildId;<br>
-template <class ELFT> InputSection *In<ELFT>::Common;<br>
 template <class ELFT> DynamicSection<ELFT> *In<ELFT>::Dynamic;<br>
-template <class ELFT> StringTableSection *In<ELFT>::DynStrTab;<br>
 template <class ELFT> SymbolTableSection<ELFT> *In<ELFT>::DynSymTab;<br>
 template <class ELFT> EhFrameHeader<ELFT> *In<ELFT>::EhFrameHdr;<br>
 template <class ELFT> GdbIndexSection<ELFT> *In<ELFT>::GdbIndex;<br>
@@ -805,18 +803,12 @@ template <class ELFT> GnuHashTableSectio<br>
 template <class ELFT> GotSection<ELFT> *In<ELFT>::Got;<br>
 template <class ELFT> EhFrameSection<ELFT> *In<ELFT>::EhFrame;<br>
 template <class ELFT> MipsGotSection<ELFT> *In<ELFT>::MipsGot;<br>
-template <class ELFT> GotPltSection *In<ELFT>::GotPlt;<br>
-template <class ELFT> IgotPltSection *In<ELFT>::IgotPlt;<br>
 template <class ELFT> HashTableSection<ELFT> *In<ELFT>::HashTab;<br>
-template <class ELFT> InputSection *In<ELFT>::Interp;<br>
-template <class ELFT> MipsRldMapSection *In<ELFT>::MipsRldMap;<br>
 template <class ELFT> PltSection<ELFT> *In<ELFT>::Plt;<br>
 template <class ELFT> PltSection<ELFT> *In<ELFT>::Iplt;<br>
 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaDyn;<br>
 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaPlt;<br>
 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaIplt;<br>
-template <class ELFT> StringTableSection *In<ELFT>::ShStrTab;<br>
-template <class ELFT> StringTableSection *In<ELFT>::StrTab;<br>
 template <class ELFT> SymbolTableSection<ELFT> *In<ELFT>::SymTab;<br>
 template <class ELFT> VersionDefinitionSection<ELFT> *In<ELFT>::VerDef;<br>
 template <class ELFT> VersionTableSection<ELFT> *In<ELFT>::VerSym;<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>