[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
diff --git a/llvm/tools/llvm-objcopy/Object.cpp b/llvm/tools/llvm-objcopy/Object.cpp
index 606e032..6842067 100644
--- a/llvm/tools/llvm-objcopy/Object.cpp
+++ b/llvm/tools/llvm-objcopy/Object.cpp
@@ -835,7 +835,7 @@
}
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();
diff --git a/llvm/tools/llvm-objcopy/Object.h b/llvm/tools/llvm-objcopy/Object.h
index c7939b4..48de0e5 100644
--- a/llvm/tools/llvm-objcopy/Object.h
+++ b/llvm/tools/llvm-objcopy/Object.h
@@ -584,7 +584,6 @@
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 @@
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 {