[llvm-objcopy] Remove unused field from Object

The class Object contains std::shared_ptr<MemoryBuffer> OwnedData
which is not used anywhere. Besides avoiding two stage initialization 
the motivation to remove it comes from the plan to add (currently missing) support 
for static libraries.
NFC.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D47855

llvm-svn: 334217
This commit is contained in:
Alexander Shaposhnikov 2018-06-07 19:41:42 +00:00
parent bc783fddef
commit 15f4a16453
2 changed files with 1 additions and 6 deletions

View File

@ -835,7 +835,7 @@ ElfType ELFReader::getElfType() const {
}
std::unique_ptr<Object> ELFReader::create() const {
auto Obj = llvm::make_unique<Object>(Data);
auto Obj = llvm::make_unique<Object>();
if (auto *o = dyn_cast<ELFObjectFile<ELF32LE>>(Bin.get())) {
ELFBuilder<ELF32LE> Builder(*o, *Obj);
Builder.build();

View File

@ -584,7 +584,6 @@ private:
using SecPtr = std::unique_ptr<SectionBase>;
using SegPtr = std::unique_ptr<Segment>;
std::shared_ptr<MemoryBuffer> OwnedData;
std::vector<SecPtr> Sections;
std::vector<SegPtr> Segments;
@ -617,10 +616,6 @@ public:
StringTableSection *SectionNames = nullptr;
SymbolTableSection *SymbolTable = nullptr;
explicit Object(std::shared_ptr<MemoryBuffer> Data)
: OwnedData(std::move(Data)) {}
virtual ~Object() = default;
void sortSections();
SectionTableRef sections() { return SectionTableRef(Sections); }
ConstRange<SectionBase> sections() const {