Files
clang-p2996/lld/lib/ReaderWriter/ELF/ARM/ARMTargetHandler.cpp
Rui Ueyama a5b6859ac4 ELF: Use less templates for ELF types.
These classes are templated but actually instantiated for only
one ELF type.

llvm-svn: 234830
2015-04-14 00:59:04 +00:00

30 lines
949 B
C++

//===--------- lib/ReaderWriter/ELF/ARM/ARMTargetHandler.cpp --------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "Atoms.h"
#include "ARMExecutableWriter.h"
#include "ARMTargetHandler.h"
#include "ARMLinkingContext.h"
using namespace lld;
using namespace elf;
ARMTargetHandler::ARMTargetHandler(ARMLinkingContext &ctx)
: _ctx(ctx), _targetLayout(new ARMTargetLayout(ctx)),
_relocationHandler(new ARMTargetRelocationHandler(*_targetLayout)) {}
std::unique_ptr<Writer> ARMTargetHandler::getWriter() {
switch (this->_ctx.getOutputELFType()) {
case llvm::ELF::ET_EXEC:
return llvm::make_unique<ARMExecutableWriter>(_ctx, *_targetLayout);
default:
llvm_unreachable("unsupported output type");
}
}