[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
diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index f0ef809..bfa043b 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -390,7 +390,7 @@
std::unique_ptr<ClangTidyProfiling> Profiling;
if (Context.getEnableProfiling()) {
- Profiling = llvm::make_unique<ClangTidyProfiling>(
+ Profiling = std::make_unique<ClangTidyProfiling>(
Context.getProfileStorageParams());
FinderOptions.CheckProfiling.emplace(Profiling->Records);
}
@@ -402,7 +402,7 @@
Preprocessor *ModuleExpanderPP = PP;
if (Context.getLangOpts().Modules && OverlayFS != nullptr) {
- auto ModuleExpander = llvm::make_unique<ExpandModularHeadersPPCallbacks>(
+ auto ModuleExpander = std::make_unique<ExpandModularHeadersPPCallbacks>(
&Compiler, OverlayFS);
ModuleExpanderPP = ModuleExpander->getPreprocessor();
PP->addPPCallbacks(std::move(ModuleExpander));
@@ -434,7 +434,7 @@
Consumers.push_back(std::move(AnalysisConsumer));
}
#endif // CLANG_ENABLE_STATIC_ANALYZER
- return llvm::make_unique<ClangTidyASTConsumer>(
+ return std::make_unique<ClangTidyASTConsumer>(
std::move(Consumers), std::move(Profiling), std::move(Finder),
std::move(Checks));
}
@@ -469,7 +469,7 @@
getCheckNames(const ClangTidyOptions &Options,
bool AllowEnablingAnalyzerAlphaCheckers) {
clang::tidy::ClangTidyContext Context(
- llvm::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
+ std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
Options),
AllowEnablingAnalyzerAlphaCheckers);
ClangTidyASTConsumerFactory Factory(Context);
@@ -480,7 +480,7 @@
getCheckOptions(const ClangTidyOptions &Options,
bool AllowEnablingAnalyzerAlphaCheckers) {
clang::tidy::ClangTidyContext Context(
- llvm::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
+ std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
Options),
AllowEnablingAnalyzerAlphaCheckers);
ClangTidyASTConsumerFactory Factory(Context);
diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
index 0a85d8e..1074af97 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -213,9 +213,9 @@
void ClangTidyContext::setCurrentFile(StringRef File) {
CurrentFile = File;
CurrentOptions = getOptionsForFile(CurrentFile);
- CheckFilter = llvm::make_unique<CachedGlobList>(*getOptions().Checks);
+ CheckFilter = std::make_unique<CachedGlobList>(*getOptions().Checks);
WarningAsErrorFilter =
- llvm::make_unique<CachedGlobList>(*getOptions().WarningsAsErrors);
+ std::make_unique<CachedGlobList>(*getOptions().WarningsAsErrors);
}
void ClangTidyContext::setASTContext(ASTContext *Context) {
@@ -604,7 +604,7 @@
llvm::Regex *ClangTidyDiagnosticConsumer::getHeaderFilter() {
if (!HeaderFilter)
HeaderFilter =
- llvm::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
+ std::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
return HeaderFilter.get();
}
diff --git a/clang-tools-extra/clang-tidy/ClangTidyOptions.h b/clang-tools-extra/clang-tidy/ClangTidyOptions.h
index 87c7cf5..0ce61e8 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyOptions.h
+++ b/clang-tools-extra/clang-tidy/ClangTidyOptions.h
@@ -199,7 +199,7 @@
/// FileOptionsProvider::ConfigFileHandlers ConfigHandlers;
/// ConfigHandlers.emplace_back(".my-tidy-config", parseMyConfigFormat);
/// ConfigHandlers.emplace_back(".clang-tidy", parseConfiguration);
- /// return llvm::make_unique<FileOptionsProvider>(
+ /// return std::make_unique<FileOptionsProvider>(
/// GlobalOptions, DefaultOptions, OverrideOptions, ConfigHandlers);
/// \endcode
///
diff --git a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
index 08037c7..8da3c7e 100644
--- a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
+++ b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
@@ -54,7 +54,7 @@
ExpandModularHeadersPPCallbacks::ExpandModularHeadersPPCallbacks(
CompilerInstance *CI,
IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS)
- : Recorder(llvm::make_unique<FileRecorder>()), Compiler(*CI),
+ : Recorder(std::make_unique<FileRecorder>()), Compiler(*CI),
InMemoryFs(new llvm::vfs::InMemoryFileSystem),
Sources(Compiler.getSourceManager()),
// Forward the new diagnostics to the original DiagnosticConsumer.
@@ -72,13 +72,13 @@
auto HSO = std::make_shared<HeaderSearchOptions>();
*HSO = Compiler.getHeaderSearchOpts();
- HeaderInfo = llvm::make_unique<HeaderSearch>(HSO, Sources, Diags, LangOpts,
+ HeaderInfo = std::make_unique<HeaderSearch>(HSO, Sources, Diags, LangOpts,
&Compiler.getTarget());
auto PO = std::make_shared<PreprocessorOptions>();
*PO = Compiler.getPreprocessorOpts();
- PP = llvm::make_unique<clang::Preprocessor>(PO, Diags, LangOpts, Sources,
+ PP = std::make_unique<clang::Preprocessor>(PO, Diags, LangOpts, Sources,
*HeaderInfo, ModuleLoader,
/*IILookup=*/nullptr,
/*OwnsHeaderSearch=*/false);
diff --git a/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp b/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
index 3fd9fd4..9fc7f7d 100644
--- a/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
+++ b/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
@@ -115,7 +115,7 @@
void StringFindStartswithCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
- IncludeInserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ IncludeInserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(IncludeInserter->CreatePPCallbacks());
}
diff --git a/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp
index cc8cb3b..2b7edc1 100644
--- a/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp
@@ -66,7 +66,7 @@
void LambdaFunctionNameCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
- PP->addPPCallbacks(llvm::make_unique<MacroExpansionsWithFileAndLine>(
+ PP->addPPCallbacks(std::make_unique<MacroExpansionsWithFileAndLine>(
&SuppressMacroExpansions));
}
diff --git a/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp
index 874cd47..7ca5c1e 100644
--- a/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp
@@ -250,7 +250,7 @@
void MacroParenthesesCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
- PP->addPPCallbacks(llvm::make_unique<MacroParenthesesPPCallbacks>(PP, this));
+ PP->addPPCallbacks(std::make_unique<MacroParenthesesPPCallbacks>(PP, this));
}
} // namespace bugprone
diff --git a/clang-tools-extra/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.cpp
index ee70346..add4d1d 100644
--- a/clang-tools-extra/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.cpp
@@ -173,7 +173,7 @@
void MacroRepeatedSideEffectsCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
- PP->addPPCallbacks(::llvm::make_unique<MacroRepeatedPPCallbacks>(*this, *PP));
+ PP->addPPCallbacks(::std::make_unique<MacroRepeatedPPCallbacks>(*this, *PP));
}
} // namespace bugprone
diff --git a/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
index 8e316eb..2a5c5fa 100644
--- a/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
@@ -102,8 +102,8 @@
return false;
Sequence =
- llvm::make_unique<ExprSequence>(TheCFG.get(), FunctionBody, Context);
- BlockMap = llvm::make_unique<StmtToBlockMap>(TheCFG.get(), Context);
+ std::make_unique<ExprSequence>(TheCFG.get(), FunctionBody, Context);
+ BlockMap = std::make_unique<StmtToBlockMap>(TheCFG.get(), Context);
Visited.clear();
const CFGBlock *Block = BlockMap->blockContainingStmt(MovingCall);
diff --git a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
index 87ac2de..a7a78ec 100644
--- a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
@@ -51,7 +51,7 @@
// Per [headers]p5, setjmp must be exposed as a macro instead of a function,
// despite the allowance in C for setjmp to also be an extern function.
- PP->addPPCallbacks(llvm::make_unique<SetJmpMacroCallbacks>(*this));
+ PP->addPPCallbacks(std::make_unique<SetJmpMacroCallbacks>(*this));
}
void SetLongJmpCheck::registerMatchers(MatchFinder *Finder) {
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp
index ac5ec13..21aead5 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp
@@ -74,7 +74,7 @@
if (!getLangOpts().CPlusPlus11)
return;
- PP->addPPCallbacks(llvm::make_unique<MacroUsageCallbacks>(
+ PP->addPPCallbacks(std::make_unique<MacroUsageCallbacks>(
this, SM, AllowedRegexp, CheckCapsOnly, IgnoreCommandLineMacros));
}
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
index 28fccfd..7cd6603 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
@@ -35,7 +35,7 @@
if (!getLangOpts().CPlusPlus)
return;
- Inserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ Inserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(Inserter->CreatePPCallbacks());
}
diff --git a/clang-tools-extra/clang-tidy/fuchsia/RestrictSystemIncludesCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/RestrictSystemIncludesCheck.cpp
index 08981fc..98d317b 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/RestrictSystemIncludesCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/RestrictSystemIncludesCheck.cpp
@@ -103,7 +103,7 @@
void RestrictSystemIncludesCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
PP->addPPCallbacks(
- llvm::make_unique<RestrictedIncludesPPCallbacks>(*this, SM));
+ std::make_unique<RestrictedIncludesPPCallbacks>(*this, SM));
}
void RestrictSystemIncludesCheck::storeOptions(
diff --git a/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp
index d279343..a811d37 100644
--- a/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp
@@ -79,7 +79,7 @@
void AvoidUnderscoreInGoogletestNameCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
PP->addPPCallbacks(
- llvm::make_unique<AvoidUnderscoreInGoogletestNameCallback>(PP, this));
+ std::make_unique<AvoidUnderscoreInGoogletestNameCallback>(PP, this));
}
} // namespace readability
diff --git a/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp b/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp
index fb6fd3b..f41eba2 100644
--- a/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp
@@ -68,7 +68,7 @@
callee(functionDecl(hasAttr(attr::Format)))))))
.bind("tl"),
this);
- IdentTable = llvm::make_unique<IdentifierTable>(getLangOpts());
+ IdentTable = std::make_unique<IdentifierTable>(getLangOpts());
}
void IntegerTypesCheck::check(const MatchFinder::MatchResult &Result) {
diff --git a/clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp b/clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp
index 40d65a65..787c305 100644
--- a/clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp
@@ -52,7 +52,7 @@
TodoCommentCheck::TodoCommentCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
- Handler(llvm::make_unique<TodoCommentHandler>(
+ Handler(std::make_unique<TodoCommentHandler>(
*this, Context->getOptions().User)) {}
void TodoCommentCheck::registerPPCallbacks(const SourceManager &SM,
diff --git a/clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp b/clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
index 955a888..27307c0 100644
--- a/clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
@@ -125,7 +125,7 @@
return;
PP->addPPCallbacks(
- llvm::make_unique<UpgradeGoogletestCasePPCallback>(this, PP));
+ std::make_unique<UpgradeGoogletestCasePPCallback>(this, PP));
}
void UpgradeGoogletestCaseCheck::registerMatchers(MatchFinder *Finder) {
diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
index a894c58..009a5a6 100644
--- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
+++ b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
@@ -53,7 +53,7 @@
void IncludeOrderCheck::registerPPCallbacks(const SourceManager &SM,
Preprocessor *PP,
Preprocessor *ModuleExpanderPP) {
- PP->addPPCallbacks(::llvm::make_unique<IncludeOrderPPCallbacks>(*this, SM));
+ PP->addPPCallbacks(::std::make_unique<IncludeOrderPPCallbacks>(*this, SM));
}
static int getPriority(StringRef Filename, bool IsAngled, bool IsMainModule) {
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
index 4dbc4fd..9514c044 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
@@ -135,7 +135,7 @@
auto MyDiag = diag(Param->getLocation(), "parameter %0 is unused") << Param;
if (!Indexer) {
- Indexer = llvm::make_unique<IndexerVisitor>(*Result.Context);
+ Indexer = std::make_unique<IndexerVisitor>(*Result.Context);
}
// Cannot remove parameter for non-local functions.
diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
index af4d47c..264a6f0 100644
--- a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
@@ -44,7 +44,7 @@
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
if (getLangOpts().CPlusPlus) {
PP->addPPCallbacks(
- ::llvm::make_unique<IncludeModernizePPCallbacks>(*this, getLangOpts()));
+ ::std::make_unique<IncludeModernizePPCallbacks>(*this, getLangOpts()));
}
}
diff --git a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
index 5fbc7be..44ff064 100644
--- a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
@@ -69,7 +69,7 @@
Preprocessor *PP,
Preprocessor *ModuleExpanderPP) {
if (isLanguageVersionSupported(getLangOpts())) {
- Inserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ Inserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(Inserter->CreatePPCallbacks());
}
@@ -128,7 +128,7 @@
// Be conservative for cases where we construct an array without any
// initalization.
// For example,
- // P.reset(new int[5]) // check fix: P = make_unique<int []>(5)
+ // P.reset(new int[5]) // check fix: P = std::make_unique<int []>(5)
//
// The fix of the check has side effect, it introduces default initialization
// which maybe unexpected and cause performance regression.
diff --git a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
index a83e54a..a08aa2b 100644
--- a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
@@ -171,7 +171,7 @@
// currently does not provide any benefit to other languages, despite being
// benign.
if (getLangOpts().CPlusPlus) {
- Inserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ Inserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(Inserter->CreatePPCallbacks());
}
diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp
index c1c2235..9551b12 100644
--- a/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp
@@ -140,7 +140,7 @@
// benign.
if (!getLangOpts().CPlusPlus)
return;
- Inserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ Inserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(Inserter->CreatePPCallbacks());
}
diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp
index 44c108c..dbaceca 100644
--- a/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp
@@ -44,7 +44,7 @@
void ReplaceRandomShuffleCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
- IncludeInserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ IncludeInserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(IncludeInserter->CreatePPCallbacks());
}
diff --git a/clang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp b/clang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp
index aa5c819..f64d91b 100644
--- a/clang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp
+++ b/clang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp
@@ -93,7 +93,7 @@
void MoveConstructorInitCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
- Inserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ Inserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(Inserter->CreatePPCallbacks());
}
diff --git a/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp b/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
index 652a6f9..01d0e03 100644
--- a/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
+++ b/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
@@ -36,7 +36,7 @@
void TypePromotionInMathFnCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
- IncludeInserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ IncludeInserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(IncludeInserter->CreatePPCallbacks());
}
diff --git a/clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp b/clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
index cf66081..c5bbcdb 100644
--- a/clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
+++ b/clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
@@ -169,7 +169,7 @@
void UnnecessaryValueParamCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
- Inserter = llvm::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
+ Inserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
IncludeStyle);
PP->addPPCallbacks(Inserter->CreatePPCallbacks());
}
diff --git a/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp b/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
index 1016551..aff11bd 100644
--- a/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
+++ b/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
@@ -42,7 +42,7 @@
auto ExternalDiagEngine = &Compiler.getDiagnostics();
auto DiagConsumer =
new ClangTidyDiagnosticConsumer(*Context, ExternalDiagEngine);
- auto DiagEngine = llvm::make_unique<DiagnosticsEngine>(
+ auto DiagEngine = std::make_unique<DiagnosticsEngine>(
new DiagnosticIDs, new DiagnosticOptions, DiagConsumer);
Context->setDiagnosticsEngine(DiagEngine.get());
@@ -51,7 +51,7 @@
std::vector<std::unique_ptr<ASTConsumer>> Vec;
Vec.push_back(Factory.CreateASTConsumer(Compiler, File));
- return llvm::make_unique<WrapConsumer>(
+ return std::make_unique<WrapConsumer>(
std::move(Context), std::move(DiagEngine), std::move(Vec));
}
@@ -67,9 +67,9 @@
if (Arg.startswith("-checks="))
OverrideOptions.Checks = Arg.substr(strlen("-checks="));
- auto Options = llvm::make_unique<FileOptionsProvider>(
+ auto Options = std::make_unique<FileOptionsProvider>(
GlobalOptions, DefaultOptions, OverrideOptions);
- Context = llvm::make_unique<ClangTidyContext>(std::move(Options));
+ Context = std::make_unique<ClangTidyContext>(std::move(Options));
return true;
}
diff --git a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
index 1bdfe21..2795cab 100644
--- a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -243,7 +243,7 @@
void IdentifierNamingCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
ModuleExpanderPP->addPPCallbacks(
- llvm::make_unique<IdentifierNamingCheckPPCallbacks>(ModuleExpanderPP,
+ std::make_unique<IdentifierNamingCheckPPCallbacks>(ModuleExpanderPP,
this));
}
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.cpp
index ea46d53..295d22d 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.cpp
@@ -99,7 +99,7 @@
void RedundantPreprocessorCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
PP->addPPCallbacks(
- ::llvm::make_unique<RedundantPreprocessorCallbacks>(*this, *PP));
+ ::std::make_unique<RedundantPreprocessorCallbacks>(*this, *PP));
}
} // namespace readability
diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
index 07bf27b..a8ad9cd 100644
--- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
+++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
@@ -289,7 +289,7 @@
if (!Config.empty()) {
if (llvm::ErrorOr<ClangTidyOptions> ParsedConfig =
parseConfiguration(Config)) {
- return llvm::make_unique<ConfigOptionsProvider>(
+ return std::make_unique<ConfigOptionsProvider>(
GlobalOptions,
ClangTidyOptions::getDefaults().mergeWith(DefaultOptions),
*ParsedConfig, OverrideOptions);
@@ -299,7 +299,7 @@
return nullptr;
}
}
- return llvm::make_unique<FileOptionsProvider>(GlobalOptions, DefaultOptions,
+ return std::make_unique<FileOptionsProvider>(GlobalOptions, DefaultOptions,
OverrideOptions, std::move(FS));
}
diff --git a/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp b/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp
index 366d7d4..b988ef6 100644
--- a/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp
+++ b/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp
@@ -269,7 +269,7 @@
void HeaderGuardCheck::registerPPCallbacks(const SourceManager &SM,
Preprocessor *PP,
Preprocessor *ModuleExpanderPP) {
- PP->addPPCallbacks(llvm::make_unique<HeaderGuardPPCallbacks>(PP, this));
+ PP->addPPCallbacks(std::make_unique<HeaderGuardPPCallbacks>(PP, this));
}
bool HeaderGuardCheck::shouldSuggestEndifComment(StringRef FileName) {
diff --git a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
index 6b366cf..e0d02f3 100644
--- a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
+++ b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
@@ -42,7 +42,7 @@
IncludeInserter::~IncludeInserter() {}
std::unique_ptr<PPCallbacks> IncludeInserter::CreatePPCallbacks() {
- return llvm::make_unique<IncludeInserterCallback>(this);
+ return std::make_unique<IncludeInserterCallback>(this);
}
llvm::Optional<FixItHint>
@@ -58,7 +58,7 @@
// file.
IncludeSorterByFile.insert(std::make_pair(
FileID,
- llvm::make_unique<IncludeSorter>(
+ std::make_unique<IncludeSorter>(
&SourceMgr, &LangOpts, FileID,
SourceMgr.getFilename(SourceMgr.getLocForStartOfFile(FileID)),
Style)));
@@ -72,7 +72,7 @@
FileID FileID = SourceMgr.getFileID(HashLocation);
if (IncludeSorterByFile.find(FileID) == IncludeSorterByFile.end()) {
IncludeSorterByFile.insert(std::make_pair(
- FileID, llvm::make_unique<IncludeSorter>(
+ FileID, std::make_unique<IncludeSorter>(
&SourceMgr, &LangOpts, FileID,
SourceMgr.getFilename(HashLocation), Style)));
}
diff --git a/clang-tools-extra/clang-tidy/utils/IncludeInserter.h b/clang-tools-extra/clang-tidy/utils/IncludeInserter.h
index 36c16ac..e67604f 100644
--- a/clang-tools-extra/clang-tidy/utils/IncludeInserter.h
+++ b/clang-tools-extra/clang-tidy/utils/IncludeInserter.h
@@ -33,7 +33,7 @@
/// public:
/// void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
/// Preprocessor *ModuleExpanderPP) override {
-/// Inserter = llvm::make_unique<IncludeInserter>(
+/// Inserter = std::make_unique<IncludeInserter>(
/// SM, getLangOpts(), utils::IncludeSorter::IS_Google);
/// PP->addPPCallbacks(Inserter->CreatePPCallbacks());
/// }
diff --git a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
index 2758b18..4c17a5c 100644
--- a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
+++ b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
@@ -53,7 +53,7 @@
if (Rule && llvm::any_of(Rule->Cases, [](const RewriteRule::Case &C) {
return !C.AddedIncludes.empty();
})) {
- Inserter = llvm::make_unique<IncludeInserter>(
+ Inserter = std::make_unique<IncludeInserter>(
SM, getLangOpts(), utils::IncludeSorter::IS_LLVM);
PP->addPPCallbacks(Inserter->CreatePPCallbacks());
}