From 2c3f501052dac7baa3d937d543e60662089145c7 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 11 Aug 2016 22:06:55 +0000 Subject: [PATCH] Make class hierarchy more shallow. LayoutInputSection is a dummy class and does not need any features that the actual implementation (InputSection class) provides. llvm-svn: 278430 --- lld/ELF/LinkerScript.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 231e4f0..f47bba5 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -147,7 +147,7 @@ namespace { // keep symbol definitions in output sections. Because output sections // can contain only input sections, we wrap symbol definitions // with dummy input sections. This class serves that purpose. -template class LayoutInputSection : public InputSection { +template class LayoutInputSection : public InputSectionBase { public: LayoutInputSection(SymbolAssignment *Cmd); static bool classof(const InputSectionBase *S); @@ -194,9 +194,10 @@ template static T *zero(T *Val) { template LayoutInputSection::LayoutInputSection(SymbolAssignment *Cmd) - : InputSection(nullptr, zero(&Hdr)), Cmd(Cmd) { + : InputSectionBase(nullptr, zero(&Hdr), + InputSectionBase::Layout), + Cmd(Cmd) { this->Live = true; - this->SectionKind = InputSectionBase::Layout; Hdr.sh_type = SHT_NOBITS; } -- 2.7.4