summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Mips
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2015-03-31 19:00:54 +0000
committerSimon Atanasyan <simon@atanasyan.com>2015-03-31 19:00:54 +0000
commitf00d85a809d9182f673cbb359fdafefbc8a64dd8 (patch)
tree7d2f9c2506448cb51a46e837e8500df6b684f979 /lld/lib/ReaderWriter/ELF/Mips
parentacfe7d446beb5cc36f5759747c7a5637f78523db (diff)
downloadbcm5719-llvm-f00d85a809d9182f673cbb359fdafefbc8a64dd8.tar.gz
bcm5719-llvm-f00d85a809d9182f673cbb359fdafefbc8a64dd8.zip
[Mips] Use llvm::make_unique
No functional changes. llvm-svn: 233727
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/Mips')
-rw-r--r--lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h4
-rw-r--r--lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp2
-rw-r--r--lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp6
3 files changed, 5 insertions, 7 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h b/lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h
index c9330317070..49dcc931cbf 100644
--- a/lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h
+++ b/lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h
@@ -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 {
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
index 8362dd54838..a68c19ddc22 100644
--- a/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
@@ -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;
}
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
index 045f614833e..6d88b9b28de 100644
--- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
+++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
@@ -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
OpenPOWER on IntegriCloud