[PATCH] ELF: Mips: Remove unused field and almost-empty class.

Rui Ueyama ruiu at google.com
Wed Apr 1 16:06:27 PDT 2015


Hi atanasyan,

Looks like MipsTargetHandler::_runtimeFile is unused.
MipsRuntimeFile doesn't seem to add values to the base class,
so I removed that class too.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8789

Files:
  lib/ReaderWriter/ELF/Mips/MipsELFWriters.h
  lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h

Index: lib/ReaderWriter/ELF/Mips/MipsELFWriters.h
===================================================================
--- lib/ReaderWriter/ELF/Mips/MipsELFWriters.h
+++ lib/ReaderWriter/ELF/Mips/MipsELFWriters.h
@@ -14,7 +14,6 @@
 namespace lld {
 namespace elf {
 
-template <class ELFT> class MipsRuntimeFile;
 template <class ELFT> class MipsTargetLayout;
 
 template <typename ELFT> class MipsELFWriter {
@@ -52,8 +51,8 @@
     return _targetLayout.getGOTSection().hasGlobalGOTEntry(a);
   }
 
-  std::unique_ptr<MipsRuntimeFile<ELFT>> createRuntimeFile() {
-    auto file = llvm::make_unique<MipsRuntimeFile<ELFT>>(_ctx);
+  std::unique_ptr<RuntimeFile<ELFT>> createRuntimeFile() {
+    auto file = llvm::make_unique<RuntimeFile<ELFT>>(_ctx, "Mips runtime file");
     if (_ctx.isDynamic()) {
       file->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_");
       file->addAbsoluteAtom("_gp");
Index: lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
===================================================================
--- lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
+++ lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
@@ -83,13 +83,6 @@
   llvm::Optional<AtomLayout *> _gpDispAtom;
 };
 
-/// \brief Mips Runtime file.
-template <class ELFT> class MipsRuntimeFile final : public RuntimeFile<ELFT> {
-public:
-  MipsRuntimeFile(MipsLinkingContext &ctx)
-      : RuntimeFile<ELFT>(ctx, "Mips runtime file") {}
-};
-
 /// \brief Auxiliary class holds relocation's names table.
 class MipsRelocationStringTable {
   static const Registry::KindStrings kindStrings[];
@@ -102,9 +95,9 @@
 template <class ELFT> class MipsTargetHandler final : public TargetHandler {
 public:
   MipsTargetHandler(MipsLinkingContext &ctx)
-      : _ctx(ctx), _runtimeFile(new MipsRuntimeFile<ELFT>(ctx)),
-        _targetLayout(new MipsTargetLayout<ELFT>(ctx)),
-        _relocationHandler(createMipsRelocationHandler<ELFT>(ctx, *_targetLayout)) {}
+      : _ctx(ctx), _targetLayout(new MipsTargetLayout<ELFT>(ctx)),
+        _relocationHandler(
+            createMipsRelocationHandler<ELFT>(ctx, *_targetLayout)) {}
 
   std::unique_ptr<Reader> getObjReader() override {
     return llvm::make_unique<MipsELFObjectReader<ELFT>>(_ctx);
@@ -139,7 +132,6 @@
 
 private:
   MipsLinkingContext &_ctx;
-  std::unique_ptr<MipsRuntimeFile<ELFT>> _runtimeFile;
   std::unique_ptr<MipsTargetLayout<ELFT>> _targetLayout;
   std::unique_ptr<TargetRelocationHandler> _relocationHandler;
 };

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8789.23096.patch
Type: text/x-patch
Size: 2448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150401/3e26482e/attachment.bin>


More information about the llvm-commits mailing list