Make class hierarchy more shallow.
authorRui Ueyama <ruiu@google.com>
Thu, 11 Aug 2016 22:06:55 +0000 (22:06 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 11 Aug 2016 22:06:55 +0000 (22:06 +0000)
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

index 231e4f0..f47bba5 100644 (file)
@@ -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 ELFT> class LayoutInputSection : public InputSection<ELFT> {
+template <class ELFT> class LayoutInputSection : public InputSectionBase<ELFT> {
 public:
   LayoutInputSection(SymbolAssignment *Cmd);
   static bool classof(const InputSectionBase<ELFT> *S);
@@ -194,9 +194,10 @@ template <class T> static T *zero(T *Val) {
 
 template <class ELFT>
 LayoutInputSection<ELFT>::LayoutInputSection(SymbolAssignment *Cmd)
-    : InputSection<ELFT>(nullptr, zero(&Hdr)), Cmd(Cmd) {
+    : InputSectionBase<ELFT>(nullptr, zero(&Hdr),
+                             InputSectionBase<ELFT>::Layout),
+      Cmd(Cmd) {
   this->Live = true;
-  this->SectionKind = InputSectionBase<ELFT>::Layout;
   Hdr.sh_type = SHT_NOBITS;
 }