Move SymbolTable<ELFT>::Sections out of the class.
The list of all input sections was defined in SymbolTable class for a
historical reason. The list itself is not a template. However, because
SymbolTable class is a template, we needed to pass around ELFT to access
the list. This patch moves the list out of the class so that it doesn't
need ELFT.
llvm-svn: 296309
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index bb10409..3b045f0 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -252,7 +252,7 @@
for (SectionPattern &Pat : I->SectionPatterns) {
size_t SizeBefore = I->Sections.size();
- for (InputSectionBase *S : Symtab<ELFT>::X->Sections) {
+ for (InputSectionBase *S : InputSections) {
if (S->Assigned)
continue;
// For -emit-relocs we have to ignore entries like
@@ -391,7 +391,7 @@
// Add sections that didn't match any sections command.
template <class ELFT>
void LinkerScript<ELFT>::addOrphanSections(OutputSectionFactory &Factory) {
- for (InputSectionBase *S : Symtab<ELFT>::X->Sections)
+ for (InputSectionBase *S : InputSections)
if (S->Live && !S->OutSec)
Factory.addInputSec<ELFT>(S, getOutputSectionName(S->Name));
}