From bf934d857385397697a0d77335bfee4c0cff34a5 Mon Sep 17 00:00:00 2001 From: Mark Searles Date: Thu, 15 Aug 2019 19:36:48 -0700 Subject: [PATCH] Revert "[Clang] Migrate llvm::make_unique to std::make_unique" This reverts commit 49a6b091014f0033829e099ea7ac50bc7b6e9c32. Commit requires newer gcc than is used in our internal builds. Revert until newer gcc is available. Change-Id: Ia117ed41217e297fb3b5988057912bbfe20eb3b7 --- .../AnnotateFunctions/AnnotateFunctions.cpp | 2 +- .../PrintFunctionNames/PrintFunctionNames.cpp | 2 +- examples/clang-interpreter/main.cpp | 2 +- include/clang/AST/ASTImporterSharedState.h | 2 +- include/clang/Basic/SyncScope.h | 2 +- include/clang/Frontend/ASTUnit.h | 2 +- include/clang/Lex/Preprocessor.h | 4 +- include/clang/Sema/SemaInternal.h | 2 +- include/clang/Sema/TypoCorrection.h | 8 +- include/clang/Serialization/ASTReader.h | 4 +- .../Core/BugReporter/BugReporter.h | 2 +- .../Core/PathSensitive/ExplodedGraph.h | 2 +- include/clang/Tooling/ASTDiff/ASTDiff.h | 2 +- .../RefactoringActionRulesInternal.h | 2 +- lib/ARCMigrate/ARCMT.cpp | 4 +- lib/ARCMigrate/ObjCMT.cpp | 6 +- lib/AST/ASTContext.cpp | 2 +- lib/AST/CXXInheritance.cpp | 2 +- lib/AST/ExternalASTMerger.cpp | 2 +- lib/AST/ItaniumCXXABI.cpp | 2 +- lib/AST/Mangle.cpp | 2 +- lib/AST/MicrosoftCXXABI.cpp | 2 +- lib/AST/VTableBuilder.cpp | 12 +- lib/ASTMatchers/ASTMatchFinder.cpp | 2 +- lib/ASTMatchers/Dynamic/Marshallers.h | 14 +- lib/ASTMatchers/Dynamic/Registry.cpp | 2 +- lib/Analysis/AnalysisDeclContext.cpp | 2 +- lib/Analysis/CallGraph.cpp | 2 +- lib/Analysis/Consumed.cpp | 6 +- lib/Analysis/ThreadSafety.cpp | 30 ++-- .../SampleAnalyzer/MainCallChecker.cpp | 2 +- lib/Basic/FileManager.cpp | 4 +- lib/Basic/SourceManager.cpp | 10 +- lib/CodeGen/BackendUtil.cpp | 6 +- lib/CodeGen/CGCall.cpp | 8 +- lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 4 +- lib/CodeGen/CodeGenAction.cpp | 6 +- lib/CodeGen/CodeGenModule.cpp | 2 +- lib/CodeGen/CodeGenPGO.cpp | 2 +- .../ObjectFilePCHContainerOperations.cpp | 4 +- .../linux/DirectoryWatcher-linux.cpp | 4 +- .../mac/DirectoryWatcher-mac.cpp | 2 +- lib/Driver/Driver.cpp | 96 ++++++------- lib/Driver/DriverOptions.cpp | 2 +- lib/Driver/ToolChains/AMDGPU.cpp | 2 +- lib/Driver/ToolChains/AVR.cpp | 2 +- lib/Driver/ToolChains/Ananas.cpp | 4 +- lib/Driver/ToolChains/BareMetal.cpp | 2 +- lib/Driver/ToolChains/Clang.cpp | 16 +-- lib/Driver/ToolChains/CloudABI.cpp | 2 +- lib/Driver/ToolChains/CommonArgs.cpp | 4 +- lib/Driver/ToolChains/CrossWindows.cpp | 4 +- lib/Driver/ToolChains/Cuda.cpp | 6 +- lib/Driver/ToolChains/Darwin.cpp | 12 +- lib/Driver/ToolChains/DragonFly.cpp | 4 +- lib/Driver/ToolChains/FreeBSD.cpp | 4 +- lib/Driver/ToolChains/Fuchsia.cpp | 2 +- lib/Driver/ToolChains/Gnu.cpp | 6 +- lib/Driver/ToolChains/HIP.cpp | 10 +- lib/Driver/ToolChains/Hexagon.cpp | 4 +- lib/Driver/ToolChains/MSP430.cpp | 2 +- lib/Driver/ToolChains/MSVC.cpp | 4 +- lib/Driver/ToolChains/MinGW.cpp | 4 +- lib/Driver/ToolChains/Minix.cpp | 4 +- lib/Driver/ToolChains/Myriad.cpp | 6 +- lib/Driver/ToolChains/NaCl.cpp | 2 +- lib/Driver/ToolChains/NetBSD.cpp | 4 +- lib/Driver/ToolChains/OpenBSD.cpp | 4 +- lib/Driver/ToolChains/PS4CPU.cpp | 6 +- lib/Driver/ToolChains/RISCVToolchain.cpp | 2 +- lib/Driver/ToolChains/Solaris.cpp | 4 +- lib/Driver/ToolChains/WebAssembly.cpp | 2 +- lib/Driver/ToolChains/XCore.cpp | 4 +- lib/Format/ContinuationIndenter.cpp | 6 +- lib/Format/Format.cpp | 4 +- lib/Format/UnwrappedLineParser.cpp | 2 +- lib/Frontend/ASTConsumers.cpp | 8 +- lib/Frontend/ASTUnit.cpp | 14 +- lib/Frontend/ChainedIncludesSource.cpp | 2 +- lib/Frontend/CompilerInstance.cpp | 14 +- .../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 +- .../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 +- .../ExecuteCompilerInvocation.cpp | 86 ++++++------ lib/Index/IndexingAction.cpp | 12 +- lib/Lex/PPDirectives.cpp | 4 +- lib/Lex/PPLexerChange.cpp | 4 +- lib/Lex/PPMacroExpansion.cpp | 2 +- lib/Lex/Pragma.cpp | 2 +- lib/Lex/Preprocessor.cpp | 4 +- lib/Parse/ParseCXXInlineMethods.cpp | 2 +- lib/Parse/ParseExpr.cpp | 2 +- lib/Parse/ParsePragma.cpp | 90 ++++++------ lib/Parse/ParseStmt.cpp | 2 +- lib/Parse/ParseTentative.cpp | 2 +- lib/Sema/Sema.cpp | 2 +- lib/Sema/SemaCXXScopeSpec.cpp | 2 +- lib/Sema/SemaDecl.cpp | 6 +- lib/Sema/SemaDeclCXX.cpp | 6 +- lib/Sema/SemaDeclObjC.cpp | 4 +- lib/Sema/SemaExpr.cpp | 2 +- lib/Sema/SemaExprMember.cpp | 2 +- lib/Sema/SemaExprObjC.cpp | 2 +- lib/Sema/SemaInit.cpp | 2 +- lib/Sema/SemaLookup.cpp | 2 +- lib/Sema/SemaOpenMP.cpp | 4 +- lib/Sema/SemaTemplate.cpp | 6 +- lib/Sema/SemaTemplateVariadic.cpp | 2 +- lib/Serialization/ASTReader.cpp | 2 +- lib/Serialization/ModuleManager.cpp | 2 +- lib/Serialization/PCHContainerOperations.cpp | 6 +- .../Checkers/ArrayBoundChecker.cpp | 2 +- .../Checkers/ArrayBoundCheckerV2.cpp | 4 +- .../Checkers/BasicObjCFoundationChecks.cpp | 10 +- .../BlockInCriticalSectionChecker.cpp | 2 +- .../Checkers/BoolAssignmentChecker.cpp | 2 +- .../Checkers/CStringChecker.cpp | 10 +- .../Checkers/CallAndMessageChecker.cpp | 16 +-- .../Checkers/CastSizeChecker.cpp | 2 +- lib/StaticAnalyzer/Checkers/ChrootChecker.cpp | 2 +- lib/StaticAnalyzer/Checkers/CloneChecker.cpp | 4 +- .../Checkers/ConversionChecker.cpp | 2 +- lib/StaticAnalyzer/Checkers/DebugCheckers.cpp | 2 +- .../DeleteWithNonVirtualDtorChecker.cpp | 4 +- .../Checkers/DereferenceChecker.cpp | 4 +- .../Checkers/DivZeroChecker.cpp | 4 +- .../Checkers/DynamicTypeChecker.cpp | 2 +- .../Checkers/DynamicTypePropagation.cpp | 2 +- .../Checkers/EnumCastOutOfRangeChecker.cpp | 2 +- .../Checkers/ExprInspectionChecker.cpp | 2 +- .../Checkers/FixedAddressChecker.cpp | 2 +- .../Checkers/GenericTaintChecker.cpp | 4 +- .../Checkers/InnerPointerChecker.cpp | 2 +- .../Checkers/IteratorChecker.cpp | 8 +- .../Checkers/LocalizationChecker.cpp | 2 +- lib/StaticAnalyzer/Checkers/MIGChecker.cpp | 2 +- .../Checkers/MPI-Checker/MPIBugReporter.cpp | 10 +- .../Checkers/MacOSKeychainAPIChecker.cpp | 14 +- .../Checkers/MacOSXAPIChecker.cpp | 2 +- lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 32 ++--- .../Checkers/MmapWriteExecChecker.cpp | 2 +- lib/StaticAnalyzer/Checkers/MoveChecker.cpp | 4 +- .../Checkers/NSAutoreleasePoolChecker.cpp | 2 +- .../Checkers/NSErrorChecker.cpp | 2 +- .../Checkers/NonNullParamChecker.cpp | 4 +- .../Checkers/NullabilityChecker.cpp | 4 +- .../Checkers/ObjCAtSyncChecker.cpp | 4 +- .../Checkers/ObjCContainersChecker.cpp | 2 +- .../Checkers/ObjCSelfInitChecker.cpp | 2 +- .../Checkers/ObjCSuperDeallocChecker.cpp | 2 +- .../Checkers/PaddingChecker.cpp | 4 +- .../Checkers/PointerArithChecker.cpp | 4 +- .../Checkers/PointerSubChecker.cpp | 2 +- .../Checkers/PthreadLockChecker.cpp | 12 +- .../RetainCountChecker/RetainCountChecker.cpp | 10 +- .../RetainCountDiagnostics.cpp | 6 +- .../Checkers/ReturnPointerRangeChecker.cpp | 2 +- .../Checkers/ReturnUndefChecker.cpp | 2 +- .../Checkers/SimpleStreamChecker.cpp | 4 +- .../Checkers/StackAddrEscapeChecker.cpp | 16 +-- lib/StaticAnalyzer/Checkers/StreamChecker.cpp | 8 +- .../Checkers/TaintTesterChecker.cpp | 2 +- .../Checkers/TestAfterDivZeroChecker.cpp | 4 +- .../Checkers/UndefBranchChecker.cpp | 2 +- .../Checkers/UndefCapturedBlockVarChecker.cpp | 4 +- .../Checkers/UndefResultChecker.cpp | 2 +- .../UndefinedArraySubscriptChecker.cpp | 2 +- .../Checkers/UndefinedAssignmentChecker.cpp | 2 +- .../UninitializedObjectChecker.cpp | 4 +- .../Checkers/UnixAPIChecker.cpp | 6 +- .../Checkers/VLASizeChecker.cpp | 4 +- lib/StaticAnalyzer/Checkers/ValistChecker.cpp | 8 +- lib/StaticAnalyzer/Checkers/VforkChecker.cpp | 2 +- .../Checkers/VirtualCallChecker.cpp | 4 +- lib/StaticAnalyzer/Core/BugReporter.cpp | 26 ++-- .../Core/BugReporterVisitors.cpp | 28 ++-- .../Core/RangeConstraintManager.cpp | 2 +- lib/StaticAnalyzer/Core/RegionStore.cpp | 4 +- .../Core/SMTConstraintManager.cpp | 2 +- lib/StaticAnalyzer/Core/WorkList.cpp | 12 +- .../Frontend/AnalysisConsumer.cpp | 12 +- .../Frontend/CheckerRegistration.cpp | 2 +- .../Frontend/FrontendActions.cpp | 2 +- lib/Tooling/ASTDiff/ASTDiff.cpp | 16 +-- lib/Tooling/AllTUsExecution.cpp | 2 +- lib/Tooling/CommonOptionsParser.cpp | 2 +- lib/Tooling/CompilationDatabase.cpp | 4 +- .../DependencyScanningFilesystem.cpp | 4 +- .../DependencyScanningWorker.cpp | 4 +- .../GuessTargetAndModeCompilationDatabase.cpp | 2 +- .../InterpolatingCompilationDatabase.cpp | 2 +- .../Refactoring/ASTSelectionRequirements.cpp | 2 +- .../Refactoring/RefactoringActions.cpp | 4 +- .../Refactoring/Rename/RenamingAction.cpp | 4 +- .../Refactoring/Rename/SymbolOccurrences.cpp | 2 +- .../Refactoring/Rename/USRFindingAction.cpp | 2 +- lib/Tooling/RefactoringCallbacks.cpp | 2 +- lib/Tooling/StandaloneExecution.cpp | 2 +- lib/Tooling/Syntax/Tokens.cpp | 2 +- tools/c-index-test/core_main.cpp | 2 +- tools/clang-check/ClangCheck.cpp | 2 +- tools/clang-diff/ClangDiff.cpp | 4 +- .../ClangExtDefMapGen.cpp | 2 +- .../clang-fuzzer/handle-llvm/handle_llvm.cpp | 2 +- tools/clang-import-test/clang-import-test.cpp | 22 +-- tools/clang-refactor/ClangRefactor.cpp | 12 +- tools/clang-refactor/TestSupport.cpp | 2 +- tools/clang-scan-deps/ClangScanDeps.cpp | 4 +- tools/driver/cc1_main.cpp | 4 +- tools/driver/cc1as_main.cpp | 8 +- tools/libclang/CIndex.cpp | 2 +- tools/libclang/CIndexDiagnostic.cpp | 6 +- tools/libclang/CIndexer.cpp | 2 +- tools/libclang/CXLoadedDiagnostic.cpp | 4 +- tools/libclang/Indexing.cpp | 8 +- unittests/AST/EvaluateAsRValueTest.cpp | 2 +- unittests/AST/ExternalASTSourceTest.cpp | 2 +- unittests/AST/RecursiveASTVisitorTest.cpp | 2 +- .../ASTMatchers/ASTMatchersInternalTest.cpp | 12 +- .../ASTMatchers/ASTMatchersNarrowingTest.cpp | 26 ++-- unittests/ASTMatchers/ASTMatchersNodeTest.cpp | 10 +- .../ASTMatchers/ASTMatchersTraversalTest.cpp | 130 +++++++++--------- unittests/ASTMatchers/Dynamic/ParserTest.cpp | 8 +- unittests/Basic/FileManagerTest.cpp | 22 +-- unittests/Basic/SourceManagerTest.cpp | 2 +- .../CrossTU/CrossTranslationUnitTest.cpp | 2 +- unittests/Frontend/ASTUnitTest.cpp | 2 +- unittests/Frontend/CompilerInstanceTest.cpp | 2 +- unittests/Frontend/FrontendActionTest.cpp | 2 +- unittests/Index/IndexTests.cpp | 2 +- unittests/Lex/LexerTest.cpp | 2 +- unittests/Sema/CodeCompleteTest.cpp | 2 +- unittests/Sema/ExternalSemaSourceTest.cpp | 2 +- .../StaticAnalyzer/CallDescriptionTest.cpp | 2 +- unittests/StaticAnalyzer/StoreTest.cpp | 2 +- unittests/StaticAnalyzer/SymbolReaperTest.cpp | 2 +- unittests/Tooling/CompilationDatabaseTest.cpp | 6 +- unittests/Tooling/ExecutionTest.cpp | 2 +- unittests/Tooling/RefactoringTest.cpp | 2 +- unittests/Tooling/Syntax/TokensTest.cpp | 2 +- unittests/Tooling/Syntax/TreeTest.cpp | 6 +- unittests/Tooling/TestVisitor.h | 2 +- unittests/Tooling/ToolingTest.cpp | 16 +-- utils/TableGen/ClangAttrEmitter.cpp | 44 +++--- utils/TableGen/NeonEmitter.cpp | 8 +- 259 files changed, 831 insertions(+), 831 deletions(-) diff --git a/examples/AnnotateFunctions/AnnotateFunctions.cpp b/examples/AnnotateFunctions/AnnotateFunctions.cpp index d201bf3df89..96eb78eb17d 100644 --- a/examples/AnnotateFunctions/AnnotateFunctions.cpp +++ b/examples/AnnotateFunctions/AnnotateFunctions.cpp @@ -41,7 +41,7 @@ class AnnotateFunctionsAction : public PluginASTAction { public: std::unique_ptr CreateASTConsumer(CompilerInstance &CI, llvm::StringRef) override { - return std::make_unique(); + return llvm::make_unique(); } bool ParseArgs(const CompilerInstance &CI, diff --git a/examples/PrintFunctionNames/PrintFunctionNames.cpp b/examples/PrintFunctionNames/PrintFunctionNames.cpp index 6509a6440e1..e573ac93eb3 100644 --- a/examples/PrintFunctionNames/PrintFunctionNames.cpp +++ b/examples/PrintFunctionNames/PrintFunctionNames.cpp @@ -81,7 +81,7 @@ class PrintFunctionNamesAction : public PluginASTAction { protected: std::unique_ptr CreateASTConsumer(CompilerInstance &CI, llvm::StringRef) override { - return std::make_unique(CI, ParsedTemplates); + return llvm::make_unique(CI, ParsedTemplates); } bool ParseArgs(const CompilerInstance &CI, diff --git a/examples/clang-interpreter/main.cpp b/examples/clang-interpreter/main.cpp index 134d70774f8..b81b7ebbb61 100644 --- a/examples/clang-interpreter/main.cpp +++ b/examples/clang-interpreter/main.cpp @@ -58,7 +58,7 @@ class SimpleJIT { IRCompileLayer CompileLayer{ES, ObjectLayer, SimpleCompiler(*TM)}; static std::unique_ptr createMemMgr() { - return std::make_unique(); + return llvm::make_unique(); } SimpleJIT( diff --git a/include/clang/AST/ASTImporterSharedState.h b/include/clang/AST/ASTImporterSharedState.h index 829eb1c611c..3635a62deef 100644 --- a/include/clang/AST/ASTImporterSharedState.h +++ b/include/clang/AST/ASTImporterSharedState.h @@ -47,7 +47,7 @@ class ASTImporterSharedState { ASTImporterSharedState() = default; ASTImporterSharedState(TranslationUnitDecl &ToTU) { - LookupTable = std::make_unique(ToTU); + LookupTable = llvm::make_unique(ToTU); } ASTImporterLookupTable *getLookupTable() { return LookupTable.get(); } diff --git a/include/clang/Basic/SyncScope.h b/include/clang/Basic/SyncScope.h index a7c0590bd84..3ebf40f7156 100644 --- a/include/clang/Basic/SyncScope.h +++ b/include/clang/Basic/SyncScope.h @@ -144,7 +144,7 @@ AtomicScopeModel::create(AtomicScopeModelKind K) { case AtomicScopeModelKind::None: return std::unique_ptr{}; case AtomicScopeModelKind::OpenCL: - return std::make_unique(); + return llvm::make_unique(); } llvm_unreachable("Invalid atomic scope model kind"); } diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 08cc91946eb..4491bf298c1 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -315,7 +315,7 @@ class ASTUnit { CodeCompletionTUInfo &getCodeCompletionTUInfo() { if (!CCTUInfo) - CCTUInfo = std::make_unique( + CCTUInfo = llvm::make_unique( std::make_shared()); return *CCTUInfo; } diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index fdf4bebd87f..f65b0cda462 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -994,7 +994,7 @@ class Preprocessor { PPCallbacks *getPPCallbacks() const { return Callbacks.get(); } void addPPCallbacks(std::unique_ptr C) { if (Callbacks) - C = std::make_unique(std::move(C), + C = llvm::make_unique(std::move(C), std::move(Callbacks)); Callbacks = std::move(C); } @@ -1471,7 +1471,7 @@ class Preprocessor { if (LexLevel) { // It's not correct in general to enter caching lex mode while in the // middle of a nested lexing action. - auto TokCopy = std::make_unique(1); + auto TokCopy = llvm::make_unique(1); TokCopy[0] = Tok; EnterTokenStream(std::move(TokCopy), 1, true, IsReinject); } else { diff --git a/include/clang/Sema/SemaInternal.h b/include/clang/Sema/SemaInternal.h index cdaf7b70a92..dfb34daa14d 100644 --- a/include/clang/Sema/SemaInternal.h +++ b/include/clang/Sema/SemaInternal.h @@ -97,7 +97,7 @@ class TypoCorrectionConsumer : public VisibleDeclConsumer { bool EnteringContext) : Typo(TypoName.getName().getAsIdentifierInfo()), CurrentTCIndex(0), SavedTCIndex(0), SemaRef(SemaRef), S(S), - SS(SS ? std::make_unique(*SS) : nullptr), + SS(SS ? llvm::make_unique(*SS) : nullptr), CorrectionValidator(std::move(CCC)), MemberContext(MemberContext), Result(SemaRef, TypoName, LookupKind), Namespaces(SemaRef.Context, SemaRef.CurContext, SS), diff --git a/include/clang/Sema/TypoCorrection.h b/include/clang/Sema/TypoCorrection.h index e0f8d152dbe..b49a96c0b93 100644 --- a/include/clang/Sema/TypoCorrection.h +++ b/include/clang/Sema/TypoCorrection.h @@ -356,7 +356,7 @@ class DefaultFilterCCC final : public CorrectionCandidateCallback { : CorrectionCandidateCallback(Typo, TypoNNS) {} std::unique_ptr clone() override { - return std::make_unique(*this); + return llvm::make_unique(*this); } }; @@ -369,7 +369,7 @@ class DeclFilterCCC final : public CorrectionCandidateCallback { return candidate.getCorrectionDeclAs(); } std::unique_ptr clone() override { - return std::make_unique(*this); + return llvm::make_unique(*this); } }; @@ -384,7 +384,7 @@ class FunctionCallFilterCCC : public CorrectionCandidateCallback { bool ValidateCandidate(const TypoCorrection &candidate) override; std::unique_ptr clone() override { - return std::make_unique(*this); + return llvm::make_unique(*this); } private: @@ -409,7 +409,7 @@ class NoTypoCorrectionCCC final : public CorrectionCandidateCallback { return false; } std::unique_ptr clone() override { - return std::make_unique(*this); + return llvm::make_unique(*this); } }; diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 13d16539cc5..37bea48d884 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -1578,7 +1578,7 @@ class ASTReader /// Takes ownership of \p L. void addListener(std::unique_ptr L) { if (Listener) - L = std::make_unique(std::move(L), + L = llvm::make_unique(std::move(L), std::move(Listener)); Listener = std::move(L); } @@ -1594,7 +1594,7 @@ class ASTReader auto Old = Reader.takeListener(); if (Old) { Chained = true; - L = std::make_unique(std::move(L), + L = llvm::make_unique(std::move(L), std::move(Old)); } Reader.setListener(std::move(L)); diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h index 95aab663e2a..c2a5bb7f629 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h @@ -648,7 +648,7 @@ class NoteTag : public ProgramPointTag { public: const NoteTag *makeNoteTag(Callback &&Cb, bool IsPrunable = false) { - // We cannot use std::make_unique because we cannot access the private + // We cannot use make_unique because we cannot access the private // constructor from inside it. std::unique_ptr T(new NoteTag(std::move(Cb), IsPrunable)); Tags.push_back(std::move(T)); diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h index 598e2f632c4..864266e77ee 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h @@ -337,7 +337,7 @@ class ExplodedGraph { bool IsSink = false); std::unique_ptr MakeEmptyGraph() const { - return std::make_unique(); + return llvm::make_unique(); } /// addRoot - Add an untyped node to the set of roots. diff --git a/include/clang/Tooling/ASTDiff/ASTDiff.h b/include/clang/Tooling/ASTDiff/ASTDiff.h index c1cc124e1e9..d6cbc09dced 100644 --- a/include/clang/Tooling/ASTDiff/ASTDiff.h +++ b/include/clang/Tooling/ASTDiff/ASTDiff.h @@ -71,7 +71,7 @@ class SyntaxTree { /// Constructs a tree from any AST node. template SyntaxTree(T *Node, ASTContext &AST) - : TreeImpl(std::make_unique(this, Node, AST)) {} + : TreeImpl(llvm::make_unique(this, Node, AST)) {} SyntaxTree(SyntaxTree &&Other) = default; ~SyntaxTree(); diff --git a/include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h b/include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h index fb373fcf502..176dcf7bb8a 100644 --- a/include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h +++ b/include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h @@ -148,7 +148,7 @@ createRefactoringActionRule(const RequirementTypes &... Requirements) { std::tuple Requirements; }; - return std::make_unique(std::make_tuple(Requirements...)); + return llvm::make_unique(std::make_tuple(Requirements...)); } } // end namespace tooling diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp index 27e2d584e9e..568e06f21fb 100644 --- a/lib/ARCMigrate/ARCMT.cpp +++ b/lib/ARCMigrate/ARCMT.cpp @@ -453,8 +453,8 @@ class ARCMTMacroTrackerAction : public ASTFrontendAction { std::unique_ptr CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override { CI.getPreprocessor().addPPCallbacks( - std::make_unique(ARCMTMacroLocs)); - return std::make_unique(); + llvm::make_unique(ARCMTMacroLocs)); + return llvm::make_unique(); } }; diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 4abb04fef5b..b0ffdda8b2f 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -208,10 +208,10 @@ ObjCMigrateAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { CI.getPreprocessor().addPPCallbacks(std::unique_ptr(PPRec)); std::vector> Consumers; Consumers.push_back(WrapperFrontendAction::CreateASTConsumer(CI, InFile)); - Consumers.push_back(std::make_unique( + Consumers.push_back(llvm::make_unique( MigrateDir, ObjCMigAction, Remapper, CompInst->getFileManager(), PPRec, CompInst->getPreprocessor(), false, None)); - return std::make_unique(std::move(Consumers)); + return llvm::make_unique(std::move(Consumers)); } bool ObjCMigrateAction::BeginInvocation(CompilerInstance &CI) { @@ -2034,7 +2034,7 @@ MigrateSourceAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { CI.getPreprocessor().addPPCallbacks(std::unique_ptr(PPRec)); std::vector WhiteList = getWhiteListFilenames(CI.getFrontendOpts().ObjCMTWhiteListPath); - return std::make_unique( + return llvm::make_unique( CI.getFrontendOpts().OutputFile, ObjCMTAction, Remapper, CI.getFileManager(), PPRec, CI.getPreprocessor(), /*isOutputFile=*/true, WhiteList); diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 6c9d9233faa..ccbad65122e 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -10473,7 +10473,7 @@ ASTContext::getParents(const ast_type_traits::DynTypedNode &Node) { if (!Parents) // We build the parent map for the traversal scope (usually whole TU), as // hasAncestor can escape any subtree. - Parents = std::make_unique(*this); + Parents = llvm::make_unique(*this); return Parents->getParents(Node); } diff --git a/lib/AST/CXXInheritance.cpp b/lib/AST/CXXInheritance.cpp index a3a3794b2ed..ecf451b175a 100644 --- a/lib/AST/CXXInheritance.cpp +++ b/lib/AST/CXXInheritance.cpp @@ -44,7 +44,7 @@ void CXXBasePaths::ComputeDeclsFound() { Decls.insert(Path->Decls.front()); NumDeclsFound = Decls.size(); - DeclsFound = std::make_unique(NumDeclsFound); + DeclsFound = llvm::make_unique(NumDeclsFound); std::copy(Decls.begin(), Decls.end(), DeclsFound.get()); } diff --git a/lib/AST/ExternalASTMerger.cpp b/lib/AST/ExternalASTMerger.cpp index 4dc89f0f31a..61e657da7c9 100644 --- a/lib/AST/ExternalASTMerger.cpp +++ b/lib/AST/ExternalASTMerger.cpp @@ -320,7 +320,7 @@ ExternalASTMerger::ExternalASTMerger(const ImporterTarget &Target, void ExternalASTMerger::AddSources(llvm::ArrayRef Sources) { for (const ImporterSource &S : Sources) { assert(&S.AST != &Target.AST); - Importers.push_back(std::make_unique( + Importers.push_back(llvm::make_unique( *this, Target.AST, Target.FM, S.AST, S.FM, S.OM)); } } diff --git a/lib/AST/ItaniumCXXABI.cpp b/lib/AST/ItaniumCXXABI.cpp index 67f874b7b9f..77fb5a1d33b 100644 --- a/lib/AST/ItaniumCXXABI.cpp +++ b/lib/AST/ItaniumCXXABI.cpp @@ -218,7 +218,7 @@ class ItaniumCXXABI : public CXXABI { std::unique_ptr createMangleNumberingContext() const override { - return std::make_unique(); + return llvm::make_unique(); } }; } diff --git a/lib/AST/Mangle.cpp b/lib/AST/Mangle.cpp index 28de87fde9e..625282368a4 100644 --- a/lib/AST/Mangle.cpp +++ b/lib/AST/Mangle.cpp @@ -470,7 +470,7 @@ class ASTNameGenerator::Implementation { }; ASTNameGenerator::ASTNameGenerator(ASTContext &Ctx) - : Impl(std::make_unique(Ctx)) {} + : Impl(llvm::make_unique(Ctx)) {} ASTNameGenerator::~ASTNameGenerator() {} diff --git a/lib/AST/MicrosoftCXXABI.cpp b/lib/AST/MicrosoftCXXABI.cpp index 074abba3d45..444e55f777f 100644 --- a/lib/AST/MicrosoftCXXABI.cpp +++ b/lib/AST/MicrosoftCXXABI.cpp @@ -132,7 +132,7 @@ class MicrosoftCXXABI : public CXXABI { std::unique_ptr createMangleNumberingContext() const override { - return std::make_unique(); + return llvm::make_unique(); } }; } diff --git a/lib/AST/VTableBuilder.cpp b/lib/AST/VTableBuilder.cpp index 5688042dadd..0c699571555 100644 --- a/lib/AST/VTableBuilder.cpp +++ b/lib/AST/VTableBuilder.cpp @@ -2268,7 +2268,7 @@ CreateVTableLayout(const ItaniumVTableBuilder &Builder) { SmallVector VTableThunks(Builder.vtable_thunks_begin(), Builder.vtable_thunks_end()); - return std::make_unique( + return llvm::make_unique( Builder.VTableIndices, Builder.vtable_components(), VTableThunks, Builder.getAddressPoints()); } @@ -3253,7 +3253,7 @@ void MicrosoftVTableContext::computeVTablePaths(bool ForVBTables, // Base case: this subobject has its own vptr. if (ForVBTables ? Layout.hasOwnVBPtr() : Layout.hasOwnVFPtr()) - Paths.push_back(std::make_unique(RD)); + Paths.push_back(llvm::make_unique(RD)); // Recursive case: get all the vbtables from our bases and remove anything // that shares a virtual base. @@ -3276,7 +3276,7 @@ void MicrosoftVTableContext::computeVTablePaths(bool ForVBTables, continue; // Copy the path and adjust it as necessary. - auto P = std::make_unique(*BaseInfo); + auto P = llvm::make_unique(*BaseInfo); // We mangle Base into the path if the path would've been ambiguous and it // wasn't already extended with Base. @@ -3562,7 +3562,7 @@ void MicrosoftVTableContext::computeVTableRelatedInformation( const VTableLayout::AddressPointsMapTy EmptyAddressPointsMap; { - auto VFPtrs = std::make_unique(); + auto VFPtrs = llvm::make_unique(); computeVTablePaths(/*ForVBTables=*/false, RD, *VFPtrs); computeFullPathsForVFTables(Context, RD, *VFPtrs); VFPtrLocations[RD] = std::move(VFPtrs); @@ -3576,7 +3576,7 @@ void MicrosoftVTableContext::computeVTableRelatedInformation( assert(VFTableLayouts.count(id) == 0); SmallVector VTableThunks( Builder.vtable_thunks_begin(), Builder.vtable_thunks_end()); - VFTableLayouts[id] = std::make_unique( + VFTableLayouts[id] = llvm::make_unique( ArrayRef{0}, Builder.vtable_components(), VTableThunks, EmptyAddressPointsMap); Thunks.insert(Builder.thunks_begin(), Builder.thunks_end()); @@ -3668,7 +3668,7 @@ const VirtualBaseInfo &MicrosoftVTableContext::computeVBTableRelatedInformation( std::unique_ptr &Entry = VBaseInfo[RD]; if (Entry) return *Entry; - Entry = std::make_unique(); + Entry = llvm::make_unique(); VBI = Entry.get(); } diff --git a/lib/ASTMatchers/ASTMatchFinder.cpp b/lib/ASTMatchers/ASTMatchFinder.cpp index c51fd630e64..6eb4a2c4268 100644 --- a/lib/ASTMatchers/ASTMatchFinder.cpp +++ b/lib/ASTMatchers/ASTMatchFinder.cpp @@ -1078,7 +1078,7 @@ bool MatchFinder::addDynamicMatcher(const internal::DynTypedMatcher &NodeMatch, } std::unique_ptr MatchFinder::newASTConsumer() { - return std::make_unique(this, ParsingDone); + return llvm::make_unique(this, ParsingDone); } void MatchFinder::match(const clang::ast_type_traits::DynTypedNode &Node, diff --git a/lib/ASTMatchers/Dynamic/Marshallers.h b/lib/ASTMatchers/Dynamic/Marshallers.h index 9f46108d184..fac2fc98e09 100644 --- a/lib/ASTMatchers/Dynamic/Marshallers.h +++ b/lib/ASTMatchers/Dynamic/Marshallers.h @@ -729,7 +729,7 @@ std::unique_ptr makeMatcherAutoMarshall(ReturnType (*Func)(), StringRef MatcherName) { std::vector RetTypes; BuildReturnTypeVector::build(RetTypes); - return std::make_unique( + return llvm::make_unique( matcherMarshall0, reinterpret_cast(Func), MatcherName, RetTypes, None); } @@ -741,7 +741,7 @@ makeMatcherAutoMarshall(ReturnType (*Func)(ArgType1), StringRef MatcherName) { std::vector RetTypes; BuildReturnTypeVector::build(RetTypes); ArgKind AK = ArgTypeTraits::getKind(); - return std::make_unique( + return llvm::make_unique( matcherMarshall1, reinterpret_cast(Func), MatcherName, RetTypes, AK); } @@ -755,7 +755,7 @@ makeMatcherAutoMarshall(ReturnType (*Func)(ArgType1, ArgType2), BuildReturnTypeVector::build(RetTypes); ArgKind AKs[] = { ArgTypeTraits::getKind(), ArgTypeTraits::getKind() }; - return std::make_unique( + return llvm::make_unique( matcherMarshall2, reinterpret_cast(Func), MatcherName, RetTypes, AKs); } @@ -766,7 +766,7 @@ template makeMatcherAutoMarshall( ast_matchers::internal::VariadicFunction VarFunc, StringRef MatcherName) { - return std::make_unique(VarFunc, MatcherName); + return llvm::make_unique(VarFunc, MatcherName); } /// Overload for VariadicDynCastAllOfMatchers. @@ -778,7 +778,7 @@ std::unique_ptr makeMatcherAutoMarshall( ast_matchers::internal::VariadicDynCastAllOfMatcher VarFunc, StringRef MatcherName) { - return std::make_unique(VarFunc, MatcherName); + return llvm::make_unique(VarFunc, MatcherName); } /// Argument adaptative overload. @@ -791,7 +791,7 @@ std::unique_ptr makeMatcherAutoMarshall( std::vector> Overloads; AdaptativeOverloadCollector(MatcherName, Overloads); - return std::make_unique(Overloads); + return llvm::make_unique(Overloads); } template