From 49a6b091014f0033829e099ea7ac50bc7b6e9c32 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368942 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/ASTConsumers.cpp | 8 ++++---- lib/Frontend/ASTUnit.cpp | 14 +++++++------- lib/Frontend/ChainedIncludesSource.cpp | 2 +- lib/Frontend/CompilerInstance.cpp | 14 +++++++------- lib/Frontend/CreateInvocationFromCommandLine.cpp | 2 +- lib/Frontend/DependencyFile.cpp | 6 +++--- lib/Frontend/DependencyGraph.cpp | 2 +- lib/Frontend/FrontendAction.cpp | 2 +- lib/Frontend/FrontendActions.cpp | 20 ++++++++++---------- lib/Frontend/HeaderIncludeGen.cpp | 2 +- lib/Frontend/InterfaceStubFunctionsConsumer.cpp | 4 ++-- lib/Frontend/ModuleDependencyCollector.cpp | 6 +++--- lib/Frontend/MultiplexConsumer.cpp | 4 ++-- lib/Frontend/PrecompiledPreamble.cpp | 4 ++-- lib/Frontend/PrintPreprocessedOutput.cpp | 2 +- lib/Frontend/Rewrite/FrontendActions.cpp | 4 ++-- lib/Frontend/Rewrite/HTMLPrint.cpp | 2 +- lib/Frontend/Rewrite/RewriteModernObjC.cpp | 2 +- lib/Frontend/Rewrite/RewriteObjC.cpp | 2 +- lib/Frontend/SerializedDiagnosticPrinter.cpp | 6 +++--- lib/Frontend/VerifyDiagnosticConsumer.cpp | 6 +++--- 21 files changed, 57 insertions(+), 57 deletions(-) (limited to 'lib/Frontend') diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 26154ee2e8..043b2541b8 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -139,7 +139,7 @@ namespace { std::unique_ptr clang::CreateASTPrinter(std::unique_ptr Out, StringRef FilterString) { - return llvm::make_unique(std::move(Out), ASTPrinter::Print, + return std::make_unique(std::move(Out), ASTPrinter::Print, ADOF_Default, FilterString); } @@ -148,7 +148,7 @@ clang::CreateASTDumper(std::unique_ptr Out, StringRef FilterString, bool DumpDecls, bool Deserialize, bool DumpLookups, ASTDumpOutputFormat Format) { assert((DumpDecls || Deserialize || DumpLookups) && "nothing to dump"); - return llvm::make_unique(std::move(Out), + return std::make_unique(std::move(Out), Deserialize ? ASTPrinter::DumpFull : DumpDecls ? ASTPrinter::Dump : ASTPrinter::None, Format, @@ -156,7 +156,7 @@ clang::CreateASTDumper(std::unique_ptr Out, StringRef FilterString, } std::unique_ptr clang::CreateASTDeclNodeLister() { - return llvm::make_unique(nullptr); + return std::make_unique(nullptr); } //===----------------------------------------------------------------------===// @@ -193,5 +193,5 @@ void ASTViewer::HandleTopLevelSingleDecl(Decl *D) { } std::unique_ptr clang::CreateASTViewer() { - return llvm::make_unique(); + return std::make_unique(); } diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 7e3f7a2f13..ac6e6b6048 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -819,7 +819,7 @@ std::unique_ptr ASTUnit::LoadFromASTFile( /*isysroot=*/"", /*DisableValidation=*/disableValid, AllowPCHWithCompilerErrors); - AST->Reader->setListener(llvm::make_unique( + AST->Reader->setListener(std::make_unique( *AST->PP, AST->Ctx.get(), *AST->HSOpts, *AST->PPOpts, *AST->LangOpts, AST->TargetOpts, AST->Target, Counter)); @@ -999,9 +999,9 @@ public: std::unique_ptr CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override { CI.getPreprocessor().addPPCallbacks( - llvm::make_unique( + std::make_unique( Unit.getCurrentTopLevelHashValue())); - return llvm::make_unique( + return std::make_unique( Unit, Unit.getCurrentTopLevelHashValue()); } @@ -1049,7 +1049,7 @@ public: } std::unique_ptr createPPCallbacks() override { - return llvm::make_unique(Hash); + return std::make_unique(Hash); } private: @@ -1624,15 +1624,15 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction( if (Persistent && !TrackerAct) { Clang->getPreprocessor().addPPCallbacks( - llvm::make_unique( + std::make_unique( AST->getCurrentTopLevelHashValue())); std::vector> Consumers; if (Clang->hasASTConsumer()) Consumers.push_back(Clang->takeASTConsumer()); - Consumers.push_back(llvm::make_unique( + Consumers.push_back(std::make_unique( *AST, AST->getCurrentTopLevelHashValue())); Clang->setASTConsumer( - llvm::make_unique(std::move(Consumers))); + std::make_unique(std::move(Consumers))); } if (llvm::Error Err = Act->Execute()) { consumeError(std::move(Err)); // FIXME this drops errors on the floor. diff --git a/lib/Frontend/ChainedIncludesSource.cpp b/lib/Frontend/ChainedIncludesSource.cpp index 48154ecf47..29fee7246d 100644 --- a/lib/Frontend/ChainedIncludesSource.cpp +++ b/lib/Frontend/ChainedIncludesSource.cpp @@ -158,7 +158,7 @@ IntrusiveRefCntPtr clang::createChainedIncludesSource( auto Buffer = std::make_shared(); ArrayRef> Extensions; - auto consumer = llvm::make_unique( + auto consumer = std::make_unique( Clang->getPreprocessor(), Clang->getModuleCache(), "-", /*isysroot=*/"", Buffer, Extensions, /*AllowASTWithErrors=*/true); Clang->getASTContext().setASTMutationListener( diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 6948e1f2d6..c7dedb78ed 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/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)); diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index b62416ffd9..d70a3b9a42 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -94,7 +94,7 @@ std::unique_ptr clang::createInvocationFromCommandLine( } const ArgStringList &CCArgs = Cmd.getArguments(); - auto CI = llvm::make_unique(); + auto CI = std::make_unique(); if (!CompilerInvocation::CreateFromArgs(*CI, const_cast(CCArgs.data()), const_cast(CCArgs.data()) + diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp index 152fe0360f..a80f9b9cdd 100644 --- a/lib/Frontend/DependencyFile.cpp +++ b/lib/Frontend/DependencyFile.cpp @@ -168,13 +168,13 @@ bool DependencyCollector::sawDependency(StringRef Filename, bool FromModule, DependencyCollector::~DependencyCollector() { } void DependencyCollector::attachToPreprocessor(Preprocessor &PP) { - PP.addPPCallbacks(llvm::make_unique( + PP.addPPCallbacks(std::make_unique( *this, PP.getSourceManager(), PP.getDiagnostics())); PP.getHeaderSearchInfo().getModuleMap().addModuleMapCallbacks( - llvm::make_unique(*this)); + std::make_unique(*this)); } void DependencyCollector::attachToASTReader(ASTReader &R) { - R.addListener(llvm::make_unique(*this)); + R.addListener(std::make_unique(*this)); } DependencyFileGenerator::DependencyFileGenerator( diff --git a/lib/Frontend/DependencyGraph.cpp b/lib/Frontend/DependencyGraph.cpp index a123f1c689..ccf7a27855 100644 --- a/lib/Frontend/DependencyGraph.cpp +++ b/lib/Frontend/DependencyGraph.cpp @@ -61,7 +61,7 @@ public: void clang::AttachDependencyGraphGen(Preprocessor &PP, StringRef OutputFile, StringRef SysRoot) { - PP.addPPCallbacks(llvm::make_unique(&PP, OutputFile, + PP.addPPCallbacks(std::make_unique(&PP, OutputFile, SysRoot)); } diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index fdbb270a75..b3b7976f8f 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -216,7 +216,7 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, Consumers.push_back(std::move(C)); } - return llvm::make_unique(std::move(Consumers)); + return std::make_unique(std::move(Consumers)); } /// For preprocessed files, if the first line is the linemarker and specifies diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index 14db8788c7..08826c2fea 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -55,7 +55,7 @@ void EnsureSemaIsCreated(CompilerInstance &CI, FrontendAction &Action) { std::unique_ptr InitOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique(); + return std::make_unique(); } void InitOnlyAction::ExecuteAction() { @@ -109,7 +109,7 @@ GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { const auto &FrontendOpts = CI.getFrontendOpts(); auto Buffer = std::make_shared(); std::vector> Consumers; - Consumers.push_back(llvm::make_unique( + Consumers.push_back(std::make_unique( CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer, FrontendOpts.ModuleFileExtensions, CI.getPreprocessorOpts().AllowPCHWithCompilerErrors, @@ -117,7 +117,7 @@ GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator( CI, InFile, OutputFile, std::move(OS), Buffer)); - return llvm::make_unique(std::move(Consumers)); + return std::make_unique(std::move(Consumers)); } bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI, @@ -172,7 +172,7 @@ GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI, auto Buffer = std::make_shared(); std::vector> Consumers; - Consumers.push_back(llvm::make_unique( + Consumers.push_back(std::make_unique( CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer, CI.getFrontendOpts().ModuleFileExtensions, /*AllowASTWithErrors=*/false, @@ -182,7 +182,7 @@ GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI, +CI.getFrontendOpts().BuildingImplicitModule)); Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator( CI, InFile, OutputFile, std::move(OS), Buffer)); - return llvm::make_unique(std::move(Consumers)); + return std::make_unique(std::move(Consumers)); } bool GenerateModuleFromModuleMapAction::BeginSourceFileAction( @@ -313,18 +313,18 @@ SyntaxOnlyAction::~SyntaxOnlyAction() { std::unique_ptr SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique(); + return std::make_unique(); } std::unique_ptr DumpModuleInfoAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique(); + return std::make_unique(); } std::unique_ptr VerifyPCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique(); + return std::make_unique(); } void VerifyPCHAction::ExecuteAction() { @@ -466,7 +466,7 @@ private: std::unique_ptr TemplightDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique(); + return std::make_unique(); } void TemplightDumpAction::ExecuteAction() { @@ -479,7 +479,7 @@ void TemplightDumpAction::ExecuteAction() { EnsureSemaIsCreated(CI, *this); CI.getSema().TemplateInstCallbacks.push_back( - llvm::make_unique()); + std::make_unique()); ASTFrontendAction::ExecuteAction(); } diff --git a/lib/Frontend/HeaderIncludeGen.cpp b/lib/Frontend/HeaderIncludeGen.cpp index 821a7e2cd9..5f91157816 100644 --- a/lib/Frontend/HeaderIncludeGen.cpp +++ b/lib/Frontend/HeaderIncludeGen.cpp @@ -120,7 +120,7 @@ void clang::AttachHeaderIncludeGen(Preprocessor &PP, // the GNU way to generate rules is -M / -MM / -MD / -MMD. for (const auto &Header : DepOpts.ExtraDeps) PrintHeaderInfo(OutputFile, Header, ShowDepth, 2, MSStyle); - PP.addPPCallbacks(llvm::make_unique( + PP.addPPCallbacks(std::make_unique( &PP, ShowAllHeaders, OutputFile, DepOpts, OwnsOutputFile, ShowDepth, MSStyle)); } diff --git a/lib/Frontend/InterfaceStubFunctionsConsumer.cpp b/lib/Frontend/InterfaceStubFunctionsConsumer.cpp index fbba9ae4d6..970f8853a0 100644 --- a/lib/Frontend/InterfaceStubFunctionsConsumer.cpp +++ b/lib/Frontend/InterfaceStubFunctionsConsumer.cpp @@ -366,13 +366,13 @@ public: std::unique_ptr GenerateInterfaceYAMLExpV1Action::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique( + return std::make_unique( CI, InFile, "experimental-yaml-elf-v1"); } std::unique_ptr GenerateInterfaceTBEExpV1Action::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique( + return std::make_unique( CI, InFile, "experimental-tapi-elf-v1"); } diff --git a/lib/Frontend/ModuleDependencyCollector.cpp b/lib/Frontend/ModuleDependencyCollector.cpp index 4398d5f36a..fd22433d31 100644 --- a/lib/Frontend/ModuleDependencyCollector.cpp +++ b/lib/Frontend/ModuleDependencyCollector.cpp @@ -99,14 +99,14 @@ struct ModuleDependencyMMCallbacks : public ModuleMapCallbacks { } void ModuleDependencyCollector::attachToASTReader(ASTReader &R) { - R.addListener(llvm::make_unique(*this)); + R.addListener(std::make_unique(*this)); } void ModuleDependencyCollector::attachToPreprocessor(Preprocessor &PP) { - PP.addPPCallbacks(llvm::make_unique( + PP.addPPCallbacks(std::make_unique( *this, PP.getSourceManager())); PP.getHeaderSearchInfo().getModuleMap().addModuleMapCallbacks( - llvm::make_unique(*this)); + std::make_unique(*this)); } static bool isCaseSensitivePath(StringRef Path) { diff --git a/lib/Frontend/MultiplexConsumer.cpp b/lib/Frontend/MultiplexConsumer.cpp index ed7028769d..04e896296c 100644 --- a/lib/Frontend/MultiplexConsumer.cpp +++ b/lib/Frontend/MultiplexConsumer.cpp @@ -249,11 +249,11 @@ MultiplexConsumer::MultiplexConsumer( } if (!mutationListeners.empty()) { MutationListener = - llvm::make_unique(mutationListeners); + std::make_unique(mutationListeners); } if (!serializationListeners.empty()) { DeserializationListener = - llvm::make_unique( + std::make_unique( serializationListeners); } } diff --git a/lib/Frontend/PrecompiledPreamble.cpp b/lib/Frontend/PrecompiledPreamble.cpp index 6b174065d1..ced32c6702 100644 --- a/lib/Frontend/PrecompiledPreamble.cpp +++ b/lib/Frontend/PrecompiledPreamble.cpp @@ -202,7 +202,7 @@ PrecompilePreambleAction::CreateASTConsumer(CompilerInstance &CI, std::unique_ptr OS; if (InMemStorage) { - OS = llvm::make_unique(*InMemStorage); + OS = std::make_unique(*InMemStorage); } else { std::string OutputFile; OS = GeneratePCHAction::CreateOutputFile(CI, InFile, OutputFile); @@ -213,7 +213,7 @@ PrecompilePreambleAction::CreateASTConsumer(CompilerInstance &CI, if (!CI.getFrontendOpts().RelocatablePCH) Sysroot.clear(); - return llvm::make_unique( + return std::make_unique( *this, CI.getPreprocessor(), CI.getModuleCache(), Sysroot, std::move(OS)); } diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp index 732edacffb..24ea1ccba2 100644 --- a/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/lib/Frontend/PrintPreprocessedOutput.cpp @@ -675,7 +675,7 @@ struct UnknownPragmaHandler : public PragmaHandler { if (ShouldExpandTokens) { // The first token does not have expanded macros. Expand them, if // required. - auto Toks = llvm::make_unique(1); + auto Toks = std::make_unique(1); Toks[0] = PragmaTok; PP.EnterTokenStream(std::move(Toks), /*NumToks=*/1, /*DisableMacroExpansion=*/false, diff --git a/lib/Frontend/Rewrite/FrontendActions.cpp b/lib/Frontend/Rewrite/FrontendActions.cpp index b871ee9a03..549b86edeb 100644 --- a/lib/Frontend/Rewrite/FrontendActions.cpp +++ b/lib/Frontend/Rewrite/FrontendActions.cpp @@ -50,7 +50,7 @@ FixItAction::~FixItAction() {} std::unique_ptr FixItAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique(); + return std::make_unique(); } namespace { @@ -295,7 +295,7 @@ bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) { if (CI.getPreprocessorOutputOpts().RewriteImports) { CI.createModuleManager(); CI.getModuleManager()->addListener( - llvm::make_unique(CI, OutputStream)); + std::make_unique(CI, OutputStream)); } return true; diff --git a/lib/Frontend/Rewrite/HTMLPrint.cpp b/lib/Frontend/Rewrite/HTMLPrint.cpp index a5b36bc785..982e56cebb 100644 --- a/lib/Frontend/Rewrite/HTMLPrint.cpp +++ b/lib/Frontend/Rewrite/HTMLPrint.cpp @@ -48,7 +48,7 @@ namespace { std::unique_ptr clang::CreateHTMLPrinter(std::unique_ptr OS, Preprocessor &PP, bool SyntaxHighlight, bool HighlightMacros) { - return llvm::make_unique(std::move(OS), PP, SyntaxHighlight, + return std::make_unique(std::move(OS), PP, SyntaxHighlight, HighlightMacros); } diff --git a/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/lib/Frontend/Rewrite/RewriteModernObjC.cpp index bd091ee033..563c7ca100 100644 --- a/lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -663,7 +663,7 @@ std::unique_ptr clang::CreateModernObjCRewriter( const std::string &InFile, std::unique_ptr OS, DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning, bool LineInfo) { - return llvm::make_unique(InFile, std::move(OS), Diags, + return std::make_unique(InFile, std::move(OS), Diags, LOpts, SilenceRewriteMacroWarning, LineInfo); } diff --git a/lib/Frontend/Rewrite/RewriteObjC.cpp b/lib/Frontend/Rewrite/RewriteObjC.cpp index 05078baee7..e57a926834 100644 --- a/lib/Frontend/Rewrite/RewriteObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteObjC.cpp @@ -593,7 +593,7 @@ clang::CreateObjCRewriter(const std::string &InFile, std::unique_ptr OS, DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning) { - return llvm::make_unique( + return std::make_unique( InFile, std::move(OS), Diags, LOpts, SilenceRewriteMacroWarning); } diff --git a/lib/Frontend/SerializedDiagnosticPrinter.cpp b/lib/Frontend/SerializedDiagnosticPrinter.cpp index 0732d63dfe..8042b52ddc 100644 --- a/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -296,7 +296,7 @@ namespace clang { namespace serialized_diags { std::unique_ptr create(StringRef OutputFile, DiagnosticOptions *Diags, bool MergeChildRecords) { - return llvm::make_unique(OutputFile, Diags, MergeChildRecords); + return std::make_unique(OutputFile, Diags, MergeChildRecords); } } // end namespace serialized_diags @@ -743,7 +743,7 @@ DiagnosticsEngine *SDiagsWriter::getMetaDiags() { IntrusiveRefCntPtr IDs(new DiagnosticIDs()); auto Client = new TextDiagnosticPrinter(llvm::errs(), State->DiagOpts.get()); - State->MetaDiagnostics = llvm::make_unique( + State->MetaDiagnostics = std::make_unique( IDs, State->DiagOpts.get(), Client); } return State->MetaDiagnostics.get(); @@ -780,7 +780,7 @@ void SDiagsWriter::finish() { } std::error_code EC; - auto OS = llvm::make_unique(State->OutputFile.c_str(), + auto OS = std::make_unique(State->OutputFile.c_str(), EC, llvm::sys::fs::OF_None); if (EC) { getMetaDiags()->Report(diag::warn_fe_serialized_diag_failure) diff --git a/lib/Frontend/VerifyDiagnosticConsumer.cpp b/lib/Frontend/VerifyDiagnosticConsumer.cpp index a68ef03d4d..47f2ae39b8 100644 --- a/lib/Frontend/VerifyDiagnosticConsumer.cpp +++ b/lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -671,7 +671,7 @@ void VerifyDiagnosticConsumer::BeginSourceFile(const LangOptions &LangOpts, #ifndef NDEBUG // Debug build tracks parsed files. const_cast(PP)->addPPCallbacks( - llvm::make_unique(*this, *SrcManager)); + std::make_unique(*this, *SrcManager)); #endif } } @@ -1116,7 +1116,7 @@ std::unique_ptr Directive::create(bool RegexKind, bool MatchAnyLine, StringRef Text, unsigned Min, unsigned Max) { if (!RegexKind) - return llvm::make_unique(DirectiveLoc, DiagnosticLoc, + return std::make_unique(DirectiveLoc, DiagnosticLoc, MatchAnyLine, Text, Min, Max); // Parse the directive into a regular expression. @@ -1142,6 +1142,6 @@ std::unique_ptr Directive::create(bool RegexKind, } } - return llvm::make_unique( + return std::make_unique( DirectiveLoc, DiagnosticLoc, MatchAnyLine, Text, Min, Max, RegexStr); } -- cgit v1.2.1