[lld] r297087 - Make Discarded a InputSectionBase.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 6 14:36:19 PST 2017
Author: rafael
Date: Mon Mar 6 16:36:19 2017
New Revision: 297087
URL: http://llvm.org/viewvc/llvm-project?rev=297087&view=rev
Log:
Make Discarded a InputSectionBase.
NFC, just a bit simpler.
Modified:
lld/trunk/ELF/InputSection.cpp
lld/trunk/ELF/InputSection.h
Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=297087&r1=297086&r2=297087&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Mon Mar 6 16:36:19 2017
@@ -186,9 +186,7 @@ std::string InputSectionBase::getLocatio
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)
Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=297087&r1=297086&r2=297087&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Mon Mar 6 16:36:19 2017
@@ -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);
More information about the llvm-commits
mailing list