From 2b3d49b610bd2a45884115edcb21110bfa325f51 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 14 Aug 2019 23:04:18 +0000 Subject: [Clang] 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: 368942 --- clang/lib/Frontend/CompilerInstance.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 6948e1f2d61..c7dedb78ed8 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -215,7 +215,7 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts, raw_ostream *OS = &llvm::errs(); if (DiagOpts->DiagnosticLogFile != "-") { // Create the output stream. - auto FileOS = llvm::make_unique( + auto FileOS = std::make_unique( DiagOpts->DiagnosticLogFile, EC, llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text); if (EC) { @@ -229,7 +229,7 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts, } // Chain in the diagnostic client which will log the diagnostics. - auto Logger = llvm::make_unique(*OS, DiagOpts, + auto Logger = std::make_unique(*OS, DiagOpts, std::move(StreamOwner)); if (CodeGenOpts) Logger->setDwarfDebugFlags(CodeGenOpts->DwarfDebugFlags); @@ -667,7 +667,7 @@ CompilerInstance::createDefaultOutputFile(bool Binary, StringRef InFile, } std::unique_ptr CompilerInstance::createNullOutputFile() { - return llvm::make_unique(); + return std::make_unique(); } std::unique_ptr @@ -793,7 +793,7 @@ std::unique_ptr CompilerInstance::createOutputFile( if (!Binary || OS->supportsSeeking()) return std::move(OS); - auto B = llvm::make_unique(*OS); + auto B = std::make_unique(*OS); assert(!NonSeekStream); NonSeekStream = std::move(OS); return std::move(B); @@ -988,7 +988,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { StringRef StatsFile = getFrontendOpts().StatsFile; if (!StatsFile.empty()) { std::error_code EC; - auto StatS = llvm::make_unique( + auto StatS = std::make_unique( StatsFile, EC, llvm::sys::fs::OF_Text); if (EC) { getDiagnostics().Report(diag::warn_fe_unable_to_open_stats_file) @@ -1471,7 +1471,7 @@ void CompilerInstance::createModuleManager() { const PreprocessorOptions &PPOpts = getPreprocessorOpts(); std::unique_ptr ReadTimer; if (FrontendTimerGroup) - ReadTimer = llvm::make_unique("reading_modules", + ReadTimer = std::make_unique("reading_modules", "Reading modules", *FrontendTimerGroup); ModuleManager = new ASTReader( @@ -1566,7 +1566,7 @@ bool CompilerInstance::loadModuleFile(StringRef FileName) { SourceLocation()) <= DiagnosticsEngine::Warning; - auto Listener = llvm::make_unique(*this); + auto Listener = std::make_unique(*this); auto &ListenerRef = *Listener; ASTReader::ListenerScope ReadModuleNamesListener(*ModuleManager, std::move(Listener)); -- cgit v1.2.3