Skip to content

Commit 1c705d9

Browse files
committed
[clang-tools-extra] 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: 368944
1 parent 2b3d49b commit 1c705d9

File tree

99 files changed

+344
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+344
-344
lines changed

clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ getLexerStartingFromLoc(SourceLocation Loc, const SourceManager &SM,
109109

110110
const char *TokBegin = File.data() + LocInfo.second;
111111
// Lex from the start of the given location.
112-
return llvm::make_unique<Lexer>(SM.getLocForStartOfFile(LocInfo.first),
112+
return std::make_unique<Lexer>(SM.getLocForStartOfFile(LocInfo.first),
113113
LangOpts, File.begin(), TokBegin, File.end());
114114
}
115115

clang-tools-extra/clang-doc/BitcodeReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ template <> llvm::Expected<CommentInfo *> getCommentInfo(EnumInfo *I) {
329329
}
330330

331331
template <> llvm::Expected<CommentInfo *> getCommentInfo(CommentInfo *I) {
332-
I->Children.emplace_back(llvm::make_unique<CommentInfo>());
332+
I->Children.emplace_back(std::make_unique<CommentInfo>());
333333
return I->Children.back().get();
334334
}
335335

@@ -690,7 +690,7 @@ llvm::Error ClangDocBitcodeReader::readBlockInfoBlock() {
690690
template <typename T>
691691
llvm::Expected<std::unique_ptr<Info>>
692692
ClangDocBitcodeReader::createInfo(unsigned ID) {
693-
std::unique_ptr<Info> I = llvm::make_unique<T>();
693+
std::unique_ptr<Info> I = std::make_unique<T>();
694694
if (auto Err = readBlock(ID, static_cast<T *>(I.get())))
695695
return std::move(Err);
696696
return std::unique_ptr<Info>{std::move(I)};

clang-tools-extra/clang-doc/ClangDoc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ clang::FrontendAction *MapperActionFactory::create() {
4343
std::unique_ptr<clang::ASTConsumer>
4444
CreateASTConsumer(clang::CompilerInstance &Compiler,
4545
llvm::StringRef InFile) override {
46-
return llvm::make_unique<MapASTVisitor>(&Compiler.getASTContext(), CDCtx);
46+
return std::make_unique<MapASTVisitor>(&Compiler.getASTContext(), CDCtx);
4747
}
4848

4949
private:
@@ -54,7 +54,7 @@ clang::FrontendAction *MapperActionFactory::create() {
5454

5555
std::unique_ptr<tooling::FrontendActionFactory>
5656
newMapperActionFactory(ClangDocContext CDCtx) {
57-
return llvm::make_unique<MapperActionFactory>(CDCtx);
57+
return std::make_unique<MapperActionFactory>(CDCtx);
5858
}
5959

6060
} // namespace doc

clang-tools-extra/clang-doc/HTMLGenerator.cpp

Lines changed: 51 additions & 51 deletions
Large diffs are not rendered by default.

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ reduce(std::vector<std::unique_ptr<Info>> &Values) {
3636
if (Values.empty())
3737
return llvm::make_error<llvm::StringError>(" No values to reduce.\n",
3838
llvm::inconvertibleErrorCode());
39-
std::unique_ptr<Info> Merged = llvm::make_unique<T>(Values[0]->USR);
39+
std::unique_ptr<Info> Merged = std::make_unique<T>(Values[0]->USR);
4040
T *Tmp = static_cast<T *>(Merged.get());
4141
for (auto &I : Values)
4242
Tmp->merge(std::move(*static_cast<T *>(I.get())));

clang-tools-extra/clang-doc/Serialize.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void ClangDocCommentVisitor::parseComment(const comments::Comment *C) {
9090
ConstCommentVisitor<ClangDocCommentVisitor>::visit(C);
9191
for (comments::Comment *Child :
9292
llvm::make_range(C->child_begin(), C->child_end())) {
93-
CurrentCI.Children.emplace_back(llvm::make_unique<CommentInfo>());
93+
CurrentCI.Children.emplace_back(std::make_unique<CommentInfo>());
9494
ClangDocCommentVisitor Visitor(*CurrentCI.Children.back());
9595
Visitor.parseComment(Child);
9696
}
@@ -379,7 +379,7 @@ static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D,
379379
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
380380
emitInfo(const NamespaceDecl *D, const FullComment *FC, int LineNumber,
381381
llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) {
382-
auto I = llvm::make_unique<NamespaceInfo>();
382+
auto I = std::make_unique<NamespaceInfo>();
383383
bool IsInAnonymousNamespace = false;
384384
populateInfo(*I, D, FC, IsInAnonymousNamespace);
385385
if (PublicOnly && ((IsInAnonymousNamespace || D->isAnonymousNamespace()) ||
@@ -392,7 +392,7 @@ emitInfo(const NamespaceDecl *D, const FullComment *FC, int LineNumber,
392392
if (I->Namespace.empty() && I->USR == SymbolID())
393393
return {std::unique_ptr<Info>{std::move(I)}, nullptr};
394394

395-
auto ParentI = llvm::make_unique<NamespaceInfo>();
395+
auto ParentI = std::make_unique<NamespaceInfo>();
396396
ParentI->USR = I->Namespace.empty() ? SymbolID() : I->Namespace[0].USR;
397397
ParentI->ChildNamespaces.emplace_back(I->USR, I->Name, InfoType::IT_namespace,
398398
getInfoRelativePath(I->Namespace));
@@ -405,7 +405,7 @@ emitInfo(const NamespaceDecl *D, const FullComment *FC, int LineNumber,
405405
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
406406
emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
407407
llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) {
408-
auto I = llvm::make_unique<RecordInfo>();
408+
auto I = std::make_unique<RecordInfo>();
409409
bool IsInAnonymousNamespace = false;
410410
populateSymbolInfo(*I, D, FC, LineNumber, File, IsFileInRootDir,
411411
IsInAnonymousNamespace);
@@ -425,7 +425,7 @@ emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
425425
I->Path = getInfoRelativePath(I->Namespace);
426426

427427
if (I->Namespace.empty()) {
428-
auto ParentI = llvm::make_unique<NamespaceInfo>();
428+
auto ParentI = std::make_unique<NamespaceInfo>();
429429
ParentI->USR = SymbolID();
430430
ParentI->ChildRecords.emplace_back(I->USR, I->Name, InfoType::IT_record,
431431
getInfoRelativePath(I->Namespace));
@@ -436,15 +436,15 @@ emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
436436

437437
switch (I->Namespace[0].RefType) {
438438
case InfoType::IT_namespace: {
439-
auto ParentI = llvm::make_unique<NamespaceInfo>();
439+
auto ParentI = std::make_unique<NamespaceInfo>();
440440
ParentI->USR = I->Namespace[0].USR;
441441
ParentI->ChildRecords.emplace_back(I->USR, I->Name, InfoType::IT_record,
442442
getInfoRelativePath(I->Namespace));
443443
return {std::unique_ptr<Info>{std::move(I)},
444444
std::unique_ptr<Info>{std::move(ParentI)}};
445445
}
446446
case InfoType::IT_record: {
447-
auto ParentI = llvm::make_unique<RecordInfo>();
447+
auto ParentI = std::make_unique<RecordInfo>();
448448
ParentI->USR = I->Namespace[0].USR;
449449
ParentI->ChildRecords.emplace_back(I->USR, I->Name, InfoType::IT_record,
450450
getInfoRelativePath(I->Namespace));
@@ -470,7 +470,7 @@ emitInfo(const FunctionDecl *D, const FullComment *FC, int LineNumber,
470470
Func.Access = clang::AccessSpecifier::AS_none;
471471

472472
// Wrap in enclosing scope
473-
auto ParentI = llvm::make_unique<NamespaceInfo>();
473+
auto ParentI = std::make_unique<NamespaceInfo>();
474474
if (!Func.Namespace.empty())
475475
ParentI->USR = Func.Namespace[0].USR;
476476
else
@@ -508,7 +508,7 @@ emitInfo(const CXXMethodDecl *D, const FullComment *FC, int LineNumber,
508508
Func.Access = D->getAccess();
509509

510510
// Wrap in enclosing scope
511-
auto ParentI = llvm::make_unique<RecordInfo>();
511+
auto ParentI = std::make_unique<RecordInfo>();
512512
ParentI->USR = ParentUSR;
513513
if (Func.Namespace.empty())
514514
ParentI->Path = getInfoRelativePath(ParentI->Namespace);
@@ -533,7 +533,7 @@ emitInfo(const EnumDecl *D, const FullComment *FC, int LineNumber,
533533

534534
// Put in global namespace
535535
if (Enum.Namespace.empty()) {
536-
auto ParentI = llvm::make_unique<NamespaceInfo>();
536+
auto ParentI = std::make_unique<NamespaceInfo>();
537537
ParentI->USR = SymbolID();
538538
ParentI->ChildEnums.emplace_back(std::move(Enum));
539539
ParentI->Path = getInfoRelativePath(ParentI->Namespace);
@@ -545,15 +545,15 @@ emitInfo(const EnumDecl *D, const FullComment *FC, int LineNumber,
545545
// Wrap in enclosing scope
546546
switch (Enum.Namespace[0].RefType) {
547547
case InfoType::IT_namespace: {
548-
auto ParentI = llvm::make_unique<NamespaceInfo>();
548+
auto ParentI = std::make_unique<NamespaceInfo>();
549549
ParentI->USR = Enum.Namespace[0].USR;
550550
ParentI->ChildEnums.emplace_back(std::move(Enum));
551551
// Info is wrapped in its parent scope so it's returned in the second
552552
// position
553553
return {nullptr, std::unique_ptr<Info>{std::move(ParentI)}};
554554
}
555555
case InfoType::IT_record: {
556-
auto ParentI = llvm::make_unique<RecordInfo>();
556+
auto ParentI = std::make_unique<RecordInfo>();
557557
ParentI->USR = Enum.Namespace[0].USR;
558558
ParentI->ChildEnums.emplace_back(std::move(Enum));
559559
// Info is wrapped in its parent scope so it's returned in the second

clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ FuzzySymbolIndex::createFromYAML(StringRef FilePath) {
134134
auto Buffer = llvm::MemoryBuffer::getFile(FilePath);
135135
if (!Buffer)
136136
return llvm::errorCodeToError(Buffer.getError());
137-
return llvm::make_unique<MemSymbolIndex>(
137+
return std::make_unique<MemSymbolIndex>(
138138
find_all_symbols::ReadSymbolInfosFromYAML(Buffer.get()->getBuffer()));
139139
}
140140

clang-tools-extra/clang-include-fixer/IncludeFixer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Action : public clang::ASTFrontendAction {
3434
CreateASTConsumer(clang::CompilerInstance &Compiler,
3535
StringRef InFile) override {
3636
SemaSource.setFilePath(InFile);
37-
return llvm::make_unique<clang::ASTConsumer>();
37+
return std::make_unique<clang::ASTConsumer>();
3838
}
3939

4040
void ExecuteAction() override {
@@ -104,7 +104,7 @@ bool IncludeFixerActionFactory::runInvocation(
104104

105105
// Run the parser, gather missing includes.
106106
auto ScopedToolAction =
107-
llvm::make_unique<Action>(SymbolIndexMgr, MinimizeIncludePaths);
107+
std::make_unique<Action>(SymbolIndexMgr, MinimizeIncludePaths);
108108
Compiler.ExecuteAction(*ScopedToolAction);
109109

110110
Contexts.push_back(ScopedToolAction->getIncludeFixerContext(

clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllSymbolsAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ std::unique_ptr<ASTConsumer>
2727
FindAllSymbolsAction::CreateASTConsumer(CompilerInstance &Compiler,
2828
StringRef InFile) {
2929
Compiler.getPreprocessor().addCommentHandler(&Handler);
30-
Compiler.getPreprocessor().addPPCallbacks(llvm::make_unique<FindAllMacros>(
30+
Compiler.getPreprocessor().addPPCallbacks(std::make_unique<FindAllMacros>(
3131
Reporter, &Compiler.getSourceManager(), &Collector));
3232
return MatchFinder.newASTConsumer();
3333
}

clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ int main(int argc, const char **argv) {
145145
clang::find_all_symbols::YamlReporter Reporter;
146146

147147
auto Factory =
148-
llvm::make_unique<clang::find_all_symbols::FindAllSymbolsActionFactory>(
148+
std::make_unique<clang::find_all_symbols::FindAllSymbolsActionFactory>(
149149
&Reporter, clang::find_all_symbols::getSTLPostfixHeaderMap());
150150
return Tool.run(Factory.get());
151151
}

clang-tools-extra/clang-include-fixer/plugin/IncludeFixerPlugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ClangIncludeFixerPluginAction : public PluginASTAction {
4141
CI.setExternalSemaSource(SemaSource);
4242
SemaSource->setFilePath(InFile);
4343
SemaSource->setCompilerInstance(&CI);
44-
return llvm::make_unique<ASTConsumerManagerWrapper>(SymbolIndexMgr);
44+
return std::make_unique<ASTConsumerManagerWrapper>(SymbolIndexMgr);
4545
}
4646

4747
void ExecuteAction() override {} // Do nothing.

clang-tools-extra/clang-include-fixer/tool/ClangIncludeFixer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ std::unique_ptr<include_fixer::SymbolIndexManager>
161161
createSymbolIndexManager(StringRef FilePath) {
162162
using find_all_symbols::SymbolInfo;
163163

164-
auto SymbolIndexMgr = llvm::make_unique<include_fixer::SymbolIndexManager>();
164+
auto SymbolIndexMgr = std::make_unique<include_fixer::SymbolIndexManager>();
165165
switch (DatabaseFormat) {
166166
case fixed: {
167167
// Parse input and fill the database with it.
@@ -185,7 +185,7 @@ createSymbolIndexManager(StringRef FilePath) {
185185
/*Used=*/0)});
186186
}
187187
SymbolIndexMgr->addSymbolIndex([=]() {
188-
return llvm::make_unique<include_fixer::InMemorySymbolIndex>(Symbols);
188+
return std::make_unique<include_fixer::InMemorySymbolIndex>(Symbols);
189189
});
190190
break;
191191
}

clang-tools-extra/clang-move/HelperDeclRefGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ CallGraphNode *HelperDeclRefGraph::getOrInsertNode(Decl *F) {
5959
if (Node)
6060
return Node.get();
6161

62-
Node = llvm::make_unique<CallGraphNode>(F);
62+
Node = std::make_unique<CallGraphNode>(F);
6363
return Node.get();
6464
}
6565

clang-tools-extra/clang-move/Move.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ getUsedDecls(const HelperDeclRefGraph *RG,
476476
std::unique_ptr<ASTConsumer>
477477
ClangMoveAction::CreateASTConsumer(CompilerInstance &Compiler,
478478
StringRef /*InFile*/) {
479-
Compiler.getPreprocessor().addPPCallbacks(llvm::make_unique<FindAllIncludes>(
479+
Compiler.getPreprocessor().addPPCallbacks(std::make_unique<FindAllIncludes>(
480480
&Compiler.getSourceManager(), &MoveTool));
481481
return MatchFinder.newASTConsumer();
482482
}
@@ -610,7 +610,7 @@ void ClangMoveTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
610610
// Matchers for old files, including old.h/old.cc
611611
//============================================================================
612612
// Create a MatchCallback for class declarations.
613-
MatchCallbacks.push_back(llvm::make_unique<ClassDeclarationMatch>(this));
613+
MatchCallbacks.push_back(std::make_unique<ClassDeclarationMatch>(this));
614614
// Match moved class declarations.
615615
auto MovedClass = cxxRecordDecl(InOldFiles, *HasAnySymbolNames,
616616
isDefinition(), TopLevelDecl)
@@ -629,19 +629,19 @@ void ClangMoveTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
629629
.bind("class_static_var_decl"),
630630
MatchCallbacks.back().get());
631631

632-
MatchCallbacks.push_back(llvm::make_unique<FunctionDeclarationMatch>(this));
632+
MatchCallbacks.push_back(std::make_unique<FunctionDeclarationMatch>(this));
633633
Finder->addMatcher(functionDecl(InOldFiles, *HasAnySymbolNames, TopLevelDecl)
634634
.bind("function"),
635635
MatchCallbacks.back().get());
636636

637-
MatchCallbacks.push_back(llvm::make_unique<VarDeclarationMatch>(this));
637+
MatchCallbacks.push_back(std::make_unique<VarDeclarationMatch>(this));
638638
Finder->addMatcher(
639639
varDecl(InOldFiles, *HasAnySymbolNames, TopLevelDecl).bind("var"),
640640
MatchCallbacks.back().get());
641641

642642
// Match enum definition in old.h. Enum helpers (which are defined in old.cc)
643643
// will not be moved for now no matter whether they are used or not.
644-
MatchCallbacks.push_back(llvm::make_unique<EnumDeclarationMatch>(this));
644+
MatchCallbacks.push_back(std::make_unique<EnumDeclarationMatch>(this));
645645
Finder->addMatcher(
646646
enumDecl(InOldHeader, *HasAnySymbolNames, isDefinition(), TopLevelDecl)
647647
.bind("enum"),
@@ -650,7 +650,7 @@ void ClangMoveTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
650650
// Match type alias in old.h, this includes "typedef" and "using" type alias
651651
// declarations. Type alias helpers (which are defined in old.cc) will not be
652652
// moved for now no matter whether they are used or not.
653-
MatchCallbacks.push_back(llvm::make_unique<TypeAliasMatch>(this));
653+
MatchCallbacks.push_back(std::make_unique<TypeAliasMatch>(this));
654654
Finder->addMatcher(namedDecl(anyOf(typedefDecl().bind("typedef"),
655655
typeAliasDecl().bind("type_alias")),
656656
InOldHeader, *HasAnySymbolNames, TopLevelDecl),

clang-tools-extra/clang-reorder-fields/ReorderFieldsAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class ReorderingConsumer : public ASTConsumer {
302302
} // end anonymous namespace
303303

304304
std::unique_ptr<ASTConsumer> ReorderFieldsAction::newASTConsumer() {
305-
return llvm::make_unique<ReorderingConsumer>(RecordName, DesiredFieldsOrder,
305+
return std::make_unique<ReorderingConsumer>(RecordName, DesiredFieldsOrder,
306306
Replacements);
307307
}
308308

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ ClangTidyASTConsumerFactory::CreateASTConsumer(
390390

391391
std::unique_ptr<ClangTidyProfiling> Profiling;
392392
if (Context.getEnableProfiling()) {
393-
Profiling = llvm::make_unique<ClangTidyProfiling>(
393+
Profiling = std::make_unique<ClangTidyProfiling>(
394394
Context.getProfileStorageParams());
395395
FinderOptions.CheckProfiling.emplace(Profiling->Records);
396396
}
@@ -402,7 +402,7 @@ ClangTidyASTConsumerFactory::CreateASTConsumer(
402402
Preprocessor *ModuleExpanderPP = PP;
403403

404404
if (Context.getLangOpts().Modules && OverlayFS != nullptr) {
405-
auto ModuleExpander = llvm::make_unique<ExpandModularHeadersPPCallbacks>(
405+
auto ModuleExpander = std::make_unique<ExpandModularHeadersPPCallbacks>(
406406
&Compiler, OverlayFS);
407407
ModuleExpanderPP = ModuleExpander->getPreprocessor();
408408
PP->addPPCallbacks(std::move(ModuleExpander));
@@ -434,7 +434,7 @@ ClangTidyASTConsumerFactory::CreateASTConsumer(
434434
Consumers.push_back(std::move(AnalysisConsumer));
435435
}
436436
#endif // CLANG_ENABLE_STATIC_ANALYZER
437-
return llvm::make_unique<ClangTidyASTConsumer>(
437+
return std::make_unique<ClangTidyASTConsumer>(
438438
std::move(Consumers), std::move(Profiling), std::move(Finder),
439439
std::move(Checks));
440440
}
@@ -469,7 +469,7 @@ std::vector<std::string>
469469
getCheckNames(const ClangTidyOptions &Options,
470470
bool AllowEnablingAnalyzerAlphaCheckers) {
471471
clang::tidy::ClangTidyContext Context(
472-
llvm::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
472+
std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
473473
Options),
474474
AllowEnablingAnalyzerAlphaCheckers);
475475
ClangTidyASTConsumerFactory Factory(Context);
@@ -480,7 +480,7 @@ ClangTidyOptions::OptionMap
480480
getCheckOptions(const ClangTidyOptions &Options,
481481
bool AllowEnablingAnalyzerAlphaCheckers) {
482482
clang::tidy::ClangTidyContext Context(
483-
llvm::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
483+
std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
484484
Options),
485485
AllowEnablingAnalyzerAlphaCheckers);
486486
ClangTidyASTConsumerFactory Factory(Context);

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ void ClangTidyContext::setSourceManager(SourceManager *SourceMgr) {
213213
void ClangTidyContext::setCurrentFile(StringRef File) {
214214
CurrentFile = File;
215215
CurrentOptions = getOptionsForFile(CurrentFile);
216-
CheckFilter = llvm::make_unique<CachedGlobList>(*getOptions().Checks);
216+
CheckFilter = std::make_unique<CachedGlobList>(*getOptions().Checks);
217217
WarningAsErrorFilter =
218-
llvm::make_unique<CachedGlobList>(*getOptions().WarningsAsErrors);
218+
std::make_unique<CachedGlobList>(*getOptions().WarningsAsErrors);
219219
}
220220

221221
void ClangTidyContext::setASTContext(ASTContext *Context) {
@@ -604,7 +604,7 @@ void ClangTidyDiagnosticConsumer::checkFilters(SourceLocation Location,
604604
llvm::Regex *ClangTidyDiagnosticConsumer::getHeaderFilter() {
605605
if (!HeaderFilter)
606606
HeaderFilter =
607-
llvm::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
607+
std::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
608608
return HeaderFilter.get();
609609
}
610610

clang-tools-extra/clang-tidy/ClangTidyOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class FileOptionsProvider : public DefaultOptionsProvider {
199199
/// FileOptionsProvider::ConfigFileHandlers ConfigHandlers;
200200
/// ConfigHandlers.emplace_back(".my-tidy-config", parseMyConfigFormat);
201201
/// ConfigHandlers.emplace_back(".clang-tidy", parseConfiguration);
202-
/// return llvm::make_unique<FileOptionsProvider>(
202+
/// return std::make_unique<FileOptionsProvider>(
203203
/// GlobalOptions, DefaultOptions, OverrideOptions, ConfigHandlers);
204204
/// \endcode
205205
///

0 commit comments

Comments
 (0)