[Mips] Use llvm::make_unique

No functional changes.

llvm-svn: 233727
This commit is contained in:
Simon Atanasyan 2015-03-31 19:00:54 +00:00
parent acfe7d446b
commit f00d85a809
3 changed files with 5 additions and 7 deletions

View File

@ -13,6 +13,7 @@
#include "MipsLinkingContext.h"
#include "MipsReginfo.h"
#include "MipsRelocationHandler.h"
#include "llvm/ADT/STLExtras.h"
namespace lld {
namespace elf {
@ -92,8 +93,7 @@ public:
static ErrorOr<std::unique_ptr<MipsELFFile>>
create(std::unique_ptr<MemoryBuffer> mb, MipsLinkingContext &ctx) {
return std::unique_ptr<MipsELFFile<ELFT>>(
new MipsELFFile<ELFT>(std::move(mb), ctx));
return llvm::make_unique<MipsELFFile<ELFT>>(std::move(mb), ctx);
}
bool isPIC() const {

View File

@ -20,7 +20,7 @@ std::unique_ptr<ELFLinkingContext>
MipsLinkingContext::create(llvm::Triple triple) {
if (triple.getArch() == llvm::Triple::mipsel ||
triple.getArch() == llvm::Triple::mips64el)
return std::unique_ptr<ELFLinkingContext>(new MipsLinkingContext(triple));
return llvm::make_unique<MipsLinkingContext>(triple);
return nullptr;
}

View File

@ -599,15 +599,13 @@ namespace elf {
template <>
std::unique_ptr<TargetRelocationHandler>
createMipsRelocationHandler<Mips32ELType>(MipsLinkingContext &ctx) {
return std::unique_ptr<TargetRelocationHandler>(
new RelocationHandler<Mips32ELType>(ctx));
return llvm::make_unique<RelocationHandler<Mips32ELType>>(ctx);
}
template <>
std::unique_ptr<TargetRelocationHandler>
createMipsRelocationHandler<Mips64ELType>(MipsLinkingContext &ctx) {
return std::unique_ptr<TargetRelocationHandler>(
new RelocationHandler<Mips64ELType>(ctx));
return llvm::make_unique<RelocationHandler<Mips64ELType>>(ctx);
}
} // elf