Make Discarded a InputSectionBase.

NFC, just a bit simpler.

llvm-svn: 297087
This commit is contained in:
Rafael Espindola 2017-03-06 22:36:19 +00:00
parent 7f18ec50ba
commit 2a80e1180e
2 changed files with 3 additions and 6 deletions

View File

@ -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<uint8_t> Data, StringRef Name, Kind K)

View File

@ -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<uint8_t> Data, StringRef Name, Kind K = Regular);
template <class ELFT>
InputSection(ObjectFile<ELFT> *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 <class ELFT> void writeTo(uint8_t *Buf);