diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-15 15:54:37 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-15 15:54:37 +0000 |
commit | 0eaee545eef49ff9498234d3a51a5cbde59bf976 (patch) | |
tree | fd7691e102022fb97622c5485fa8c4f506fc124e /llvm/lib/LTO | |
parent | 1c34d10776828c0756ff4f0b2b9aa8bda2be348a (diff) | |
download | bcm5719-llvm-0eaee545eef49ff9498234d3a51a5cbde59bf976.tar.gz bcm5719-llvm-0eaee545eef49ff9498234d3a51a5cbde59bf976.zip |
[llvm] 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.
llvm-svn: 369013
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r-- | llvm/lib/LTO/Caching.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/LTO/LTOCodeGenerator.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 6 |
5 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/LTO/Caching.cpp b/llvm/lib/LTO/Caching.cpp index 000ab91dba7..12dcd182de2 100644 --- a/llvm/lib/LTO/Caching.cpp +++ b/llvm/lib/LTO/Caching.cpp @@ -142,8 +142,8 @@ Expected<NativeObjectCache> lto::localCache(StringRef CacheDirectoryPath, } // This CacheStream will move the temporary file into the cache when done. - return llvm::make_unique<CacheStream>( - llvm::make_unique<raw_fd_ostream>(Temp->FD, /* ShouldClose */ false), + return std::make_unique<CacheStream>( + std::make_unique<raw_fd_ostream>(Temp->FD, /* ShouldClose */ false), AddBuffer, std::move(*Temp), EntryPath.str(), Task); }; }; diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index a67fa941696..0ada5015c0a 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -460,8 +460,8 @@ BitcodeModule &InputFile::getSingleBitcodeModule() { LTO::RegularLTOState::RegularLTOState(unsigned ParallelCodeGenParallelismLevel, Config &Conf) : ParallelCodeGenParallelismLevel(ParallelCodeGenParallelismLevel), - Ctx(Conf), CombinedModule(llvm::make_unique<Module>("ld-temp.o", Ctx)), - Mover(llvm::make_unique<IRMover>(*CombinedModule)) {} + Ctx(Conf), CombinedModule(std::make_unique<Module>("ld-temp.o", Ctx)), + Mover(std::make_unique<IRMover>(*CombinedModule)) {} LTO::ThinLTOState::ThinLTOState(ThinBackend Backend) : Backend(Backend), CombinedIndex(/*HaveGVs*/ false) { @@ -1142,7 +1142,7 @@ ThinBackend lto::createInProcessThinBackend(unsigned ParallelismLevel) { return [=](Config &Conf, ModuleSummaryIndex &CombinedIndex, const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries, AddStreamFn AddStream, NativeObjectCache Cache) { - return llvm::make_unique<InProcessThinBackend>( + return std::make_unique<InProcessThinBackend>( Conf, CombinedIndex, ParallelismLevel, ModuleToDefinedGVSummaries, AddStream, Cache); }; @@ -1232,7 +1232,7 @@ ThinBackend lto::createWriteIndexesThinBackend( return [=](Config &Conf, ModuleSummaryIndex &CombinedIndex, const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries, AddStreamFn AddStream, NativeObjectCache Cache) { - return llvm::make_unique<WriteIndexesThinBackend>( + return std::make_unique<WriteIndexesThinBackend>( Conf, CombinedIndex, ModuleToDefinedGVSummaries, OldPrefix, NewPrefix, ShouldEmitImportsFiles, LinkedObjectsFile, OnWrite); }; @@ -1382,7 +1382,7 @@ lto::setupStatsFile(StringRef StatsFilename) { llvm::EnableStatistics(false); std::error_code EC; auto StatsFile = - llvm::make_unique<ToolOutputFile>(StatsFilename, EC, sys::fs::OF_None); + std::make_unique<ToolOutputFile>(StatsFilename, EC, sys::fs::OF_None); if (EC) return errorCodeToError(EC); diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index 1879b40808a..1f4ecf0fe61 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -57,7 +57,7 @@ Error Config::addSaveTemps(std::string OutputFileName, ShouldDiscardValueNames = false; std::error_code EC; - ResolutionFile = llvm::make_unique<raw_fd_ostream>( + ResolutionFile = std::make_unique<raw_fd_ostream>( OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::OF_Text); if (EC) return errorCodeToError(EC); @@ -329,7 +329,7 @@ void codegen(Config &Conf, TargetMachine *TM, AddStreamFn AddStream, if (!DwoFile.empty()) { std::error_code EC; - DwoOut = llvm::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::OF_None); + DwoOut = std::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::OF_None); if (EC) report_fatal_error("Failed to open " + DwoFile + ": " + EC.message()); } diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index c1a19fae90f..bd03184b03c 100644 --- a/llvm/lib/LTO/LTOCodeGenerator.cpp +++ b/llvm/lib/LTO/LTOCodeGenerator.cpp @@ -174,7 +174,7 @@ void LTOCodeGenerator::setModule(std::unique_ptr<LTOModule> Mod) { AsmUndefinedRefs.clear(); MergedModule = Mod->takeModule(); - TheLinker = make_unique<Linker>(*MergedModule); + TheLinker = std::make_unique<Linker>(*MergedModule); setAsmUndefinedRefs(&*Mod); // We've just changed the input, so let's make sure we verify it. @@ -690,7 +690,7 @@ LTOCodeGenerator::setDiagnosticHandler(lto_diagnostic_handler_t DiagHandler, return Context.setDiagnosticHandler(nullptr); // Register the LTOCodeGenerator stub in the LLVMContext to forward the // diagnostic to the external DiagHandler. - Context.setDiagnosticHandler(llvm::make_unique<LTODiagnosticHandler>(this), + Context.setDiagnosticHandler(std::make_unique<LTODiagnosticHandler>(this), true); } diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index 70d61c97c72..eada2529e82 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -295,7 +295,7 @@ std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, // Run codegen now. resulting binary is in OutputBuffer. PM.run(TheModule); } - return make_unique<SmallVectorMemoryBuffer>(std::move(OutputBuffer)); + return std::make_unique<SmallVectorMemoryBuffer>(std::move(OutputBuffer)); } /// Manage caching for a single Module. @@ -442,7 +442,7 @@ ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); WriteBitcodeToFile(TheModule, OS, true, &Index); } - return make_unique<SmallVectorMemoryBuffer>(std::move(OutputBuffer)); + return std::make_unique<SmallVectorMemoryBuffer>(std::move(OutputBuffer)); } return codegenModule(TheModule, TM); @@ -557,7 +557,7 @@ std::unique_ptr<TargetMachine> TargetMachineBuilder::create() const { */ std::unique_ptr<ModuleSummaryIndex> ThinLTOCodeGenerator::linkCombinedIndex() { std::unique_ptr<ModuleSummaryIndex> CombinedIndex = - llvm::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false); + std::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false); uint64_t NextModuleId = 0; for (auto &Mod : Modules) { auto &M = Mod->getSingleBitcodeModule(); |