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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334217
91177308-0d34-0410-b5e6-
96231b3b80d8
}
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();
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;
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 {