From 89be48cd836afc65a2d241a1ad78cac899dd356a Mon Sep 17 00:00:00 2001 From: Alexander Shaposhnikov Date: Thu, 7 Jun 2018 19:41:42 +0000 Subject: [PATCH] [llvm-objcopy] Remove unused field from Object The class Object contains std::shared_ptr 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 --- tools/llvm-objcopy/Object.cpp | 2 +- tools/llvm-objcopy/Object.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/llvm-objcopy/Object.cpp b/tools/llvm-objcopy/Object.cpp index 606e0321288..68420670d52 100644 --- a/tools/llvm-objcopy/Object.cpp +++ b/tools/llvm-objcopy/Object.cpp @@ -835,7 +835,7 @@ ElfType ELFReader::getElfType() const { } std::unique_ptr ELFReader::create() const { - auto Obj = llvm::make_unique(Data); + auto Obj = llvm::make_unique(); if (auto *o = dyn_cast>(Bin.get())) { ELFBuilder Builder(*o, *Obj); Builder.build(); diff --git a/tools/llvm-objcopy/Object.h b/tools/llvm-objcopy/Object.h index c7939b4a498..48de0e543a0 100644 --- a/tools/llvm-objcopy/Object.h +++ b/tools/llvm-objcopy/Object.h @@ -584,7 +584,6 @@ private: using SecPtr = std::unique_ptr; using SegPtr = std::unique_ptr; - std::shared_ptr OwnedData; std::vector Sections; std::vector Segments; @@ -617,10 +616,6 @@ public: StringTableSection *SectionNames = nullptr; SymbolTableSection *SymbolTable = nullptr; - explicit Object(std::shared_ptr Data) - : OwnedData(std::move(Data)) {} - virtual ~Object() = default; - void sortSections(); SectionTableRef sections() { return SectionTableRef(Sections); } ConstRange sections() const { -- 2.11.0