Index: tools/llvm-objcopy/COFF/Reader.h =================================================================== --- tools/llvm-objcopy/COFF/Reader.h +++ tools/llvm-objcopy/COFF/Reader.h @@ -23,13 +23,7 @@ using object::COFFObjectFile; -class Reader { -public: - virtual ~Reader(); - virtual Expected> create() const = 0; -}; - -class COFFReader : public Reader { +class COFFReader { const COFFObjectFile &COFFObj; Error readExecutableHeaders(Object &Obj) const; @@ -38,7 +32,7 @@ public: explicit COFFReader(const COFFObjectFile &O) : COFFObj(O) {} - Expected> create() const override; + Expected> create() const; }; } // end namespace coff Index: tools/llvm-objcopy/COFF/Reader.cpp =================================================================== --- tools/llvm-objcopy/COFF/Reader.cpp +++ tools/llvm-objcopy/COFF/Reader.cpp @@ -23,8 +23,6 @@ using namespace object; -Reader::~Reader() {} - Error COFFReader::readExecutableHeaders(Object &Obj) const { const dos_header *DH = COFFObj.getDOSHeader(); Obj.Is64 = COFFObj.is64(); Index: tools/llvm-objcopy/COFF/Writer.h =================================================================== --- tools/llvm-objcopy/COFF/Writer.h +++ tools/llvm-objcopy/COFF/Writer.h @@ -22,19 +22,10 @@ struct Object; -class Writer { -protected: +class COFFWriter { Object &Obj; Buffer &Buf; -public: - virtual ~Writer(); - virtual Error write() = 0; - - Writer(Object &O, Buffer &B) : Obj(O), Buf(B) {} -}; - -class COFFWriter : public Writer { size_t FileSize; size_t FileAlignment; size_t SizeOfInitializedData; @@ -56,10 +47,10 @@ public: virtual ~COFFWriter() {} - Error write() override; + Error write(); COFFWriter(Object &Obj, Buffer &Buf) - : Writer(Obj, Buf), StrTabBuilder(StringTableBuilder::WinCOFF) {} + : Obj(Obj), Buf(Buf), StrTabBuilder(StringTableBuilder::WinCOFF) {} }; } // end namespace coff Index: tools/llvm-objcopy/COFF/Writer.cpp =================================================================== --- tools/llvm-objcopy/COFF/Writer.cpp +++ tools/llvm-objcopy/COFF/Writer.cpp @@ -25,8 +25,6 @@ using namespace object; using namespace COFF; -Writer::~Writer() {} - void COFFWriter::layoutSections() { for (auto &S : Obj.Sections) { if (S.Header.SizeOfRawData > 0)