diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64ELFReader.h b/lld/lib/ReaderWriter/ELF/AArch64/AArch64ELFReader.h deleted file mode 100644 index 025b02735534..000000000000 --- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64ELFReader.h +++ /dev/null @@ -1,30 +0,0 @@ -//===- lib/ReaderWriter/ELF/AArch64/AArch64ELFReader.h --------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_READER_WRITER_AARCH64_AARCH64_ELF_READER_H -#define LLD_READER_WRITER_AARCH64_AARCH64_ELF_READER_H - -#include "ELFReader.h" - -namespace lld { -namespace elf { - -class AArch64LinkingContext; - -typedef llvm::object::ELFType AArch64ELFType; - -typedef ELFObjectReader AArch64ELFObjectReader; - -typedef ELFDSOReader AArch64ELFDSOReader; - -} // namespace elf -} // namespace lld - -#endif // LLD_READER_WRITER_AARCH64_AARCH64_ELF_READER_H diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.h b/lld/lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.h index 476a9f87ceb1..9eafc4c9f1a0 100644 --- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.h @@ -10,8 +10,8 @@ #ifndef LLD_READER_WRITER_ELF_AARCH64_AARCH64_TARGET_HANDLER_H #define LLD_READER_WRITER_ELF_AARCH64_AARCH64_TARGET_HANDLER_H -#include "AArch64ELFReader.h" #include "AArch64RelocationHandler.h" +#include "ELFReader.h" #include "TargetLayout.h" #include "lld/Core/Simple.h" @@ -20,6 +20,11 @@ namespace elf { class AArch64LinkingContext; class AArch64TargetHandler final : public TargetHandler { + typedef llvm::object::ELFType ELFTy; + typedef ELFObjectReader + ObjReader; + typedef ELFDSOReader DSOReader; + public: AArch64TargetHandler(AArch64LinkingContext &ctx); @@ -28,18 +33,18 @@ public: } std::unique_ptr getObjReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getDSOReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getWriter() override; private: AArch64LinkingContext &_ctx; - std::unique_ptr> _targetLayout; + std::unique_ptr> _targetLayout; std::unique_ptr _relocationHandler; }; diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMELFReader.h b/lld/lib/ReaderWriter/ELF/ARM/ARMELFReader.h deleted file mode 100644 index 299fe2821856..000000000000 --- a/lld/lib/ReaderWriter/ELF/ARM/ARMELFReader.h +++ /dev/null @@ -1,28 +0,0 @@ -//===--------- lib/ReaderWriter/ELF/ARM/ARMELFReader.h --------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_READER_WRITER_ARM_ARM_ELF_READER_H -#define LLD_READER_WRITER_ARM_ARM_ELF_READER_H - -#include "ARMELFFile.h" -#include "ELFReader.h" - -namespace lld { -namespace elf { - -typedef llvm::object::ELFType ARMELFType; - -typedef ELFObjectReader - ARMELFObjectReader; -typedef ELFDSOReader ARMELFDSOReader; - -} // namespace elf -} // namespace lld - -#endif // LLD_READER_WRITER_ARM_ARM_ELF_READER_H diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMTargetHandler.h b/lld/lib/ReaderWriter/ELF/ARM/ARMTargetHandler.h index a1cb30a6be4f..0430ecc0e725 100644 --- a/lld/lib/ReaderWriter/ELF/ARM/ARMTargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/ARM/ARMTargetHandler.h @@ -11,8 +11,8 @@ #define LLD_READER_WRITER_ELF_ARM_ARM_TARGET_HANDLER_H #include "ARMELFFile.h" -#include "ARMELFReader.h" #include "ARMRelocationHandler.h" +#include "ELFReader.h" #include "TargetLayout.h" #include "llvm/ADT/Optional.h" @@ -60,6 +60,11 @@ private: }; class ARMTargetHandler final : public TargetHandler { + typedef llvm::object::ELFType ELFTy; + typedef ELFObjectReader + ObjReader; + typedef ELFDSOReader DSOReader; + public: ARMTargetHandler(ARMLinkingContext &ctx); @@ -68,18 +73,18 @@ public: } std::unique_ptr getObjReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getDSOReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getWriter() override; private: ARMLinkingContext &_ctx; - std::unique_ptr> _targetLayout; + std::unique_ptr> _targetLayout; std::unique_ptr _relocationHandler; }; diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h deleted file mode 100644 index 8706ecac45ff..000000000000 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h +++ /dev/null @@ -1,28 +0,0 @@ -//===- lib/ReaderWriter/ELF/HexagonELFReader.h ----------------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_READER_WRITER_HEXAGON_ELF_READER_H -#define LLD_READER_WRITER_HEXAGON_ELF_READER_H - -#include "ELFReader.h" -#include "HexagonELFFile.h" - -namespace lld { -namespace elf { - -typedef llvm::object::ELFType HexagonELFType; - -typedef ELFObjectReader HexagonELFObjectReader; -typedef ELFDSOReader HexagonELFDSOReader; - -} // namespace elf -} // namespace lld - -#endif // LLD_READER_WRITER_ELF_READER_H diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h index facecf55670c..0f5b73befe9c 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h @@ -10,7 +10,8 @@ #ifndef HEXAGON_TARGET_HANDLER_H #define HEXAGON_TARGET_HANDLER_H -#include "HexagonELFReader.h" +#include "ELFReader.h" +#include "HexagonELFFile.h" #include "HexagonExecutableAtoms.h" #include "HexagonRelocationHandler.h" #include "HexagonSectionChunks.h" @@ -97,6 +98,11 @@ private: /// \brief TargetHandler for Hexagon class HexagonTargetHandler final : public TargetHandler { + typedef llvm::object::ELFType ELFTy; + typedef ELFObjectReader ObjReader; + typedef ELFDSOReader ELFDSOReader; + public: HexagonTargetHandler(HexagonLinkingContext &targetInfo); @@ -105,19 +111,19 @@ public: } std::unique_ptr getObjReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getDSOReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getWriter() override; private: HexagonLinkingContext &_ctx; - std::unique_ptr> _runtimeFile; - std::unique_ptr> _targetLayout; + std::unique_ptr> _runtimeFile; + std::unique_ptr> _targetLayout; std::unique_ptr _relocationHandler; }; diff --git a/lld/lib/ReaderWriter/ELF/X86/X86ELFReader.h b/lld/lib/ReaderWriter/ELF/X86/X86ELFReader.h deleted file mode 100644 index 94a2141e9602..000000000000 --- a/lld/lib/ReaderWriter/ELF/X86/X86ELFReader.h +++ /dev/null @@ -1,28 +0,0 @@ -//===- lib/ReaderWriter/ELF/X86/X86ELFReader.h ----------------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_READER_WRITER_X86_X86_ELF_READER_H -#define LLD_READER_WRITER_X86_X86_ELF_READER_H - -#include "ELFReader.h" - -namespace lld { -namespace elf { - -class X86LinkingContext; -typedef llvm::object::ELFType X86ELFType; - -typedef ELFObjectReader - X86ELFObjectReader; -typedef ELFDSOReader X86ELFDSOReader; - -} // namespace elf -} // namespace lld - -#endif // LLD_READER_WRITER_X86_X86_ELF_READER_H diff --git a/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.h b/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.h index b1f67278c35a..75ee6be8d6bb 100644 --- a/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.h @@ -11,7 +11,7 @@ #define LLD_READER_WRITER_ELF_X86_TARGET_HANDLER_H #include "TargetLayout.h" -#include "X86ELFReader.h" +#include "ELFReader.h" #include "X86RelocationHandler.h" namespace lld { @@ -20,6 +20,11 @@ namespace elf { class X86LinkingContext; class X86TargetHandler final : public TargetHandler { + typedef llvm::object::ELFType ELFTy; + typedef ELFObjectReader + ObjReader; + typedef ELFDSOReader DSOReader; + public: X86TargetHandler(X86LinkingContext &ctx); @@ -28,18 +33,18 @@ public: } std::unique_ptr getObjReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getDSOReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getWriter() override; protected: X86LinkingContext &_ctx; - std::unique_ptr> _targetLayout; + std::unique_ptr> _targetLayout; std::unique_ptr _relocationHandler; }; } // end namespace elf diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64ELFReader.h b/lld/lib/ReaderWriter/ELF/X86_64/X86_64ELFReader.h deleted file mode 100644 index 85e0030a96a9..000000000000 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64ELFReader.h +++ /dev/null @@ -1,28 +0,0 @@ -//===- lib/ReaderWriter/ELF/X86_64/X86_64ELFReader.h ----------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_READER_WRITER_X86_64_X86_64_ELF_READER_H -#define LLD_READER_WRITER_X86_64_X86_64_ELF_READER_H - -#include "ELFReader.h" - -namespace lld { -namespace elf { - -class X86_64LinkingContext; -typedef llvm::object::ELFType X86_64ELFType; - -typedef ELFObjectReader - X86_64ELFObjectReader; -typedef ELFDSOReader X86_64ELFDSOReader; - -} // namespace elf -} // namespace lld - -#endif // LLD_READER_WRITER_ELF_X86_64_X86_64_READER_H diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h b/lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h index aa863746fcbe..f0760d726989 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h @@ -10,8 +10,8 @@ #ifndef LLD_READER_WRITER_ELF_X86_64_X86_64_TARGET_HANDLER_H #define LLD_READER_WRITER_ELF_X86_64_X86_64_TARGET_HANDLER_H +#include "ELFReader.h" #include "TargetLayout.h" -#include "X86_64ELFReader.h" #include "X86_64LinkingContext.h" #include "X86_64RelocationHandler.h" #include "lld/Core/Simple.h" @@ -58,6 +58,11 @@ private: }; class X86_64TargetHandler : public TargetHandler { + typedef llvm::object::ELFType ELFTy; + typedef ELFObjectReader + ObjReader; + typedef ELFDSOReader DSOReader; + public: X86_64TargetHandler(X86_64LinkingContext &ctx); @@ -66,11 +71,11 @@ public: } std::unique_ptr getObjReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getDSOReader() override { - return llvm::make_unique(_ctx); + return llvm::make_unique(_ctx); } std::unique_ptr getWriter() override;