diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-14 22:28:17 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-14 22:28:17 +0000 |
commit | 6ba7992031cc803a01f0622f4899668b15a20a98 (patch) | |
tree | 64a078fe7e002dc2049b3d1cc5143af896c351f1 /lld/lib | |
parent | 736259e3428d36f8024e6b08e4a95167f313d958 (diff) | |
download | llvm-project-6ba7992031cc803a01f0622f4899668b15a20a98.tar.gz |
[LLD] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.
Differential revision: https://reviews.llvm.org/D66259
llvm-svn: 368936
Diffstat (limited to 'lld/lib')
-rw-r--r-- | lld/lib/Driver/DarwinLdDriver.cpp | 8 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/FileArchive.cpp | 2 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp | 2 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/GOTPass.cpp | 2 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/LayoutPass.cpp | 2 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp | 6 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp | 4 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 8 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/ObjCPass.cpp | 2 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/ShimPass.cpp | 2 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/TLVPass.cpp | 2 |
11 files changed, 20 insertions, 20 deletions
diff --git a/lld/lib/Driver/DarwinLdDriver.cpp b/lld/lib/Driver/DarwinLdDriver.cpp index 68dc789479fb..8566ababc655 100644 --- a/lld/lib/Driver/DarwinLdDriver.cpp +++ b/lld/lib/Driver/DarwinLdDriver.cpp @@ -95,7 +95,7 @@ public: static std::vector<std::unique_ptr<File>> makeErrorFile(StringRef path, std::error_code ec) { std::vector<std::unique_ptr<File>> result; - result.push_back(llvm::make_unique<ErrorFile>(path, ec)); + result.push_back(std::make_unique<ErrorFile>(path, ec)); return result; } @@ -160,7 +160,7 @@ static void addFile(StringRef path, MachOLinkingContext &ctx, std::vector<std::unique_ptr<File>> files = loadFile(ctx, path, loadWholeArchive, upwardDylib); for (std::unique_ptr<File> &file : files) - ctx.getNodes().push_back(llvm::make_unique<FileNode>(std::move(file))); + ctx.getNodes().push_back(std::make_unique<FileNode>(std::move(file))); } // Export lists are one symbol per line. Blank lines are ignored. @@ -1138,7 +1138,7 @@ static void createFiles(MachOLinkingContext &ctx, bool Implicit) { ctx.createInternalFiles(Files); for (auto i = Files.rbegin(), e = Files.rend(); i != e; ++i) { auto &members = ctx.getNodes(); - members.insert(members.begin(), llvm::make_unique<FileNode>(std::move(*i))); + members.insert(members.begin(), std::make_unique<FileNode>(std::move(*i))); } } @@ -1185,7 +1185,7 @@ bool link(llvm::ArrayRef<const char *> args, bool CanExitEarly, merged = mergedFile.get(); auto &members = ctx.getNodes(); members.insert(members.begin(), - llvm::make_unique<FileNode>(std::move(mergedFile))); + std::make_unique<FileNode>(std::move(mergedFile))); } resolveTask.end(); diff --git a/lld/lib/ReaderWriter/FileArchive.cpp b/lld/lib/ReaderWriter/FileArchive.cpp index b09bf34dc47c..98f4d06ee210 100644 --- a/lld/lib/ReaderWriter/FileArchive.cpp +++ b/lld/lib/ReaderWriter/FileArchive.cpp @@ -210,7 +210,7 @@ public: const Registry ®) const override { StringRef path = mb->getBufferIdentifier(); std::unique_ptr<File> ret = - llvm::make_unique<FileArchive>(std::move(mb), reg, path, _logLoading); + std::make_unique<FileArchive>(std::move(mb), reg, path, _logLoading); return std::move(ret); } diff --git a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp index de5adb088799..44e6a29a0b60 100644 --- a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp +++ b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp @@ -573,7 +573,7 @@ private: void addCompactUnwindPass(PassManager &pm, const MachOLinkingContext &ctx) { assert(ctx.needsCompactUnwindPass()); - pm.add(llvm::make_unique<CompactUnwindPass>(ctx)); + pm.add(std::make_unique<CompactUnwindPass>(ctx)); } } // end namesapce mach_o diff --git a/lld/lib/ReaderWriter/MachO/GOTPass.cpp b/lld/lib/ReaderWriter/MachO/GOTPass.cpp index bc66d49eafb9..514dd4e09da8 100644 --- a/lld/lib/ReaderWriter/MachO/GOTPass.cpp +++ b/lld/lib/ReaderWriter/MachO/GOTPass.cpp @@ -176,7 +176,7 @@ private: void addGOTPass(PassManager &pm, const MachOLinkingContext &ctx) { assert(ctx.needsGOTPass()); - pm.add(llvm::make_unique<GOTPass>(ctx)); + pm.add(std::make_unique<GOTPass>(ctx)); } } // end namesapce mach_o diff --git a/lld/lib/ReaderWriter/MachO/LayoutPass.cpp b/lld/lib/ReaderWriter/MachO/LayoutPass.cpp index 2718dfcf743f..8db6ffb958a4 100644 --- a/lld/lib/ReaderWriter/MachO/LayoutPass.cpp +++ b/lld/lib/ReaderWriter/MachO/LayoutPass.cpp @@ -478,7 +478,7 @@ llvm::Error LayoutPass::perform(SimpleFile &mergedFile) { } void addLayoutPass(PassManager &pm, const MachOLinkingContext &ctx) { - pm.add(llvm::make_unique<LayoutPass>( + pm.add(std::make_unique<LayoutPass>( ctx.registry(), [&](const DefinedAtom * left, const DefinedAtom * right, bool & leftBeforeRight) ->bool { return ctx.customAtomOrderer(left, right, leftBeforeRight); diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp index 4cb0c6a8ae01..221d895a40d0 100644 --- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp +++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp @@ -802,9 +802,9 @@ void MachOLinkingContext::addSectCreateSection( std::unique_ptr<MemoryBuffer> content) { if (!_sectCreateFile) { - auto sectCreateFile = llvm::make_unique<mach_o::SectCreateFile>(); + auto sectCreateFile = std::make_unique<mach_o::SectCreateFile>(); _sectCreateFile = sectCreateFile.get(); - getNodes().push_back(llvm::make_unique<FileNode>(std::move(sectCreateFile))); + getNodes().push_back(std::make_unique<FileNode>(std::move(sectCreateFile))); } assert(_sectCreateFile && "sectcreate file does not exist."); @@ -1019,7 +1019,7 @@ void MachOLinkingContext::finalizeInputFiles() { return !isLibrary(a) && isLibrary(b); }); size_t numLibs = std::count_if(elements.begin(), elements.end(), isLibrary); - elements.push_back(llvm::make_unique<GroupEnd>(numLibs)); + elements.push_back(std::make_unique<GroupEnd>(numLibs)); } llvm::Error MachOLinkingContext::handleLoadedFile(File &file) { diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp index 38b365374f36..963f1227fa44 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp @@ -542,7 +542,7 @@ public: loadFile(std::unique_ptr<MemoryBuffer> mb, const Registry ®istry) const override { std::unique_ptr<File> ret = - llvm::make_unique<MachOFile>(std::move(mb), &_ctx); + std::make_unique<MachOFile>(std::move(mb), &_ctx); return std::move(ret); } @@ -568,7 +568,7 @@ public: loadFile(std::unique_ptr<MemoryBuffer> mb, const Registry ®istry) const override { std::unique_ptr<File> ret = - llvm::make_unique<MachODylibFile>(std::move(mb), &_ctx); + std::make_unique<MachODylibFile>(std::move(mb), &_ctx); return std::move(ret); } diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index bcddb977b023..f34857b99676 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -717,7 +717,7 @@ llvm::Error parseStabs(MachOFile &file, // FIXME: Kill this off when we can move to sane yaml parsing. std::unique_ptr<BumpPtrAllocator> allocator; if (copyRefs) - allocator = llvm::make_unique<BumpPtrAllocator>(); + allocator = std::make_unique<BumpPtrAllocator>(); enum { start, inBeginEnd } state = start; @@ -812,7 +812,7 @@ llvm::Error parseStabs(MachOFile &file, stabsList.push_back(stab); } - file.setDebugInfo(llvm::make_unique<StabsDebugInfo>(std::move(stabsList))); + file.setDebugInfo(std::make_unique<StabsDebugInfo>(std::move(stabsList))); // FIXME: Kill this off when we fix YAML memory ownership. file.debugInfo()->setAllocator(std::move(allocator)); @@ -974,11 +974,11 @@ llvm::Error parseDebugInfo(MachOFile &file, // memory ownership. std::unique_ptr<BumpPtrAllocator> allocator; if (copyRefs) { - allocator = llvm::make_unique<BumpPtrAllocator>(); + allocator = std::make_unique<BumpPtrAllocator>(); tuOrErr->name = copyDebugString(tuOrErr->name, *allocator); tuOrErr->path = copyDebugString(tuOrErr->path, *allocator); } - file.setDebugInfo(llvm::make_unique<DwarfDebugInfo>(std::move(*tuOrErr))); + file.setDebugInfo(std::make_unique<DwarfDebugInfo>(std::move(*tuOrErr))); if (copyRefs) file.debugInfo()->setAllocator(std::move(allocator)); } else diff --git a/lld/lib/ReaderWriter/MachO/ObjCPass.cpp b/lld/lib/ReaderWriter/MachO/ObjCPass.cpp index df121f0e1d5d..02a95b5aa0c0 100644 --- a/lld/lib/ReaderWriter/MachO/ObjCPass.cpp +++ b/lld/lib/ReaderWriter/MachO/ObjCPass.cpp @@ -124,7 +124,7 @@ private: void addObjCPass(PassManager &pm, const MachOLinkingContext &ctx) { - pm.add(llvm::make_unique<ObjCPass>(ctx)); + pm.add(std::make_unique<ObjCPass>(ctx)); } } // end namespace mach_o diff --git a/lld/lib/ReaderWriter/MachO/ShimPass.cpp b/lld/lib/ReaderWriter/MachO/ShimPass.cpp index b0775ad5fc26..a5b34cfe8de6 100644 --- a/lld/lib/ReaderWriter/MachO/ShimPass.cpp +++ b/lld/lib/ReaderWriter/MachO/ShimPass.cpp @@ -121,7 +121,7 @@ private: void addShimPass(PassManager &pm, const MachOLinkingContext &ctx) { - pm.add(llvm::make_unique<ShimPass>(ctx)); + pm.add(std::make_unique<ShimPass>(ctx)); } } // end namespace mach_o diff --git a/lld/lib/ReaderWriter/MachO/TLVPass.cpp b/lld/lib/ReaderWriter/MachO/TLVPass.cpp index 89b655e1f888..5f457b863d90 100644 --- a/lld/lib/ReaderWriter/MachO/TLVPass.cpp +++ b/lld/lib/ReaderWriter/MachO/TLVPass.cpp @@ -133,7 +133,7 @@ private: void addTLVPass(PassManager &pm, const MachOLinkingContext &ctx) { assert(ctx.needsTLVPass()); - pm.add(llvm::make_unique<TLVPass>(ctx)); + pm.add(std::make_unique<TLVPass>(ctx)); } } // end namesapce mach_o |