[lld] r249882 - ELF2: Reduce code repetition.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 12:34:55 PDT 2015


Author: ruiu
Date: Fri Oct  9 14:34:55 2015
New Revision: 249882

URL: http://llvm.org/viewvc/llvm-project?rev=249882&view=rev
Log:
ELF2: Reduce code repetition.

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

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=249882&r1=249881&r2=249882&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Fri Oct  9 14:34:55 2015
@@ -20,51 +20,6 @@ using namespace llvm::ELF;
 using namespace lld;
 using namespace lld::elf2;
 
-template <> DynamicSection<ELF32BE> *Out<ELF32BE>::Dynamic = nullptr;
-template <> DynamicSection<ELF32LE> *Out<ELF32LE>::Dynamic = nullptr;
-template <> DynamicSection<ELF64BE> *Out<ELF64BE>::Dynamic = nullptr;
-template <> DynamicSection<ELF64LE> *Out<ELF64LE>::Dynamic = nullptr;
-template <> GotSection<ELF32BE> *Out<ELF32BE>::Got = nullptr;
-template <> GotSection<ELF32LE> *Out<ELF32LE>::Got = nullptr;
-template <> GotSection<ELF64BE> *Out<ELF64BE>::Got = nullptr;
-template <> GotSection<ELF64LE> *Out<ELF64LE>::Got = nullptr;
-template <> HashTableSection<ELF32BE> *Out<ELF32BE>::HashTab = nullptr;
-template <> HashTableSection<ELF32LE> *Out<ELF32LE>::HashTab = nullptr;
-template <> HashTableSection<ELF64BE> *Out<ELF64BE>::HashTab = nullptr;
-template <> HashTableSection<ELF64LE> *Out<ELF64LE>::HashTab = nullptr;
-template <> InterpSection<false> *Out<ELF32BE>::Interp = nullptr;
-template <> InterpSection<false> *Out<ELF32LE>::Interp = nullptr;
-template <> InterpSection<true> *Out<ELF64BE>::Interp = nullptr;
-template <> InterpSection<true> *Out<ELF64LE>::Interp = nullptr;
-template <> OutputSection<ELF32BE> *Out<ELF32BE>::Bss = nullptr;
-template <> OutputSection<ELF32LE> *Out<ELF32LE>::Bss = nullptr;
-template <> OutputSection<ELF64BE> *Out<ELF64BE>::Bss = nullptr;
-template <> OutputSection<ELF64LE> *Out<ELF64LE>::Bss = nullptr;
-template <> PltSection<ELF32BE> *Out<ELF32BE>::Plt = nullptr;
-template <> PltSection<ELF32LE> *Out<ELF32LE>::Plt = nullptr;
-template <> PltSection<ELF64BE> *Out<ELF64BE>::Plt = nullptr;
-template <> PltSection<ELF64LE> *Out<ELF64LE>::Plt = nullptr;
-template <> RelocationSection<ELF32BE> *Out<ELF32BE>::RelaDyn = nullptr;
-template <> RelocationSection<ELF32LE> *Out<ELF32LE>::RelaDyn = nullptr;
-template <> RelocationSection<ELF64BE> *Out<ELF64BE>::RelaDyn = nullptr;
-template <> RelocationSection<ELF64LE> *Out<ELF64LE>::RelaDyn = nullptr;
-template <> StringTableSection<false> *Out<ELF32BE>::DynStrTab = nullptr;
-template <> StringTableSection<false> *Out<ELF32LE>::DynStrTab = nullptr;
-template <> StringTableSection<true> *Out<ELF64BE>::DynStrTab = nullptr;
-template <> StringTableSection<true> *Out<ELF64LE>::DynStrTab = nullptr;
-template <> StringTableSection<false> *Out<ELF32BE>::StrTab = nullptr;
-template <> StringTableSection<false> *Out<ELF32LE>::StrTab = nullptr;
-template <> StringTableSection<true> *Out<ELF64BE>::StrTab = nullptr;
-template <> StringTableSection<true> *Out<ELF64LE>::StrTab = nullptr;
-template <> SymbolTableSection<ELF32BE> *Out<ELF32BE>::DynSymTab = nullptr;
-template <> SymbolTableSection<ELF32LE> *Out<ELF32LE>::DynSymTab = nullptr;
-template <> SymbolTableSection<ELF64BE> *Out<ELF64BE>::DynSymTab = nullptr;
-template <> SymbolTableSection<ELF64LE> *Out<ELF64LE>::DynSymTab = nullptr;
-template <> SymbolTableSection<ELF32BE> *Out<ELF32BE>::SymTab = nullptr;
-template <> SymbolTableSection<ELF32LE> *Out<ELF32LE>::SymTab = nullptr;
-template <> SymbolTableSection<ELF64BE> *Out<ELF64BE>::SymTab = nullptr;
-template <> SymbolTableSection<ELF64LE> *Out<ELF64LE>::SymTab = nullptr;
-
 template <bool Is64Bits>
 OutputSectionBase<Is64Bits>::OutputSectionBase(StringRef Name, uint32_t sh_type,
                                                uintX_t sh_flags)

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=249882&r1=249881&r2=249882&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Fri Oct  9 14:34:55 2015
@@ -295,6 +295,18 @@ template <class ELFT> struct Out {
   static SymbolTableSection<ELFT> *DynSymTab;
   static SymbolTableSection<ELFT> *SymTab;
 };
+
+template <class ELFT> DynamicSection<ELFT> *Out<ELFT>::Dynamic;
+template <class ELFT> GotSection<ELFT> *Out<ELFT>::Got;
+template <class ELFT> HashTableSection<ELFT> *Out<ELFT>::HashTab;
+template <class ELFT> InterpSection<ELFT::Is64Bits> *Out<ELFT>::Interp;
+template <class ELFT> OutputSection<ELFT> *Out<ELFT>::Bss;
+template <class ELFT> PltSection<ELFT> *Out<ELFT>::Plt;
+template <class ELFT> RelocationSection<ELFT> *Out<ELFT>::RelaDyn;
+template <class ELFT> StringTableSection<ELFT::Is64Bits> *Out<ELFT>::DynStrTab;
+template <class ELFT> StringTableSection<ELFT::Is64Bits> *Out<ELFT>::StrTab;
+template <class ELFT> SymbolTableSection<ELFT> *Out<ELFT>::DynSymTab;
+template <class ELFT> SymbolTableSection<ELFT> *Out<ELFT>::SymTab;
 }
 }
 #endif




More information about the llvm-commits mailing list