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

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

llvm-svn: 233888
This commit is contained in:
Rui Ueyama 2015-04-02 04:48:30 +00:00
parent 4ff3ed5960
commit 4229b946a8
2 changed files with 5 additions and 14 deletions

View File

@ -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 @@ public:
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");

View File

@ -83,20 +83,13 @@ private:
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 TargetHandler for Mips
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);
@ -127,7 +120,6 @@ public:
private:
MipsLinkingContext &_ctx;
std::unique_ptr<MipsRuntimeFile<ELFT>> _runtimeFile;
std::unique_ptr<MipsTargetLayout<ELFT>> _targetLayout;
std::unique_ptr<TargetRelocationHandler> _relocationHandler;
};