[PATCH] D56431: [llvm-objcopy] [COFF] Remove pointless Reader/Writer base classes. NFC.
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 12 00:35:13 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL350996: [llvm-objcopy] [COFF] Remove pointless Reader/Writer base classes. NFC. (authored by mstorsjo, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D56431?vs=180638&id=181428#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56431/new/
https://reviews.llvm.org/D56431
Files:
llvm/trunk/tools/llvm-objcopy/COFF/Reader.cpp
llvm/trunk/tools/llvm-objcopy/COFF/Reader.h
llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp
llvm/trunk/tools/llvm-objcopy/COFF/Writer.h
Index: llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp
===================================================================
--- llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp
+++ llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp
@@ -25,8 +25,6 @@
using namespace object;
using namespace COFF;
-Writer::~Writer() {}
-
Error COFFWriter::finalizeRelocTargets() {
for (Section &Sec : Obj.Sections) {
for (Relocation &R : Sec.Relocs) {
Index: llvm/trunk/tools/llvm-objcopy/COFF/Reader.h
===================================================================
--- llvm/trunk/tools/llvm-objcopy/COFF/Reader.h
+++ llvm/trunk/tools/llvm-objcopy/COFF/Reader.h
@@ -23,13 +23,7 @@
using object::COFFObjectFile;
-class Reader {
-public:
- virtual ~Reader();
- virtual Expected<std::unique_ptr<Object>> create() const = 0;
-};
-
-class COFFReader : public Reader {
+class COFFReader {
const COFFObjectFile &COFFObj;
Error readExecutableHeaders(Object &Obj) const;
@@ -39,7 +33,7 @@
public:
explicit COFFReader(const COFFObjectFile &O) : COFFObj(O) {}
- Expected<std::unique_ptr<Object>> create() const override;
+ Expected<std::unique_ptr<Object>> create() const;
};
} // end namespace coff
Index: llvm/trunk/tools/llvm-objcopy/COFF/Reader.cpp
===================================================================
--- llvm/trunk/tools/llvm-objcopy/COFF/Reader.cpp
+++ llvm/trunk/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: llvm/trunk/tools/llvm-objcopy/COFF/Writer.h
===================================================================
--- llvm/trunk/tools/llvm-objcopy/COFF/Writer.h
+++ llvm/trunk/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;
@@ -57,10 +48,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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56431.181428.patch
Type: text/x-patch
Size: 2536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190112/31791483/attachment.bin>
More information about the llvm-commits
mailing list