From 2a80e1180e319480658cc7972821a5f299668938 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 6 Mar 2017 22:36:19 +0000 Subject: [PATCH] Make Discarded a InputSectionBase. NFC, just a bit simpler. llvm-svn: 297087 --- lld/ELF/InputSection.cpp | 4 +--- lld/ELF/InputSection.h | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index b21af523096b..9dbf3e51b196 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -186,9 +186,7 @@ std::string InputSectionBase::getLocation(uint64_t Offset) { return (SrcFile + ":(" + Name + "+0x" + utohexstr(Offset) + ")").str(); } -InputSection InputSection::Discarded; - -InputSection::InputSection() : InputSectionBase() {} +InputSectionBase InputSectionBase::Discarded; InputSection::InputSection(uint64_t Flags, uint32_t Type, uint64_t Addralign, ArrayRef Data, StringRef Name, Kind K) diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index 4f6a908c9f3b..63af8baa986c 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -64,6 +64,8 @@ public: uint32_t Link; uint32_t Info; + static InputSectionBase Discarded; + InputSectionBase() : SectionKind(Regular), Live(false), Assigned(false), Repl(this) { NumRelocations = 0; @@ -250,15 +252,12 @@ public: // .eh_frame. It also includes the synthetic sections themselves. class InputSection : public InputSectionBase { public: - InputSection(); InputSection(uint64_t Flags, uint32_t Type, uint64_t Addralign, ArrayRef Data, StringRef Name, Kind K = Regular); template InputSection(ObjectFile *F, const typename ELFT::Shdr *Header, StringRef Name); - static InputSection Discarded; - // Write this section to a mmap'ed file, assuming Buf is pointing to // beginning of the output section. template void writeTo(uint8_t *Buf);