[lld] r278430 - Make class hierarchy more shallow.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 11 15:06:55 PDT 2016
Author: ruiu
Date: Thu Aug 11 17:06:55 2016
New Revision: 278430
URL: http://llvm.org/viewvc/llvm-project?rev=278430&view=rev
Log:
Make class hierarchy more shallow.
LayoutInputSection is a dummy class and does not need any features
that the actual implementation (InputSection class) provides.
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=278430&r1=278429&r2=278430&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Aug 11 17:06:55 2016
@@ -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;
}
More information about the llvm-commits
mailing list