diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-14 23:04:18 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-14 23:04:18 +0000 |
commit | 49a6b091014f0033829e099ea7ac50bc7b6e9c32 (patch) | |
tree | 5c9166fd03b75498e415a487c68e284f39784854 /lib/Frontend | |
parent | 7410a82389827d6c4f3e9a209445a60f26c8be54 (diff) | |
download | clang-49a6b091014f0033829e099ea7ac50bc7b6e9c32.tar.gz |
[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
Diffstat (limited to 'lib/Frontend')
21 files changed, 57 insertions, 57 deletions
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<ASTConsumer> clang::CreateASTPrinter(std::unique_ptr<raw_ostream> Out, StringRef FilterString) { - return llvm::make_unique<ASTPrinter>(std::move(Out), ASTPrinter::Print, + return std::make_unique<ASTPrinter>(std::move(Out), ASTPrinter::Print, ADOF_Default, FilterString); } @@ -148,7 +148,7 @@ clang::CreateASTDumper(std::unique_ptr<raw_ostream> Out, StringRef FilterString, bool DumpDecls, bool Deserialize, bool DumpLookups, ASTDumpOutputFormat Format) { assert((DumpDecls || Deserialize || DumpLookups) && "nothing to dump"); - return llvm::make_unique<ASTPrinter>(std::move(Out), + return std::make_unique<ASTPrinter>(std::move(Out), Deserialize ? ASTPrinter::DumpFull : DumpDecls ? ASTPrinter::Dump : ASTPrinter::None, Format, @@ -156,7 +156,7 @@ clang::CreateASTDumper(std::unique_ptr<raw_ostream> Out, StringRef FilterString, } std::unique_ptr<ASTConsumer> clang::CreateASTDeclNodeLister() { - return llvm::make_unique<ASTDeclNodeLister>(nullptr); + return std::make_unique<ASTDeclNodeLister>(nullptr); } //===----------------------------------------------------------------------===// @@ -193,5 +193,5 @@ void ASTViewer::HandleTopLevelSingleDecl(Decl *D) { } std::unique_ptr<ASTConsumer> clang::CreateASTViewer() { - return llvm::make_unique<ASTViewer>(); + return std::make_unique<ASTViewer>(); } 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> ASTUnit::LoadFromASTFile( /*isysroot=*/"", /*DisableValidation=*/disableValid, AllowPCHWithCompilerErrors); - AST->Reader->setListener(llvm::make_unique<ASTInfoCollector>( + AST->Reader->setListener(std::make_unique<ASTInfoCollector>( *AST->PP, AST->Ctx.get(), *AST->HSOpts, *AST->PPOpts, *AST->LangOpts, AST->TargetOpts, AST->Target, Counter)); @@ -999,9 +999,9 @@ public: std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override { CI.getPreprocessor().addPPCallbacks( - llvm::make_unique<MacroDefinitionTrackerPPCallbacks>( + std::make_unique<MacroDefinitionTrackerPPCallbacks>( Unit.getCurrentTopLevelHashValue())); - return llvm::make_unique<TopLevelDeclTrackerConsumer>( + return std::make_unique<TopLevelDeclTrackerConsumer>( Unit, Unit.getCurrentTopLevelHashValue()); } @@ -1049,7 +1049,7 @@ public: } std::unique_ptr<PPCallbacks> createPPCallbacks() override { - return llvm::make_unique<MacroDefinitionTrackerPPCallbacks>(Hash); + return std::make_unique<MacroDefinitionTrackerPPCallbacks>(Hash); } private: @@ -1624,15 +1624,15 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction( if (Persistent && !TrackerAct) { Clang->getPreprocessor().addPPCallbacks( - llvm::make_unique<MacroDefinitionTrackerPPCallbacks>( + std::make_unique<MacroDefinitionTrackerPPCallbacks>( AST->getCurrentTopLevelHashValue())); std::vector<std::unique_ptr<ASTConsumer>> Consumers; if (Clang->hasASTConsumer()) Consumers.push_back(Clang->takeASTConsumer()); - Consumers.push_back(llvm::make_unique<TopLevelDeclTrackerConsumer>( + Consumers.push_back(std::make_unique<TopLevelDeclTrackerConsumer>( *AST, AST->getCurrentTopLevelHashValue())); Clang->setASTConsumer( - llvm::make_unique<MultiplexConsumer>(std::move(Consumers))); + std::make_unique<MultiplexConsumer>(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<ExternalSemaSource> clang::createChainedIncludesSource( auto Buffer = std::make_shared<PCHBuffer>(); ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions; - auto consumer = llvm::make_unique<PCHGenerator>( + auto consumer = std::make_unique<PCHGenerator>( 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<llvm::raw_fd_ostream>( + auto FileOS = std::make_unique<llvm::raw_fd_ostream>( 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<LogDiagnosticPrinter>(*OS, DiagOpts, + auto Logger = std::make_unique<LogDiagnosticPrinter>(*OS, DiagOpts, std::move(StreamOwner)); if (CodeGenOpts) Logger->setDwarfDebugFlags(CodeGenOpts->DwarfDebugFlags); @@ -667,7 +667,7 @@ CompilerInstance::createDefaultOutputFile(bool Binary, StringRef InFile, } std::unique_ptr<raw_pwrite_stream> CompilerInstance::createNullOutputFile() { - return llvm::make_unique<llvm::raw_null_ostream>(); + return std::make_unique<llvm::raw_null_ostream>(); } std::unique_ptr<raw_pwrite_stream> @@ -793,7 +793,7 @@ std::unique_ptr<llvm::raw_pwrite_stream> CompilerInstance::createOutputFile( if (!Binary || OS->supportsSeeking()) return std::move(OS); - auto B = llvm::make_unique<llvm::buffer_ostream>(*OS); + auto B = std::make_unique<llvm::buffer_ostream>(*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<llvm::raw_fd_ostream>( + auto StatS = std::make_unique<llvm::raw_fd_ostream>( 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<llvm::Timer> ReadTimer; if (FrontendTimerGroup) - ReadTimer = llvm::make_unique<llvm::Timer>("reading_modules", + ReadTimer = std::make_unique<llvm::Timer>("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<ReadModuleNames>(*this); + auto Listener = std::make_unique<ReadModuleNames>(*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<CompilerInvocation> clang::createInvocationFromCommandLine( } const ArgStringList &CCArgs = Cmd.getArguments(); - auto CI = llvm::make_unique<CompilerInvocation>(); + auto CI = std::make_unique<CompilerInvocation>(); if (!CompilerInvocation::CreateFromArgs(*CI, const_cast<const char **>(CCArgs.data()), const_cast<const char **>(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<DepCollectorPPCallbacks>( + PP.addPPCallbacks(std::make_unique<DepCollectorPPCallbacks>( *this, PP.getSourceManager(), PP.getDiagnostics())); PP.getHeaderSearchInfo().getModuleMap().addModuleMapCallbacks( - llvm::make_unique<DepCollectorMMCallbacks>(*this)); + std::make_unique<DepCollectorMMCallbacks>(*this)); } void DependencyCollector::attachToASTReader(ASTReader &R) { - R.addListener(llvm::make_unique<DepCollectorASTListener>(*this)); + R.addListener(std::make_unique<DepCollectorASTListener>(*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<DependencyGraphCallback>(&PP, OutputFile, + PP.addPPCallbacks(std::make_unique<DependencyGraphCallback>(&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<MultiplexConsumer>(std::move(Consumers)); + return std::make_unique<MultiplexConsumer>(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<ASTConsumer> InitOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique<ASTConsumer>(); + return std::make_unique<ASTConsumer>(); } void InitOnlyAction::ExecuteAction() { @@ -109,7 +109,7 @@ GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { const auto &FrontendOpts = CI.getFrontendOpts(); auto Buffer = std::make_shared<PCHBuffer>(); std::vector<std::unique_ptr<ASTConsumer>> Consumers; - Consumers.push_back(llvm::make_unique<PCHGenerator>( + Consumers.push_back(std::make_unique<PCHGenerator>( 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<MultiplexConsumer>(std::move(Consumers)); + return std::make_unique<MultiplexConsumer>(std::move(Consumers)); } bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI, @@ -172,7 +172,7 @@ GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI, auto Buffer = std::make_shared<PCHBuffer>(); std::vector<std::unique_ptr<ASTConsumer>> Consumers; - Consumers.push_back(llvm::make_unique<PCHGenerator>( + Consumers.push_back(std::make_unique<PCHGenerator>( 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<MultiplexConsumer>(std::move(Consumers)); + return std::make_unique<MultiplexConsumer>(std::move(Consumers)); } bool GenerateModuleFromModuleMapAction::BeginSourceFileAction( @@ -313,18 +313,18 @@ SyntaxOnlyAction::~SyntaxOnlyAction() { std::unique_ptr<ASTConsumer> SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique<ASTConsumer>(); + return std::make_unique<ASTConsumer>(); } std::unique_ptr<ASTConsumer> DumpModuleInfoAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique<ASTConsumer>(); + return std::make_unique<ASTConsumer>(); } std::unique_ptr<ASTConsumer> VerifyPCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique<ASTConsumer>(); + return std::make_unique<ASTConsumer>(); } void VerifyPCHAction::ExecuteAction() { @@ -466,7 +466,7 @@ private: std::unique_ptr<ASTConsumer> TemplightDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique<ASTConsumer>(); + return std::make_unique<ASTConsumer>(); } void TemplightDumpAction::ExecuteAction() { @@ -479,7 +479,7 @@ void TemplightDumpAction::ExecuteAction() { EnsureSemaIsCreated(CI, *this); CI.getSema().TemplateInstCallbacks.push_back( - llvm::make_unique<DefaultTemplateInstCallback>()); + std::make_unique<DefaultTemplateInstCallback>()); 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<HeaderIncludesCallback>( + PP.addPPCallbacks(std::make_unique<HeaderIncludesCallback>( &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<ASTConsumer> GenerateInterfaceYAMLExpV1Action::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique<InterfaceStubFunctionsConsumer>( + return std::make_unique<InterfaceStubFunctionsConsumer>( CI, InFile, "experimental-yaml-elf-v1"); } std::unique_ptr<ASTConsumer> GenerateInterfaceTBEExpV1Action::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique<InterfaceStubFunctionsConsumer>( + return std::make_unique<InterfaceStubFunctionsConsumer>( 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<ModuleDependencyListener>(*this)); + R.addListener(std::make_unique<ModuleDependencyListener>(*this)); } void ModuleDependencyCollector::attachToPreprocessor(Preprocessor &PP) { - PP.addPPCallbacks(llvm::make_unique<ModuleDependencyPPCallbacks>( + PP.addPPCallbacks(std::make_unique<ModuleDependencyPPCallbacks>( *this, PP.getSourceManager())); PP.getHeaderSearchInfo().getModuleMap().addModuleMapCallbacks( - llvm::make_unique<ModuleDependencyMMCallbacks>(*this)); + std::make_unique<ModuleDependencyMMCallbacks>(*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<MultiplexASTMutationListener>(mutationListeners); + std::make_unique<MultiplexASTMutationListener>(mutationListeners); } if (!serializationListeners.empty()) { DeserializationListener = - llvm::make_unique<MultiplexASTDeserializationListener>( + std::make_unique<MultiplexASTDeserializationListener>( 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<llvm::raw_ostream> OS; if (InMemStorage) { - OS = llvm::make_unique<llvm::raw_string_ostream>(*InMemStorage); + OS = std::make_unique<llvm::raw_string_ostream>(*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<PrecompilePreambleConsumer>( + return std::make_unique<PrecompilePreambleConsumer>( *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<Token[]>(1); + auto Toks = std::make_unique<Token[]>(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<ASTConsumer> FixItAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return llvm::make_unique<ASTConsumer>(); + return std::make_unique<ASTConsumer>(); } namespace { @@ -295,7 +295,7 @@ bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) { if (CI.getPreprocessorOutputOpts().RewriteImports) { CI.createModuleManager(); CI.getModuleManager()->addListener( - llvm::make_unique<RewriteImportsListener>(CI, OutputStream)); + std::make_unique<RewriteImportsListener>(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<ASTConsumer> clang::CreateHTMLPrinter(std::unique_ptr<raw_ostream> OS, Preprocessor &PP, bool SyntaxHighlight, bool HighlightMacros) { - return llvm::make_unique<HTMLPrinter>(std::move(OS), PP, SyntaxHighlight, + return std::make_unique<HTMLPrinter>(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<ASTConsumer> clang::CreateModernObjCRewriter( const std::string &InFile, std::unique_ptr<raw_ostream> OS, DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning, bool LineInfo) { - return llvm::make_unique<RewriteModernObjC>(InFile, std::move(OS), Diags, + return std::make_unique<RewriteModernObjC>(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<raw_ostream> OS, DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning) { - return llvm::make_unique<RewriteObjCFragileABI>( + return std::make_unique<RewriteObjCFragileABI>( 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<DiagnosticConsumer> create(StringRef OutputFile, DiagnosticOptions *Diags, bool MergeChildRecords) { - return llvm::make_unique<SDiagsWriter>(OutputFile, Diags, MergeChildRecords); + return std::make_unique<SDiagsWriter>(OutputFile, Diags, MergeChildRecords); } } // end namespace serialized_diags @@ -743,7 +743,7 @@ DiagnosticsEngine *SDiagsWriter::getMetaDiags() { IntrusiveRefCntPtr<DiagnosticIDs> IDs(new DiagnosticIDs()); auto Client = new TextDiagnosticPrinter(llvm::errs(), State->DiagOpts.get()); - State->MetaDiagnostics = llvm::make_unique<DiagnosticsEngine>( + State->MetaDiagnostics = std::make_unique<DiagnosticsEngine>( 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<llvm::raw_fd_ostream>(State->OutputFile.c_str(), + auto OS = std::make_unique<llvm::raw_fd_ostream>(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<Preprocessor *>(PP)->addPPCallbacks( - llvm::make_unique<VerifyFileTracker>(*this, *SrcManager)); + std::make_unique<VerifyFileTracker>(*this, *SrcManager)); #endif } } @@ -1116,7 +1116,7 @@ std::unique_ptr<Directive> Directive::create(bool RegexKind, bool MatchAnyLine, StringRef Text, unsigned Min, unsigned Max) { if (!RegexKind) - return llvm::make_unique<StandardDirective>(DirectiveLoc, DiagnosticLoc, + return std::make_unique<StandardDirective>(DirectiveLoc, DiagnosticLoc, MatchAnyLine, Text, Min, Max); // Parse the directive into a regular expression. @@ -1142,6 +1142,6 @@ std::unique_ptr<Directive> Directive::create(bool RegexKind, } } - return llvm::make_unique<RegexDirective>( + return std::make_unique<RegexDirective>( DirectiveLoc, DiagnosticLoc, MatchAnyLine, Text, Min, Max, RegexStr); } |