[ELF] Remove TargetHandler and DefaultTargetHandler constructors
authorSimon Atanasyan <simon@atanasyan.com>
Fri, 16 Jan 2015 09:40:21 +0000 (09:40 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Fri, 16 Jan 2015 09:40:21 +0000 (09:40 +0000)
These classes contain only abstract virtual functions. Explicit
constructors are redundant.

llvm-svn: 226265

lld/lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.cpp
lld/lib/ReaderWriter/ELF/DefaultTargetHandler.h
lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
lld/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp
lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp
lld/lib/ReaderWriter/ELF/TargetHandler.h
lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp
lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp

index ed18db5..ca92ad5 100644 (file)
@@ -17,10 +17,9 @@ using namespace lld;
 using namespace elf;
 
 AArch64TargetHandler::AArch64TargetHandler(AArch64LinkingContext &context)
-    : DefaultTargetHandler(context), _context(context),
+    : _context(context),
       _AArch64TargetLayout(new AArch64TargetLayout<AArch64ELFType>(context)),
-      _AArch64RelocationHandler(
-          new AArch64TargetRelocationHandler(context)) {}
+      _AArch64RelocationHandler(new AArch64TargetRelocationHandler(context)) {}
 
 void AArch64TargetHandler::registerRelocationNames(Registry &registry) {
   registry.addKindTable(Reference::KindNamespace::ELF,
index 767e151..1135d1c 100644 (file)
@@ -24,9 +24,6 @@ namespace elf {
 template <class ELFT>
 class DefaultTargetHandler : public TargetHandler<ELFT> {
 public:
-  DefaultTargetHandler(ELFLinkingContext &context)
-      : TargetHandler<ELFT>(context) {}
-
   const TargetRelocationHandler &getRelocationHandler() const = 0;
 
   virtual std::unique_ptr<Reader> getObjReader(bool atomizeStrings) = 0;
index d24c5e4..0d66980 100644 (file)
@@ -19,7 +19,7 @@ using namespace llvm::ELF;
 using llvm::makeArrayRef;
 
 HexagonTargetHandler::HexagonTargetHandler(HexagonLinkingContext &context)
-    : DefaultTargetHandler(context), _hexagonLinkingContext(context),
+    : _hexagonLinkingContext(context),
       _hexagonRuntimeFile(new HexagonRuntimeFile<HexagonELFType>(context)),
       _hexagonTargetLayout(new HexagonTargetLayout<HexagonELFType>(context)),
       _hexagonRelocationHandler(new HexagonTargetRelocationHandler(
index a56c746..221281c 100644 (file)
@@ -19,10 +19,10 @@ using namespace elf;
 typedef llvm::object::ELFType<llvm::support::little, 2, false> Mips32ElELFType;
 
 MipsTargetHandler::MipsTargetHandler(MipsLinkingContext &ctx)
-    : DefaultTargetHandler(ctx), _ctx(ctx),
-      _runtimeFile(new MipsRuntimeFile<Mips32ElELFType>(ctx)),
+    : _ctx(ctx), _runtimeFile(new MipsRuntimeFile<Mips32ElELFType>(ctx)),
       _targetLayout(new MipsTargetLayout<Mips32ElELFType>(ctx)),
-      _relocationHandler(new MipsTargetRelocationHandler(*_targetLayout, ctx)) {}
+      _relocationHandler(new MipsTargetRelocationHandler(*_targetLayout, ctx)) {
+}
 
 std::unique_ptr<Writer> MipsTargetHandler::getWriter() {
   switch (_ctx.getOutputELFType()) {
index 7527398..ff9e187 100644 (file)
@@ -59,7 +59,7 @@ std::error_code PPCTargetRelocationHandler::applyRelocation(
 }
 
 PPCTargetHandler::PPCTargetHandler(PPCLinkingContext &context)
-    : DefaultTargetHandler(context), _ppcLinkingContext(context),
+    : _ppcLinkingContext(context),
       _ppcTargetLayout(new PPCTargetLayout<PPCELFType>(context)),
       _ppcRelocationHandler(new PPCTargetRelocationHandler(context)) {}
 
index 956e81d..5cc3ed6 100644 (file)
@@ -76,9 +76,6 @@ private:
 /// of creating atoms and how the atoms are written to the output file.
 template <class ELFT> class TargetHandler : public TargetHandlerBase {
 public:
-  /// Constructor
-  TargetHandler(ELFLinkingContext &targetInfo) {}
-
   /// The layout determined completely by the Target.
   virtual TargetLayout<ELFT> &getTargetLayout() = 0;
 
index c12bc24..ec4b11e 100644 (file)
@@ -48,7 +48,6 @@ void X86TargetHandler::registerRelocationNames(Registry &registry) {
 }
 
 X86TargetHandler::X86TargetHandler(X86LinkingContext &context)
-    : DefaultTargetHandler(context), _x86LinkingContext(context),
+    : _x86LinkingContext(context),
       _x86TargetLayout(new X86TargetLayout<X86ELFType>(context)),
-      _x86RelocationHandler(
-          new X86TargetRelocationHandler(context)) {}
+      _x86RelocationHandler(new X86TargetRelocationHandler(context)) {}
index b16a4f4..2eae0fc 100644 (file)
@@ -17,11 +17,10 @@ using namespace lld;
 using namespace elf;
 
 X86_64TargetHandler::X86_64TargetHandler(X86_64LinkingContext &context)
-    : DefaultTargetHandler(context), _context(context),
+    : _context(context),
       _x86_64TargetLayout(new X86_64TargetLayout<X86_64ELFType>(context)),
-      _x86_64RelocationHandler(
-          new X86_64TargetRelocationHandler(*_x86_64TargetLayout.get(),
-                                            context)) {}
+      _x86_64RelocationHandler(new X86_64TargetRelocationHandler(
+          *_x86_64TargetLayout.get(), context)) {}
 
 void X86_64TargetHandler::registerRelocationNames(Registry &registry) {
   registry.addKindTable(Reference::KindNamespace::ELF,