diff --git a/docs/ORCv2.rst b/docs/ORCv2.rst index ba4534e6215..edb1695f4e3 100644 --- a/docs/ORCv2.rst +++ b/docs/ORCv2.rst @@ -174,7 +174,7 @@ checking omitted for brevity) as: ExecutionSession ES; RTDyldObjectLinkingLayer ObjLinkingLayer( - ES, []() { return llvm::make_unique(); }); + ES, []() { return std::make_unique(); }); CXXCompileLayer CXXLayer(ES, ObjLinkingLayer); // Create JITDylib "A" and add code to it using the CXX layer. @@ -453,7 +453,7 @@ std::unique_ptr: .. code-block:: c++ - ThreadSafeContext TSCtx(llvm::make_unique()); + ThreadSafeContext TSCtx(std::make_unique()); ThreadSafeModules can be constructed from a pair of a std::unique_ptr and a ThreadSafeContext value. ThreadSafeContext values may be shared between @@ -462,10 +462,10 @@ multiple ThreadSafeModules: .. code-block:: c++ ThreadSafeModule TSM1( - llvm::make_unique("M1", *TSCtx.getContext()), TSCtx); + std::make_unique("M1", *TSCtx.getContext()), TSCtx); ThreadSafeModule TSM2( - llvm::make_unique("M2", *TSCtx.getContext()), TSCtx); + std::make_unique("M2", *TSCtx.getContext()), TSCtx); Before using a ThreadSafeContext, clients should ensure that either the context is only accessible on the current thread, or that the context is locked. In the @@ -476,7 +476,7 @@ or creating any Modules attached to it. E.g. .. code-block:: c++ - ThreadSafeContext TSCtx(llvm::make_unique()); + ThreadSafeContext TSCtx(std::make_unique()); ThreadPool TP(NumThreads); JITStack J; @@ -519,8 +519,8 @@ constructs a new ThreadSafeContext value from a std::unique_ptr: // Maximize concurrency opportunities by loading every module on a // separate context. for (const auto &IRPath : IRPaths) { - auto Ctx = llvm::make_unique(); - auto M = llvm::make_unique("M", *Ctx); + auto Ctx = std::make_unique(); + auto M = std::make_unique("M", *Ctx); CompileLayer.add(ES.getMainJITDylib(), ThreadSafeModule(std::move(M), std::move(Ctx))); } @@ -531,7 +531,7 @@ all modules on the same context: .. code-block:: c++ // Save memory by using one context for all Modules: - ThreadSafeContext TSCtx(llvm::make_unique()); + ThreadSafeContext TSCtx(std::make_unique()); for (const auto &IRPath : IRPaths) { ThreadSafeModule TSM(parsePath(IRPath, *TSCtx.getContext()), TSCtx); CompileLayer.add(ES.getMainJITDylib(), ThreadSafeModule(std::move(TSM)); diff --git a/docs/tutorial/BuildingAJIT1.rst b/docs/tutorial/BuildingAJIT1.rst index fcb755bd286..00ad94aa08a 100644 --- a/docs/tutorial/BuildingAJIT1.rst +++ b/docs/tutorial/BuildingAJIT1.rst @@ -138,10 +138,10 @@ usual include guards and #includes [2]_, we get to the definition of our class: public: KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL) : ObjectLayer(ES, - []() { return llvm::make_unique(); }), + []() { return std::make_unique(); }), CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))), DL(std::move(DL)), Mangle(ES, this->DL), - Ctx(llvm::make_unique()) { + Ctx(std::make_unique()) { ES.getMainJITDylib().setGenerator( cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL))); } @@ -195,7 +195,7 @@ REPL process as well. We do this by attaching a if (!DL) return DL.takeError(); - return llvm::make_unique(std::move(*JTMB), std::move(*DL)); + return std::make_unique(std::move(*JTMB), std::move(*DL)); } const DataLayout &getDataLayout() const { return DL; } diff --git a/docs/tutorial/BuildingAJIT2.rst b/docs/tutorial/BuildingAJIT2.rst index 7d25ccaba0a..1f818d94566 100644 --- a/docs/tutorial/BuildingAJIT2.rst +++ b/docs/tutorial/BuildingAJIT2.rst @@ -71,11 +71,11 @@ apply to each Module that is added via addModule: KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL) : ObjectLayer(ES, - []() { return llvm::make_unique(); }), + []() { return std::make_unique(); }), CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))), TransformLayer(ES, CompileLayer, optimizeModule), DL(std::move(DL)), Mangle(ES, this->DL), - Ctx(llvm::make_unique()) { + Ctx(std::make_unique()) { ES.getMainJITDylib().setGenerator( cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL))); } @@ -102,7 +102,7 @@ Next we need to update our addModule method to replace the call to static Expected optimizeModule(ThreadSafeModule M, const MaterializationResponsibility &R) { // Create a function pass manager. - auto FPM = llvm::make_unique(M.get()); + auto FPM = std::make_unique(M.get()); // Add some optimizations. FPM->add(createInstructionCombiningPass()); @@ -213,7 +213,7 @@ class: .. code-block:: c++ Error IRLayer::add(JITDylib &JD, ThreadSafeModule TSM, VModuleKey K) { - return JD.define(llvm::make_unique( + return JD.define(std::make_unique( *this, std::move(K), std::move(TSM))); } diff --git a/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst b/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst index 3a2680099df..dec9f36ed56 100644 --- a/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst +++ b/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst @@ -155,8 +155,8 @@ be generated with calls like this: .. code-block:: c++ - auto LHS = llvm::make_unique("x"); - auto RHS = llvm::make_unique("y"); + auto LHS = std::make_unique("x"); + auto RHS = std::make_unique("y"); auto Result = std::make_unique('+', std::move(LHS), std::move(RHS)); @@ -210,7 +210,7 @@ which parses that production. For numeric literals, we have: /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -276,7 +276,7 @@ function calls: getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -300,7 +300,7 @@ function calls: // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } This routine follows the same style as the other routines. (It expects @@ -503,7 +503,7 @@ then continue parsing: } // Merge LHS/RHS. - LHS = llvm::make_unique(BinOp, std::move(LHS), + LHS = std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } // loop around to the top of the while loop. } @@ -533,7 +533,7 @@ above two blocks duplicated for context): return nullptr; } // Merge LHS/RHS. - LHS = llvm::make_unique(BinOp, std::move(LHS), + LHS = std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } // loop around to the top of the while loop. } @@ -593,7 +593,7 @@ expressions): // success. getNextToken(); // eat ')'. - return llvm::make_unique(FnName, std::move(ArgNames)); + return std::make_unique(FnName, std::move(ArgNames)); } Given this, a function definition is very simple, just a prototype plus @@ -608,7 +608,7 @@ an expression to implement the body: if (!Proto) return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -634,8 +634,8 @@ nullary (zero argument) functions for them: static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + auto Proto = std::make_unique("", std::vector()); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } diff --git a/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst b/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst index 773ce55eca0..f5a46a68fcf 100644 --- a/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst +++ b/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst @@ -141,10 +141,10 @@ for us: void InitializeModuleAndPassManager(void) { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); // Create a new pass manager attached to it. - TheFPM = llvm::make_unique(TheModule.get()); + TheFPM = std::make_unique(TheModule.get()); // Do simple "peephole" optimizations and bit-twiddling optzns. TheFPM->add(createInstructionCombiningPass()); @@ -259,7 +259,7 @@ adding a global variable ``TheJIT``, and initializing it in fprintf(stderr, "ready> "); getNextToken(); - TheJIT = llvm::make_unique(); + TheJIT = std::make_unique(); // Run the main "interpreter loop" now. MainLoop(); @@ -273,11 +273,11 @@ We also need to setup the data layout for the JIT: void InitializeModuleAndPassManager(void) { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); // Create a new pass manager attached to it. - TheFPM = llvm::make_unique(TheModule.get()); + TheFPM = std::make_unique(TheModule.get()); ... The KaleidoscopeJIT class is a simple JIT built specifically for these diff --git a/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst b/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst index 685e5fb69e4..0e61c07659d 100644 --- a/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst +++ b/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst @@ -146,7 +146,7 @@ First we define a new parsing function: if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -560,7 +560,7 @@ value to null in the AST node: if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } diff --git a/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst b/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst index 911a7dc92bc..a05ed0b1a3b 100644 --- a/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst +++ b/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst @@ -220,7 +220,7 @@ user-defined operator, we need to parse it: if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, std::move(ArgNames), Kind != 0, + return std::make_unique(FnName, std::move(ArgNames), Kind != 0, BinaryPrecedence); } @@ -348,7 +348,7 @@ simple: we'll add a new function to do it: int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } diff --git a/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst b/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst index 8013dec326a..218e4419135 100644 --- a/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst +++ b/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst @@ -780,7 +780,7 @@ AST node: if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), + return std::make_unique(std::move(VarNames), std::move(Body)); } diff --git a/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst b/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst index 1dcc0a8aa90..87584cdb394 100644 --- a/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst +++ b/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst @@ -77,8 +77,8 @@ statement be our "main": .. code-block:: udiff - - auto Proto = llvm::make_unique("", std::vector()); - + auto Proto = llvm::make_unique("main", std::vector()); + - auto Proto = std::make_unique("", std::vector()); + + auto Proto = std::make_unique("main", std::vector()); just with the simple change of giving it a name. @@ -325,7 +325,7 @@ that we pass down through when we create a new expression: .. code-block:: c++ - LHS = llvm::make_unique(BinLoc, BinOp, std::move(LHS), + LHS = std::make_unique(BinLoc, BinOp, std::move(LHS), std::move(RHS)); giving us locations for each of our expressions and variables. diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index 91c8617f26d..0ecb527f4ec 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -1904,7 +1904,7 @@ int main(int argc, char *argv[]) { // Make the module, which holds all the code. std::unique_ptr Owner = - llvm::make_unique("my cool jit", Context); + std::make_unique("my cool jit", Context); llvm::Module *module = Owner.get(); std::unique_ptr MemMgr(new llvm::SectionMemoryManager()); diff --git a/examples/HowToUseJIT/HowToUseJIT.cpp b/examples/HowToUseJIT/HowToUseJIT.cpp index 30354d4cae6..c7b3b9a7457 100644 --- a/examples/HowToUseJIT/HowToUseJIT.cpp +++ b/examples/HowToUseJIT/HowToUseJIT.cpp @@ -63,7 +63,7 @@ int main() { LLVMContext Context; // Create some module to put our function into it. - std::unique_ptr Owner = make_unique("test", Context); + std::unique_ptr Owner = std::make_unique("test", Context); Module *M = Owner.get(); // Create the add1 function entry and insert this entry into module M. The diff --git a/examples/HowToUseLLJIT/HowToUseLLJIT.cpp b/examples/HowToUseLLJIT/HowToUseLLJIT.cpp index 0b77ff08de0..4383b5a1eeb 100644 --- a/examples/HowToUseLLJIT/HowToUseLLJIT.cpp +++ b/examples/HowToUseLLJIT/HowToUseLLJIT.cpp @@ -20,8 +20,8 @@ using namespace llvm::orc; ExitOnError ExitOnErr; ThreadSafeModule createDemoModule() { - auto Context = llvm::make_unique(); - auto M = make_unique("test", *Context); + auto Context = std::make_unique(); + auto M = std::make_unique("test", *Context); // Create the add1 function entry and insert this entry into module M. The // function will have a return type of "int" and take an argument of "int". diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h index 8b79f2eefd9..a7fa3afc470 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h @@ -42,10 +42,10 @@ private: public: KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL) : ObjectLayer(ES, - []() { return llvm::make_unique(); }), + []() { return std::make_unique(); }), CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))), DL(std::move(DL)), Mangle(ES, this->DL), - Ctx(llvm::make_unique()) { + Ctx(std::make_unique()) { ES.getMainJITDylib().addGenerator( cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess( DL.getGlobalPrefix()))); @@ -61,7 +61,7 @@ public: if (!DL) return DL.takeError(); - return llvm::make_unique(std::move(*JTMB), std::move(*DL)); + return std::make_unique(std::move(*JTMB), std::move(*DL)); } const DataLayout &getDataLayout() const { return DL; } diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp index 8cbd5d6f2f7..b4605bae4ed 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp @@ -329,7 +329,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -356,7 +356,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -380,7 +380,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -409,7 +409,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -455,7 +455,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -504,7 +504,7 @@ static std::unique_ptr ParseVarExpr() { if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), std::move(Body)); + return std::make_unique(std::move(VarNames), std::move(Body)); } /// primary @@ -545,7 +545,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -582,7 +582,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -659,7 +659,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, ArgNames, Kind != 0, + return std::make_unique(FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -671,7 +671,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -679,9 +679,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr(unsigned ExprCount) { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique + auto Proto = std::make_unique (("__anon_expr" + Twine(ExprCount)).str(), std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -1103,11 +1103,11 @@ Function *FunctionAST::codegen() { static void InitializeModule() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", *TheContext); + TheModule = std::make_unique("my cool jit", *TheContext); TheModule->setDataLayout(TheJIT->getDataLayout()); // Create a new builder for the module. - Builder = llvm::make_unique>(*TheContext); + Builder = std::make_unique>(*TheContext); } static void HandleDefinition() { diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h index bf89d3b7597..e9999efd37a 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h @@ -48,11 +48,11 @@ private: public: KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL) : ObjectLayer(ES, - []() { return llvm::make_unique(); }), + []() { return std::make_unique(); }), CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))), OptimizeLayer(ES, CompileLayer, optimizeModule), DL(std::move(DL)), Mangle(ES, this->DL), - Ctx(llvm::make_unique()) { + Ctx(std::make_unique()) { ES.getMainJITDylib().addGenerator( cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess( DL.getGlobalPrefix()))); @@ -72,7 +72,7 @@ public: if (!DL) return DL.takeError(); - return llvm::make_unique(std::move(*JTMB), std::move(*DL)); + return std::make_unique(std::move(*JTMB), std::move(*DL)); } Error addModule(std::unique_ptr M) { @@ -89,7 +89,7 @@ private: optimizeModule(ThreadSafeModule TSM, const MaterializationResponsibility &R) { TSM.withModuleDo([](Module &M) { // Create a function pass manager. - auto FPM = llvm::make_unique(&M); + auto FPM = std::make_unique(&M); // Add some optimizations. FPM->add(createInstructionCombiningPass()); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp index e7c3624aa04..743d50829dc 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp @@ -329,7 +329,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -356,7 +356,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -380,7 +380,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -409,7 +409,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -455,7 +455,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -504,7 +504,7 @@ static std::unique_ptr ParseVarExpr() { if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), std::move(Body)); + return std::make_unique(std::move(VarNames), std::move(Body)); } /// primary @@ -545,7 +545,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -582,7 +582,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -659,7 +659,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, ArgNames, Kind != 0, + return std::make_unique(FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -671,7 +671,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -679,9 +679,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr(unsigned ExprCount) { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique( + auto Proto = std::make_unique( ("__anon_expr" + Twine(ExprCount)).str(), std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -1103,11 +1103,11 @@ Function *FunctionAST::codegen() { static void InitializeModule() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", *TheContext); + TheModule = std::make_unique("my cool jit", *TheContext); TheModule->setDataLayout(TheJIT->getDataLayout()); // Create a new builder for the module. - Builder = llvm::make_unique>(*TheContext); + Builder = std::make_unique>(*TheContext); } static void HandleDefinition() { diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h index 35104f926d4..add38fdb819 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h @@ -131,7 +131,7 @@ public: private: std::unique_ptr optimizeModule(std::unique_ptr M) { // Create a function pass manager. - auto FPM = llvm::make_unique(M.get()); + auto FPM = std::make_unique(M.get()); // Add some optimizations. FPM->add(createInstructionCombiningPass()); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp index 2471344c6d6..e9505033106 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp @@ -329,7 +329,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -356,7 +356,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -380,7 +380,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -409,7 +409,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -455,7 +455,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -504,7 +504,7 @@ static std::unique_ptr ParseVarExpr() { if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), std::move(Body)); + return std::make_unique(std::move(VarNames), std::move(Body)); } /// primary @@ -545,7 +545,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -582,7 +582,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -659,7 +659,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, ArgNames, Kind != 0, + return std::make_unique(FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -671,7 +671,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -679,9 +679,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -1102,7 +1102,7 @@ Function *FunctionAST::codegen() { static void InitializeModule() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); } @@ -1222,7 +1222,7 @@ int main() { fprintf(stderr, "ready> "); getNextToken(); - TheJIT = llvm::make_unique(); + TheJIT = std::make_unique(); InitializeModule(); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h index ee5225672fc..dd6304b7a78 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h @@ -207,7 +207,7 @@ private: std::unique_ptr optimizeModule(std::unique_ptr M) { // Create a function pass manager. - auto FPM = llvm::make_unique(M.get()); + auto FPM = std::make_unique(M.get()); // Add some optimizations. FPM->add(createInstructionCombiningPass()); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp index ed8ae31ba0f..bfd57e621cd 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp @@ -314,7 +314,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -341,7 +341,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -365,7 +365,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -394,7 +394,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -440,7 +440,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -489,7 +489,7 @@ static std::unique_ptr ParseVarExpr() { if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), std::move(Body)); + return std::make_unique(std::move(VarNames), std::move(Body)); } /// primary @@ -530,7 +530,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -567,7 +567,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -644,7 +644,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, ArgNames, Kind != 0, + return std::make_unique(FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -656,7 +656,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -664,9 +664,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -1095,7 +1095,7 @@ Function *FunctionAST::codegen() { static void InitializeModule() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); } @@ -1114,7 +1114,7 @@ irgenAndTakeOwnership(FunctionAST &FnAST, const std::string &Suffix) { static void HandleDefinition() { if (auto FnAST = ParseDefinition()) { FunctionProtos[FnAST->getProto().getName()] = - llvm::make_unique(FnAST->getProto()); + std::make_unique(FnAST->getProto()); ExitOnErr(TheJIT->addFunctionAST(std::move(FnAST))); } else { // Skip token for error recovery. @@ -1140,7 +1140,7 @@ static void HandleTopLevelExpression() { // Evaluate a top-level expression into an anonymous function. if (auto FnAST = ParseTopLevelExpr()) { FunctionProtos[FnAST->getName()] = - llvm::make_unique(FnAST->getProto()); + std::make_unique(FnAST->getProto()); if (FnAST->codegen()) { // JIT the module containing the anonymous expression, keeping a handle so // we can free it later. @@ -1227,7 +1227,7 @@ int main() { fprintf(stderr, "ready> "); getNextToken(); - TheJIT = llvm::make_unique(); + TheJIT = std::make_unique(); InitializeModule(); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h index 5cc64da68cc..1d9c98a9d72 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h @@ -224,7 +224,7 @@ private: std::unique_ptr optimizeModule(std::unique_ptr M) { // Create a function pass manager. - auto FPM = llvm::make_unique(M.get()); + auto FPM = std::make_unique(M.get()); // Add some optimizations. FPM->add(createInstructionCombiningPass()); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp index 415cc751277..eff61fb954d 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp @@ -331,7 +331,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -358,7 +358,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -382,7 +382,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -411,7 +411,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -457,7 +457,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -506,7 +506,7 @@ static std::unique_ptr ParseVarExpr() { if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), std::move(Body)); + return std::make_unique(std::move(VarNames), std::move(Body)); } /// primary @@ -547,7 +547,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -584,7 +584,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -661,7 +661,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, ArgNames, Kind != 0, + return std::make_unique(FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -673,7 +673,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -684,12 +684,12 @@ static std::unique_ptr ParseTopLevelExpr() { auto PEArgs = std::vector>(); PEArgs.push_back(std::move(E)); auto PrintExpr = - llvm::make_unique("printExprResult", std::move(PEArgs)); + std::make_unique("printExprResult", std::move(PEArgs)); // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), + return std::make_unique(std::move(Proto), std::move(PrintExpr)); } return nullptr; @@ -1119,7 +1119,7 @@ Function *FunctionAST::codegen() { static void InitializeModule() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); } @@ -1138,7 +1138,7 @@ irgenAndTakeOwnership(FunctionAST &FnAST, const std::string &Suffix) { static void HandleDefinition() { if (auto FnAST = ParseDefinition()) { FunctionProtos[FnAST->getProto().getName()] = - llvm::make_unique(FnAST->getProto()); + std::make_unique(FnAST->getProto()); ExitOnErr(TheJIT->addFunctionAST(std::move(FnAST))); } else { // Skip token for error recovery. @@ -1164,7 +1164,7 @@ static void HandleTopLevelExpression() { // Evaluate a top-level expression into an anonymous function. if (auto FnAST = ParseTopLevelExpr()) { FunctionProtos[FnAST->getName()] = - llvm::make_unique(FnAST->getProto()); + std::make_unique(FnAST->getProto()); if (FnAST->codegen()) { // JIT the module containing the anonymous expression, keeping a handle so // we can free it later. @@ -1253,7 +1253,7 @@ std::unique_ptr connect() { exit(1); } - return llvm::make_unique(sockfd, sockfd); + return std::make_unique(sockfd, sockfd); } //===----------------------------------------------------------------------===// @@ -1281,11 +1281,11 @@ int main(int argc, char *argv[]) { ExecutionSession ES; auto TCPChannel = connect(); auto Remote = ExitOnErr(MyRemote::Create(*TCPChannel, ES)); - TheJIT = llvm::make_unique(ES, *Remote); + TheJIT = std::make_unique(ES, *Remote); // Automatically inject a definition for 'printExprResult'. FunctionProtos["printExprResult"] = - llvm::make_unique("printExprResult", + std::make_unique("printExprResult", std::vector({"Val"})); // Prime the first token. diff --git a/examples/Kaleidoscope/Chapter2/toy.cpp b/examples/Kaleidoscope/Chapter2/toy.cpp index 4dc917e3f06..59432fb3de8 100644 --- a/examples/Kaleidoscope/Chapter2/toy.cpp +++ b/examples/Kaleidoscope/Chapter2/toy.cpp @@ -197,7 +197,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -224,7 +224,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -248,7 +248,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// primary @@ -300,7 +300,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, } // Merge LHS/RHS. - LHS = llvm::make_unique(BinOp, std::move(LHS), + LHS = std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -337,7 +337,7 @@ static std::unique_ptr ParsePrototype() { // success. getNextToken(); // eat ')'. - return llvm::make_unique(FnName, std::move(ArgNames)); + return std::make_unique(FnName, std::move(ArgNames)); } /// definition ::= 'def' prototype expression @@ -348,7 +348,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -356,9 +356,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } diff --git a/examples/Kaleidoscope/Chapter3/toy.cpp b/examples/Kaleidoscope/Chapter3/toy.cpp index 8aad3f4d7be..f7b2d988fd1 100644 --- a/examples/Kaleidoscope/Chapter3/toy.cpp +++ b/examples/Kaleidoscope/Chapter3/toy.cpp @@ -223,7 +223,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -250,7 +250,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -274,7 +274,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// primary @@ -327,7 +327,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -363,7 +363,7 @@ static std::unique_ptr ParsePrototype() { // success. getNextToken(); // eat ')'. - return llvm::make_unique(FnName, std::move(ArgNames)); + return std::make_unique(FnName, std::move(ArgNames)); } /// definition ::= 'def' prototype expression @@ -374,7 +374,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -382,9 +382,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -598,7 +598,7 @@ int main() { getNextToken(); // Make the module, which holds all the code. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); // Run the main "interpreter loop" now. MainLoop(); diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp index f8000c41a6f..3c17a018853 100644 --- a/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/examples/Kaleidoscope/Chapter4/toy.cpp @@ -233,7 +233,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -260,7 +260,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -284,7 +284,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// primary @@ -337,7 +337,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -373,7 +373,7 @@ static std::unique_ptr ParsePrototype() { // success. getNextToken(); // eat ')'. - return llvm::make_unique(FnName, std::move(ArgNames)); + return std::make_unique(FnName, std::move(ArgNames)); } /// definition ::= 'def' prototype expression @@ -384,7 +384,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -392,9 +392,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -550,11 +550,11 @@ Function *FunctionAST::codegen() { static void InitializeModuleAndPassManager() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); // Create a new pass manager attached to it. - TheFPM = llvm::make_unique(TheModule.get()); + TheFPM = std::make_unique(TheModule.get()); // Do simple "peephole" optimizations and bit-twiddling optzns. TheFPM->add(createInstructionCombiningPass()); @@ -689,7 +689,7 @@ int main() { fprintf(stderr, "ready> "); getNextToken(); - TheJIT = llvm::make_unique(); + TheJIT = std::make_unique(); InitializeModuleAndPassManager(); diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp index 534c8e529e4..3eeb1c14a36 100644 --- a/examples/Kaleidoscope/Chapter5/toy.cpp +++ b/examples/Kaleidoscope/Chapter5/toy.cpp @@ -278,7 +278,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -305,7 +305,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -329,7 +329,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -358,7 +358,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -404,7 +404,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -464,7 +464,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -500,7 +500,7 @@ static std::unique_ptr ParsePrototype() { // success. getNextToken(); // eat ')'. - return llvm::make_unique(FnName, std::move(ArgNames)); + return std::make_unique(FnName, std::move(ArgNames)); } /// definition ::= 'def' prototype expression @@ -511,7 +511,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -519,9 +519,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -824,11 +824,11 @@ Function *FunctionAST::codegen() { static void InitializeModuleAndPassManager() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); // Create a new pass manager attached to it. - TheFPM = llvm::make_unique(TheModule.get()); + TheFPM = std::make_unique(TheModule.get()); // Do simple "peephole" optimizations and bit-twiddling optzns. TheFPM->add(createInstructionCombiningPass()); @@ -963,7 +963,7 @@ int main() { fprintf(stderr, "ready> "); getNextToken(); - TheJIT = llvm::make_unique(); + TheJIT = std::make_unique(); InitializeModuleAndPassManager(); diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp index 4b58117bd4a..5b3dd5a6c4e 100644 --- a/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/examples/Kaleidoscope/Chapter6/toy.cpp @@ -312,7 +312,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -339,7 +339,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -363,7 +363,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -392,7 +392,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -438,7 +438,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -477,7 +477,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -514,7 +514,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -591,7 +591,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, ArgNames, Kind != 0, + return std::make_unique(FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -603,7 +603,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -611,9 +611,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -943,11 +943,11 @@ Function *FunctionAST::codegen() { static void InitializeModuleAndPassManager() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); // Create a new pass manager attached to it. - TheFPM = llvm::make_unique(TheModule.get()); + TheFPM = std::make_unique(TheModule.get()); // Do simple "peephole" optimizations and bit-twiddling optzns. TheFPM->add(createInstructionCombiningPass()); @@ -1082,7 +1082,7 @@ int main() { fprintf(stderr, "ready> "); getNextToken(); - TheJIT = llvm::make_unique(); + TheJIT = std::make_unique(); InitializeModuleAndPassManager(); diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp index 41c27d06d47..c42431a8ba1 100644 --- a/examples/Kaleidoscope/Chapter7/toy.cpp +++ b/examples/Kaleidoscope/Chapter7/toy.cpp @@ -334,7 +334,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -361,7 +361,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -385,7 +385,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -414,7 +414,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -460,7 +460,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -509,7 +509,7 @@ static std::unique_ptr ParseVarExpr() { if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), std::move(Body)); + return std::make_unique(std::move(VarNames), std::move(Body)); } /// primary @@ -550,7 +550,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -587,7 +587,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -664,7 +664,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, ArgNames, Kind != 0, + return std::make_unique(FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -676,7 +676,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -684,9 +684,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -1111,11 +1111,11 @@ Function *FunctionAST::codegen() { static void InitializeModuleAndPassManager() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); // Create a new pass manager attached to it. - TheFPM = llvm::make_unique(TheModule.get()); + TheFPM = std::make_unique(TheModule.get()); // Promote allocas to registers. TheFPM->add(createPromoteMemoryToRegisterPass()); @@ -1253,7 +1253,7 @@ int main() { fprintf(stderr, "ready> "); getNextToken(); - TheJIT = llvm::make_unique(); + TheJIT = std::make_unique(); InitializeModuleAndPassManager(); diff --git a/examples/Kaleidoscope/Chapter8/toy.cpp b/examples/Kaleidoscope/Chapter8/toy.cpp index c5628cf2154..8c46e446658 100644 --- a/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/examples/Kaleidoscope/Chapter8/toy.cpp @@ -335,7 +335,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -362,7 +362,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(IdName); + return std::make_unique(IdName); // Call. getNextToken(); // eat ( @@ -386,7 +386,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(IdName, std::move(Args)); + return std::make_unique(IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -415,7 +415,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(std::move(Cond), std::move(Then), + return std::make_unique(std::move(Cond), std::move(Then), std::move(Else)); } @@ -461,7 +461,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -510,7 +510,7 @@ static std::unique_ptr ParseVarExpr() { if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), std::move(Body)); + return std::make_unique(std::move(VarNames), std::move(Body)); } /// primary @@ -551,7 +551,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -588,7 +588,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, // Merge LHS/RHS. LHS = - llvm::make_unique(BinOp, std::move(LHS), std::move(RHS)); + std::make_unique(BinOp, std::move(LHS), std::move(RHS)); } } @@ -665,7 +665,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnName, ArgNames, Kind != 0, + return std::make_unique(FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -677,7 +677,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -685,9 +685,9 @@ static std::unique_ptr ParseDefinition() { static std::unique_ptr ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique("__anon_expr", + auto Proto = std::make_unique("__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -1107,7 +1107,7 @@ Function *FunctionAST::codegen() { static void InitializeModuleAndPassManager() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); } static void HandleDefinition() { diff --git a/examples/Kaleidoscope/Chapter9/toy.cpp b/examples/Kaleidoscope/Chapter9/toy.cpp index 19bac1a8bc7..21c8993e1a0 100644 --- a/examples/Kaleidoscope/Chapter9/toy.cpp +++ b/examples/Kaleidoscope/Chapter9/toy.cpp @@ -442,7 +442,7 @@ static std::unique_ptr ParseExpression(); /// numberexpr ::= number static std::unique_ptr ParseNumberExpr() { - auto Result = llvm::make_unique(NumVal); + auto Result = std::make_unique(NumVal); getNextToken(); // consume the number return std::move(Result); } @@ -471,7 +471,7 @@ static std::unique_ptr ParseIdentifierExpr() { getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. - return llvm::make_unique(LitLoc, IdName); + return std::make_unique(LitLoc, IdName); // Call. getNextToken(); // eat ( @@ -495,7 +495,7 @@ static std::unique_ptr ParseIdentifierExpr() { // Eat the ')'. getNextToken(); - return llvm::make_unique(LitLoc, IdName, std::move(Args)); + return std::make_unique(LitLoc, IdName, std::move(Args)); } /// ifexpr ::= 'if' expression 'then' expression 'else' expression @@ -526,7 +526,7 @@ static std::unique_ptr ParseIfExpr() { if (!Else) return nullptr; - return llvm::make_unique(IfLoc, std::move(Cond), std::move(Then), + return std::make_unique(IfLoc, std::move(Cond), std::move(Then), std::move(Else)); } @@ -572,7 +572,7 @@ static std::unique_ptr ParseForExpr() { if (!Body) return nullptr; - return llvm::make_unique(IdName, std::move(Start), std::move(End), + return std::make_unique(IdName, std::move(Start), std::move(End), std::move(Step), std::move(Body)); } @@ -621,7 +621,7 @@ static std::unique_ptr ParseVarExpr() { if (!Body) return nullptr; - return llvm::make_unique(std::move(VarNames), std::move(Body)); + return std::make_unique(std::move(VarNames), std::move(Body)); } /// primary @@ -662,7 +662,7 @@ static std::unique_ptr ParseUnary() { int Opc = CurTok; getNextToken(); if (auto Operand = ParseUnary()) - return llvm::make_unique(Opc, std::move(Operand)); + return std::make_unique(Opc, std::move(Operand)); return nullptr; } @@ -699,7 +699,7 @@ static std::unique_ptr ParseBinOpRHS(int ExprPrec, } // Merge LHS/RHS. - LHS = llvm::make_unique(BinLoc, BinOp, std::move(LHS), + LHS = std::make_unique(BinLoc, BinOp, std::move(LHS), std::move(RHS)); } } @@ -779,7 +779,7 @@ static std::unique_ptr ParsePrototype() { if (Kind && ArgNames.size() != Kind) return LogErrorP("Invalid number of operands for operator"); - return llvm::make_unique(FnLoc, FnName, ArgNames, Kind != 0, + return std::make_unique(FnLoc, FnName, ArgNames, Kind != 0, BinaryPrecedence); } @@ -791,7 +791,7 @@ static std::unique_ptr ParseDefinition() { return nullptr; if (auto E = ParseExpression()) - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); return nullptr; } @@ -800,9 +800,9 @@ static std::unique_ptr ParseTopLevelExpr() { SourceLocation FnLoc = CurLoc; if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique(FnLoc, "__anon_expr", + auto Proto = std::make_unique(FnLoc, "__anon_expr", std::vector()); - return llvm::make_unique(std::move(Proto), std::move(E)); + return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; } @@ -1314,7 +1314,7 @@ Function *FunctionAST::codegen() { static void InitializeModule() { // Open a new module. - TheModule = llvm::make_unique("my cool jit", TheContext); + TheModule = std::make_unique("my cool jit", TheContext); TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout()); } @@ -1416,7 +1416,7 @@ int main() { // Prime the first token. getNextToken(); - TheJIT = llvm::make_unique(); + TheJIT = std::make_unique(); InitializeModule(); @@ -1429,7 +1429,7 @@ int main() { TheModule->addModuleFlag(llvm::Module::Warning, "Dwarf Version", 2); // Construct the DIBuilder, we do this here because we need the module. - DBuilder = llvm::make_unique(*TheModule); + DBuilder = std::make_unique(*TheModule); // Create the compile unit for the module. // Currently down as "fib.ks" as a filename since we're redirecting stdin diff --git a/examples/LLJITExamples/ExampleModules.h b/examples/LLJITExamples/ExampleModules.h index aa6b2b9d2ea..ae0089fd9dd 100644 --- a/examples/LLJITExamples/ExampleModules.h +++ b/examples/LLJITExamples/ExampleModules.h @@ -35,7 +35,7 @@ parseExampleModule(llvm::StringRef Source, llvm::StringRef Name) { using namespace llvm; using namespace llvm::orc; - auto Ctx = llvm::make_unique(); + auto Ctx = std::make_unique(); SMDiagnostic Err; auto M = parseIR(MemoryBufferRef(Source, Name), Err, *Ctx); diff --git a/examples/ParallelJIT/ParallelJIT.cpp b/examples/ParallelJIT/ParallelJIT.cpp index 9c148a08017..64784622076 100644 --- a/examples/ParallelJIT/ParallelJIT.cpp +++ b/examples/ParallelJIT/ParallelJIT.cpp @@ -259,7 +259,7 @@ int main() { LLVMContext Context; // Create some module to put our function into it. - std::unique_ptr Owner = make_unique("test", Context); + std::unique_ptr Owner = std::make_unique("test", Context); Module *M = Owner.get(); Function* add1F = createAdd1( M ); diff --git a/examples/SpeculativeJIT/SpeculativeJIT.cpp b/examples/SpeculativeJIT/SpeculativeJIT.cpp index 219018001de..803badb59d9 100644 --- a/examples/SpeculativeJIT/SpeculativeJIT.cpp +++ b/examples/SpeculativeJIT/SpeculativeJIT.cpp @@ -48,7 +48,7 @@ public: if (!DL) return DL.takeError(); - auto ES = llvm::make_unique(); + auto ES = std::make_unique(); auto LCTMgr = createLocalLazyCallThroughManager( JTMB->getTargetTriple(), *ES, @@ -128,7 +128,7 @@ private: } static std::unique_ptr createMemMgr() { - return llvm::make_unique(); + return std::make_unique(); } std::unique_ptr ES; @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) { // Load the IR inputs. for (const auto &InputFile : InputFiles) { SMDiagnostic Err; - auto Ctx = llvm::make_unique(); + auto Ctx = std::make_unique(); auto M = parseIRFile(InputFile, Err, *Ctx); if (!M) { Err.print(argv[0], errs()); diff --git a/include/llvm/ADT/Any.h b/include/llvm/ADT/Any.h index 5dcd6e73c54..49657e02a99 100644 --- a/include/llvm/ADT/Any.h +++ b/include/llvm/ADT/Any.h @@ -38,7 +38,7 @@ class Any { explicit StorageImpl(T &&Value) : Value(std::move(Value)) {} std::unique_ptr clone() const override { - return llvm::make_unique>(Value); + return std::make_unique>(Value); } const void *id() const override { return &TypeId::Id; } @@ -78,7 +78,7 @@ public: int>::type = 0> Any(T &&Value) { using U = typename std::decay::type; - Storage = llvm::make_unique>(std::forward(Value)); + Storage = std::make_unique>(std::forward(Value)); } Any(Any &&Other) : Storage(std::move(Other.Storage)) {} diff --git a/include/llvm/Analysis/RegionInfoImpl.h b/include/llvm/Analysis/RegionInfoImpl.h index c59c09dd209..6b5936680c3 100644 --- a/include/llvm/Analysis/RegionInfoImpl.h +++ b/include/llvm/Analysis/RegionInfoImpl.h @@ -365,7 +365,7 @@ typename Tr::RegionNodeT *RegionBase::getBBNode(BlockT *BB) const { auto Deconst = const_cast *>(this); typename BBNodeMapT::value_type V = { BB, - llvm::make_unique(static_cast(Deconst), BB)}; + std::make_unique(static_cast(Deconst), BB)}; at = BBNodeMap.insert(std::move(V)).first; } return at->second.get(); diff --git a/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h b/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h index d546c39447c..f7b804b3a21 100644 --- a/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h +++ b/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h @@ -87,7 +87,7 @@ public: } GISelKnownBits &get(MachineFunction &MF) { if (!Info) - Info = make_unique(MF); + Info = std::make_unique(MF); return *Info.get(); } void getAnalysisUsage(AnalysisUsage &AU) const override; diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 8bb88165d3e..c3b472e6555 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -224,7 +224,7 @@ namespace llvm { /// Constructs a new LiveRange object. LiveRange(bool UseSegmentSet = false) - : segmentSet(UseSegmentSet ? llvm::make_unique() + : segmentSet(UseSegmentSet ? std::make_unique() : nullptr) {} /// Constructs a new LiveRange object by copying segments and valnos from diff --git a/include/llvm/CodeGen/MachinePipeliner.h b/include/llvm/CodeGen/MachinePipeliner.h index 03ca5307268..2655bb059ff 100644 --- a/include/llvm/CodeGen/MachinePipeliner.h +++ b/include/llvm/CodeGen/MachinePipeliner.h @@ -200,7 +200,7 @@ public: RegClassInfo(rci), II_setByPragma(II), Topo(SUnits, &ExitSU) { P.MF->getSubtarget().getSMSMutations(Mutations); if (SwpEnableCopyToPhi) - Mutations.push_back(llvm::make_unique()); + Mutations.push_back(std::make_unique()); } void schedule() override; diff --git a/include/llvm/CodeGen/PBQP/Math.h b/include/llvm/CodeGen/PBQP/Math.h index 8b014ccbb07..099ba788e9a 100644 --- a/include/llvm/CodeGen/PBQP/Math.h +++ b/include/llvm/CodeGen/PBQP/Math.h @@ -28,17 +28,17 @@ class Vector { public: /// Construct a PBQP vector of the given size. explicit Vector(unsigned Length) - : Length(Length), Data(llvm::make_unique(Length)) {} + : Length(Length), Data(std::make_unique(Length)) {} /// Construct a PBQP vector with initializer. Vector(unsigned Length, PBQPNum InitVal) - : Length(Length), Data(llvm::make_unique(Length)) { + : Length(Length), Data(std::make_unique(Length)) { std::fill(Data.get(), Data.get() + Length, InitVal); } /// Copy construct a PBQP vector. Vector(const Vector &V) - : Length(V.Length), Data(llvm::make_unique(Length)) { + : Length(V.Length), Data(std::make_unique(Length)) { std::copy(V.Data.get(), V.Data.get() + Length, Data.get()); } @@ -125,21 +125,21 @@ private: public: /// Construct a PBQP Matrix with the given dimensions. Matrix(unsigned Rows, unsigned Cols) : - Rows(Rows), Cols(Cols), Data(llvm::make_unique(Rows * Cols)) { + Rows(Rows), Cols(Cols), Data(std::make_unique(Rows * Cols)) { } /// Construct a PBQP Matrix with the given dimensions and initial /// value. Matrix(unsigned Rows, unsigned Cols, PBQPNum InitVal) : Rows(Rows), Cols(Cols), - Data(llvm::make_unique(Rows * Cols)) { + Data(std::make_unique(Rows * Cols)) { std::fill(Data.get(), Data.get() + (Rows * Cols), InitVal); } /// Copy construct a PBQP matrix. Matrix(const Matrix &M) : Rows(M.Rows), Cols(M.Cols), - Data(llvm::make_unique(Rows * Cols)) { + Data(std::make_unique(Rows * Cols)) { std::copy(M.Data.get(), M.Data.get() + (Rows * Cols), Data.get()); } diff --git a/include/llvm/CodeGen/TargetPassConfig.h b/include/llvm/CodeGen/TargetPassConfig.h index 0bd82aafac3..d48fc664c1c 100644 --- a/include/llvm/CodeGen/TargetPassConfig.h +++ b/include/llvm/CodeGen/TargetPassConfig.h @@ -280,7 +280,7 @@ public: /// /// This can also be used to plug a new MachineSchedStrategy into an instance /// of the standard ScheduleDAGMI: - /// return new ScheduleDAGMI(C, make_unique(C), /*RemoveKillFlags=*/false) + /// return new ScheduleDAGMI(C, std::make_unique(C), /*RemoveKillFlags=*/false) /// /// Return NULL to select the default (generic) machine scheduler. virtual ScheduleDAGInstrs * diff --git a/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h b/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h index 62761cb87c8..108abb29149 100644 --- a/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h +++ b/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h @@ -62,7 +62,7 @@ public: Error visitSymbolBegin(CVSymbol &Record) override { assert(!Mapping && "Already in a symbol mapping!"); - Mapping = llvm::make_unique(Record.content(), Container); + Mapping = std::make_unique(Record.content(), Container); return Mapping->Mapping.visitSymbolBegin(Record); } Error visitSymbolEnd(CVSymbol &Record) override { diff --git a/include/llvm/DebugInfo/CodeView/TypeDeserializer.h b/include/llvm/DebugInfo/CodeView/TypeDeserializer.h index 081de32dd02..2b17f5ccb13 100644 --- a/include/llvm/DebugInfo/CodeView/TypeDeserializer.h +++ b/include/llvm/DebugInfo/CodeView/TypeDeserializer.h @@ -66,7 +66,7 @@ public: Error visitTypeBegin(CVType &Record) override { assert(!Mapping && "Already in a type mapping!"); - Mapping = llvm::make_unique(Record.content()); + Mapping = std::make_unique(Record.content()); return Mapping->Mapping.visitTypeBegin(Record); } diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h index c0262b6f743..fbebfe634b6 100644 --- a/include/llvm/DebugInfo/DIContext.h +++ b/include/llvm/DebugInfo/DIContext.h @@ -293,7 +293,7 @@ public: LoadedObjectInfoHelper(Ts &&... Args) : Base(std::forward(Args)...) {} std::unique_ptr clone() const override { - return llvm::make_unique(static_cast(*this)); + return std::make_unique(static_cast(*this)); } }; diff --git a/include/llvm/DebugInfo/PDB/Native/SymbolCache.h b/include/llvm/DebugInfo/PDB/Native/SymbolCache.h index 0b15ab474f7..4adf3b394c2 100644 --- a/include/llvm/DebugInfo/PDB/Native/SymbolCache.h +++ b/include/llvm/DebugInfo/PDB/Native/SymbolCache.h @@ -87,7 +87,7 @@ public: // Initial construction must not access the cache, since it must be done // atomically. - auto Result = llvm::make_unique( + auto Result = std::make_unique( Session, Id, std::forward(ConstructorArgs)...); Result->SymbolId = Id; diff --git a/include/llvm/DebugInfo/PDB/PDBSymbol.h b/include/llvm/DebugInfo/PDB/PDBSymbol.h index d9004a8894d..0d95a246755 100644 --- a/include/llvm/DebugInfo/PDB/PDBSymbol.h +++ b/include/llvm/DebugInfo/PDB/PDBSymbol.h @@ -131,7 +131,7 @@ public: auto BaseIter = RawSymbol->findChildren(T::Tag); if (!BaseIter) return nullptr; - return llvm::make_unique>(std::move(BaseIter)); + return std::make_unique>(std::move(BaseIter)); } std::unique_ptr findAllChildren(PDB_SymType Type) const; std::unique_ptr findAllChildren() const; diff --git a/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h index 18221c3b3f5..7946b5b7b20 100644 --- a/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h +++ b/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h @@ -191,7 +191,7 @@ private: std::unique_ptr> wrapOwnership(ResourcePtrT ResourcePtr) { using RO = ResourceOwnerImpl; - return llvm::make_unique(std::move(ResourcePtr)); + return std::make_unique(std::move(ResourcePtr)); } struct LogicalDylib { @@ -444,7 +444,7 @@ private: return Error::success(); // Create the GlobalValues module. - auto GVsM = llvm::make_unique((SrcM.getName() + ".globals").str(), + auto GVsM = std::make_unique((SrcM.getName() + ".globals").str(), SrcM.getContext()); GVsM->setDataLayout(DL); @@ -637,7 +637,7 @@ private: NewName += F->getName(); } - auto M = llvm::make_unique(NewName, SrcM.getContext()); + auto M = std::make_unique(NewName, SrcM.getContext()); M->setDataLayout(SrcM.getDataLayout()); ValueToValueMapTy VMap; diff --git a/include/llvm/ExecutionEngine/Orc/Core.h b/include/llvm/ExecutionEngine/Orc/Core.h index 1cd2f299c7a..196bd1fffd0 100644 --- a/include/llvm/ExecutionEngine/Orc/Core.h +++ b/include/llvm/ExecutionEngine/Orc/Core.h @@ -346,7 +346,7 @@ private: /// inline std::unique_ptr absoluteSymbols(SymbolMap Symbols, VModuleKey K = VModuleKey()) { - return llvm::make_unique( + return std::make_unique( std::move(Symbols), std::move(K)); } @@ -390,7 +390,7 @@ private: /// \endcode inline std::unique_ptr symbolAliases(SymbolAliasMap Aliases, VModuleKey K = VModuleKey()) { - return llvm::make_unique( + return std::make_unique( nullptr, true, std::move(Aliases), std::move(K)); } @@ -402,7 +402,7 @@ symbolAliases(SymbolAliasMap Aliases, VModuleKey K = VModuleKey()) { inline std::unique_ptr reexports(JITDylib &SourceJD, SymbolAliasMap Aliases, bool MatchNonExported = false, VModuleKey K = VModuleKey()) { - return llvm::make_unique( + return std::make_unique( &SourceJD, MatchNonExported, std::move(Aliases), std::move(K)); } diff --git a/include/llvm/ExecutionEngine/Orc/LambdaResolver.h b/include/llvm/ExecutionEngine/Orc/LambdaResolver.h index 84cbc53b73a..b31914f12a0 100644 --- a/include/llvm/ExecutionEngine/Orc/LambdaResolver.h +++ b/include/llvm/ExecutionEngine/Orc/LambdaResolver.h @@ -63,7 +63,7 @@ std::shared_ptr> createLambdaResolver(DylibLookupFtorT DylibLookupFtor, ExternalLookupFtorT ExternalLookupFtor) { using LR = LambdaResolver; - return make_unique(std::move(DylibLookupFtor), + return std::make_unique(std::move(DylibLookupFtor), std::move(ExternalLookupFtor)); } @@ -73,7 +73,7 @@ createLambdaResolver(ORCv1DeprecationAcknowledgement, DylibLookupFtorT DylibLookupFtor, ExternalLookupFtorT ExternalLookupFtor) { using LR = LambdaResolver; - return make_unique(AcknowledgeORCv1Deprecation, + return std::make_unique(AcknowledgeORCv1Deprecation, std::move(DylibLookupFtor), std::move(ExternalLookupFtor)); } diff --git a/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h b/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h index 16202d89f86..3f6ddba3d79 100644 --- a/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h +++ b/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h @@ -171,7 +171,7 @@ private: bool ExportedSymbolsOnly) const { assert(!MangledSymbols && "Mangled symbols map already exists?"); - auto Symbols = llvm::make_unique>(); + auto Symbols = std::make_unique>(); Mangler Mang; @@ -209,7 +209,7 @@ public: Error addModule(VModuleKey K, std::unique_ptr M) { assert(!ModuleMap.count(K) && "VModuleKey K already in use"); ModuleMap[K] = - llvm::make_unique(std::move(K), std::move(M)); + std::make_unique(std::move(K), std::move(M)); return Error::success(); } diff --git a/include/llvm/ExecutionEngine/Orc/LazyReexports.h b/include/llvm/ExecutionEngine/Orc/LazyReexports.h index 8f3264646a6..311ed59b154 100644 --- a/include/llvm/ExecutionEngine/Orc/LazyReexports.h +++ b/include/llvm/ExecutionEngine/Orc/LazyReexports.h @@ -71,7 +71,7 @@ public: template static std::unique_ptr createNotifyResolvedFunction(NotifyResolvedImpl NotifyResolved) { - return llvm::make_unique>( + return std::make_unique>( std::move(NotifyResolved)); } @@ -186,7 +186,7 @@ lazyReexports(LazyCallThroughManager &LCTManager, IndirectStubsManager &ISManager, JITDylib &SourceJD, SymbolAliasMap CallableAliases, ImplSymbolMap *SrcJDLoc = nullptr, VModuleKey K = VModuleKey()) { - return llvm::make_unique( + return std::make_unique( LCTManager, ISManager, SourceJD, std::move(CallableAliases), SrcJDLoc, std::move(K)); } diff --git a/include/llvm/ExecutionEngine/Orc/Legacy.h b/include/llvm/ExecutionEngine/Orc/Legacy.h index f9cbbf6ff18..148e260c956 100644 --- a/include/llvm/ExecutionEngine/Orc/Legacy.h +++ b/include/llvm/ExecutionEngine/Orc/Legacy.h @@ -84,7 +84,7 @@ createSymbolResolver(GetResponsibilitySetFn &&GetResponsibilitySet, typename std::remove_reference::type>::type, typename std::remove_cv< typename std::remove_reference::type>::type>; - return llvm::make_unique( + return std::make_unique( std::forward(GetResponsibilitySet), std::forward(Lookup)); } diff --git a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h index 8b875b7906e..86e8d5df3ad 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h +++ b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h @@ -493,7 +493,7 @@ public: ExecutionSession &ES, JITTargetAddress ErrorHandlerAddress) : JITCompileCallbackManager( - llvm::make_unique(Client), ES, + std::make_unique(Client), ES, ErrorHandlerAddress) {} }; @@ -553,7 +553,7 @@ public: auto Id = IndirectStubOwnerIds.getNext(); if (auto Err = callB(Id)) return std::move(Err); - return llvm::make_unique(*this, Id); + return std::make_unique(*this, Id); } Expected diff --git a/include/llvm/ExecutionEngine/Orc/RPCUtils.h b/include/llvm/ExecutionEngine/Orc/RPCUtils.h index 1a8b2d14486..be5cea41054 100644 --- a/include/llvm/ExecutionEngine/Orc/RPCUtils.h +++ b/include/llvm/ExecutionEngine/Orc/RPCUtils.h @@ -764,7 +764,7 @@ private: // Create a ResponseHandler from a given user handler. template std::unique_ptr> createResponseHandler(HandlerT H) { - return llvm::make_unique>( + return std::make_unique>( std::move(H)); } diff --git a/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h b/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h index d9535ce5f21..c5106cf09ec 100644 --- a/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h +++ b/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h @@ -216,7 +216,7 @@ private: : K(std::move(K)), Parent(Parent), MemMgr(std::move(MemMgr)), - PFC(llvm::make_unique( + PFC(std::make_unique( std::move(Obj), std::move(Resolver), ProcessAllSections)) { buildInitialSymbolTable(PFC->Obj); @@ -234,7 +234,7 @@ private: JITSymbolResolverAdapter ResolverAdapter(Parent.ES, *PFC->Resolver, nullptr); - PFC->RTDyld = llvm::make_unique(*MemMgr, ResolverAdapter); + PFC->RTDyld = std::make_unique(*MemMgr, ResolverAdapter); PFC->RTDyld->setProcessAllSections(PFC->ProcessAllSections); Finalized = true; @@ -338,7 +338,7 @@ private: std::shared_ptr Resolver, bool ProcessAllSections) { using LOS = ConcreteLinkedObject; - return llvm::make_unique(Parent, std::move(K), std::move(Obj), + return std::make_unique(Parent, std::move(K), std::move(Obj), std::move(MemMgr), std::move(Resolver), ProcessAllSections); } diff --git a/include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h b/include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h index b87cf697a81..9b1e0f0640d 100644 --- a/include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h +++ b/include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h @@ -472,7 +472,7 @@ private: } Expected addObject(std::string ObjBuffer) { - auto Buffer = llvm::make_unique(std::move(ObjBuffer)); + auto Buffer = std::make_unique(std::move(ObjBuffer)); auto Id = HandleIdMgr.getNext(); assert(!BaseLayerHandles.count(Id) && "Id already in use?"); diff --git a/include/llvm/IR/Metadata.h b/include/llvm/IR/Metadata.h index 7ca2540181b..581d7d78a97 100644 --- a/include/llvm/IR/Metadata.h +++ b/include/llvm/IR/Metadata.h @@ -806,7 +806,7 @@ public: /// Ensure that this has RAUW support, and then return it. ReplaceableMetadataImpl *getOrCreateReplaceableUses() { if (!hasReplaceableUses()) - makeReplaceable(llvm::make_unique(getContext())); + makeReplaceable(std::make_unique(getContext())); return getReplaceableUses(); } diff --git a/include/llvm/IR/ModuleSummaryIndex.h b/include/llvm/IR/ModuleSummaryIndex.h index c0de46d280a..be60447abd8 100644 --- a/include/llvm/IR/ModuleSummaryIndex.h +++ b/include/llvm/IR/ModuleSummaryIndex.h @@ -603,7 +603,7 @@ public: if (!TypeTests.empty() || !TypeTestAssumeVCalls.empty() || !TypeCheckedLoadVCalls.empty() || !TypeTestAssumeConstVCalls.empty() || !TypeCheckedLoadConstVCalls.empty()) - TIdInfo = llvm::make_unique(TypeIdInfo{ + TIdInfo = std::make_unique(TypeIdInfo{ std::move(TypeTests), std::move(TypeTestAssumeVCalls), std::move(TypeCheckedLoadVCalls), std::move(TypeTestAssumeConstVCalls), @@ -682,7 +682,7 @@ public: /// were unable to devirtualize a checked call. void addTypeTest(GlobalValue::GUID Guid) { if (!TIdInfo) - TIdInfo = llvm::make_unique(); + TIdInfo = std::make_unique(); TIdInfo->TypeTests.push_back(Guid); } @@ -782,7 +782,7 @@ public: void setVTableFuncs(VTableFuncList Funcs) { assert(!VTableFuncs); - VTableFuncs = llvm::make_unique(std::move(Funcs)); + VTableFuncs = std::make_unique(std::move(Funcs)); } ArrayRef vTableFuncs() const { @@ -1419,7 +1419,7 @@ template <> struct GraphTraits : public GraphTraits { static NodeRef getEntryNode(ModuleSummaryIndex *I) { std::unique_ptr Root = - make_unique(I->calculateCallGraphRoot()); + std::make_unique(I->calculateCallGraphRoot()); GlobalValueSummaryInfo G(I->haveGVs()); G.SummaryList.push_back(std::move(Root)); static auto P = diff --git a/include/llvm/IR/ModuleSummaryIndexYAML.h b/include/llvm/IR/ModuleSummaryIndexYAML.h index 26d9c43fabf..4d4a67c7517 100644 --- a/include/llvm/IR/ModuleSummaryIndexYAML.h +++ b/include/llvm/IR/ModuleSummaryIndexYAML.h @@ -220,7 +220,7 @@ template <> struct CustomMappingTraits { V.emplace(RefGUID, /*IsAnalysis=*/false); Refs.push_back(ValueInfo(/*IsAnalysis=*/false, &*V.find(RefGUID))); } - Elem.SummaryList.push_back(llvm::make_unique( + Elem.SummaryList.push_back(std::make_unique( GlobalValueSummary::GVFlags( static_cast(FSum.Linkage), FSum.NotEligibleToImport, FSum.Live, FSum.IsLocal, FSum.CanAutoHide), diff --git a/include/llvm/IR/PassManagerInternal.h b/include/llvm/IR/PassManagerInternal.h index 58198bf67b1..c602c0b5cc2 100644 --- a/include/llvm/IR/PassManagerInternal.h +++ b/include/llvm/IR/PassManagerInternal.h @@ -289,7 +289,7 @@ struct AnalysisPassModel : AnalysisPassConcept> run(IRUnitT &IR, AnalysisManager &AM, ExtraArgTs... ExtraArgs) override { - return llvm::make_unique( + return std::make_unique( Pass.run(IR, AM, std::forward(ExtraArgs)...)); } diff --git a/include/llvm/LTO/Config.h b/include/llvm/LTO/Config.h index fb107e3fbe0..daa6585b111 100644 --- a/include/llvm/LTO/Config.h +++ b/include/llvm/LTO/Config.h @@ -226,7 +226,7 @@ struct LTOLLVMContext : LLVMContext { setDiscardValueNames(C.ShouldDiscardValueNames); enableDebugTypeODRUniquing(); setDiagnosticHandler( - llvm::make_unique(&DiagHandler), true); + std::make_unique(&DiagHandler), true); } DiagnosticHandlerFunction DiagHandler; }; diff --git a/include/llvm/MCA/HardwareUnits/LSUnit.h b/include/llvm/MCA/HardwareUnits/LSUnit.h index ae9a49c6485..6ca103808aa 100644 --- a/include/llvm/MCA/HardwareUnits/LSUnit.h +++ b/include/llvm/MCA/HardwareUnits/LSUnit.h @@ -285,7 +285,7 @@ public: unsigned createMemoryGroup() { Groups.insert( - std::make_pair(NextGroupID, llvm::make_unique())); + std::make_pair(NextGroupID, std::make_unique())); return NextGroupID++; } diff --git a/include/llvm/MCA/HardwareUnits/Scheduler.h b/include/llvm/MCA/HardwareUnits/Scheduler.h index 36d0bd40488..74c71a73dff 100644 --- a/include/llvm/MCA/HardwareUnits/Scheduler.h +++ b/include/llvm/MCA/HardwareUnits/Scheduler.h @@ -159,7 +159,7 @@ public: Scheduler(const MCSchedModel &Model, LSUnit &Lsu, std::unique_ptr SelectStrategy) - : Scheduler(make_unique(Model), Lsu, + : Scheduler(std::make_unique(Model), Lsu, std::move(SelectStrategy)) {} Scheduler(std::unique_ptr RM, LSUnit &Lsu, diff --git a/include/llvm/ProfileData/InstrProf.h b/include/llvm/ProfileData/InstrProf.h index c7d764ade30..a229020b8da 100644 --- a/include/llvm/ProfileData/InstrProf.h +++ b/include/llvm/ProfileData/InstrProf.h @@ -695,7 +695,7 @@ struct InstrProfRecord { InstrProfRecord(const InstrProfRecord &RHS) : Counts(RHS.Counts), ValueData(RHS.ValueData - ? llvm::make_unique(*RHS.ValueData) + ? std::make_unique(*RHS.ValueData) : nullptr) {} InstrProfRecord &operator=(InstrProfRecord &&) = default; InstrProfRecord &operator=(const InstrProfRecord &RHS) { @@ -705,7 +705,7 @@ struct InstrProfRecord { return *this; } if (!ValueData) - ValueData = llvm::make_unique(*RHS.ValueData); + ValueData = std::make_unique(*RHS.ValueData); else *ValueData = *RHS.ValueData; return *this; @@ -817,7 +817,7 @@ private: std::vector & getOrCreateValueSitesForKind(uint32_t ValueKind) { if (!ValueData) - ValueData = llvm::make_unique(); + ValueData = std::make_unique(); switch (ValueKind) { case IPVK_IndirectCallTarget: return ValueData->IndirectCallSites; @@ -897,7 +897,7 @@ InstrProfRecord::getValueForSite(uint32_t ValueKind, uint32_t Site, return std::unique_ptr(nullptr); } - auto VD = llvm::make_unique(N); + auto VD = std::make_unique(N); TotalCount = getValueForSite(VD.get(), ValueKind, Site); return VD; diff --git a/include/llvm/Support/Error.h b/include/llvm/Support/Error.h index 424906c5d19..c0e4d362364 100644 --- a/include/llvm/Support/Error.h +++ b/include/llvm/Support/Error.h @@ -328,7 +328,7 @@ inline ErrorSuccess Error::success() { return ErrorSuccess(); } /// Make a Error instance representing failure using the given error info /// type. template Error make_error(ArgTs &&... Args) { - return Error(llvm::make_unique(std::forward(Args)...)); + return Error(std::make_unique(std::forward(Args)...)); } /// Base class for user error types. Users should declare their error types diff --git a/include/llvm/Support/GenericDomTree.h b/include/llvm/Support/GenericDomTree.h index 34d8289ab1d..9169379f746 100644 --- a/include/llvm/Support/GenericDomTree.h +++ b/include/llvm/Support/GenericDomTree.h @@ -571,7 +571,7 @@ protected: assert(IDomNode && "Not immediate dominator specified for block!"); DFSInfoValid = false; return (DomTreeNodes[BB] = IDomNode->addChild( - llvm::make_unique>(BB, IDomNode))).get(); + std::make_unique>(BB, IDomNode))).get(); } /// Add a new node to the forward dominator tree and make it a new root. @@ -585,7 +585,7 @@ protected: "Cannot change root of post-dominator tree"); DFSInfoValid = false; DomTreeNodeBase *NewNode = (DomTreeNodes[BB] = - llvm::make_unique>(BB, nullptr)).get(); + std::make_unique>(BB, nullptr)).get(); if (Roots.empty()) { addRoot(BB); } else { diff --git a/include/llvm/Support/GenericDomTreeConstruction.h b/include/llvm/Support/GenericDomTreeConstruction.h index ccceba88171..7c0278e8770 100644 --- a/include/llvm/Support/GenericDomTreeConstruction.h +++ b/include/llvm/Support/GenericDomTreeConstruction.h @@ -186,7 +186,7 @@ struct SemiNCAInfo { // Add a new tree node for this NodeT, and link it as a child of // IDomNode return (DT.DomTreeNodes[BB] = IDomNode->addChild( - llvm::make_unique>(BB, IDomNode))) + std::make_unique>(BB, IDomNode))) .get(); } @@ -586,7 +586,7 @@ struct SemiNCAInfo { NodePtr Root = IsPostDom ? nullptr : DT.Roots[0]; DT.RootNode = (DT.DomTreeNodes[Root] = - llvm::make_unique>(Root, nullptr)) + std::make_unique>(Root, nullptr)) .get(); SNCA.attachNewSubtree(DT, DT.RootNode); } @@ -611,7 +611,7 @@ struct SemiNCAInfo { // Add a new tree node for this BasicBlock, and link it as a child of // IDomNode. DT.DomTreeNodes[W] = IDomNode->addChild( - llvm::make_unique>(W, IDomNode)); + std::make_unique>(W, IDomNode)); } } @@ -663,7 +663,7 @@ struct SemiNCAInfo { TreeNodePtr VirtualRoot = DT.getNode(nullptr); FromTN = (DT.DomTreeNodes[From] = VirtualRoot->addChild( - llvm::make_unique>(From, VirtualRoot))) + std::make_unique>(From, VirtualRoot))) .get(); DT.Roots.push_back(From); } diff --git a/include/llvm/Support/Registry.h b/include/llvm/Support/Registry.h index 4d8aa5f1470..5bb6a254a47 100644 --- a/include/llvm/Support/Registry.h +++ b/include/llvm/Support/Registry.h @@ -115,7 +115,7 @@ namespace llvm { entry Entry; node Node; - static std::unique_ptr CtorFn() { return make_unique(); } + static std::unique_ptr CtorFn() { return std::make_unique(); } public: Add(StringRef Name, StringRef Desc) diff --git a/lib/Analysis/AssumptionCache.cpp b/lib/Analysis/AssumptionCache.cpp index cf2f845dee0..501191102b3 100644 --- a/lib/Analysis/AssumptionCache.cpp +++ b/lib/Analysis/AssumptionCache.cpp @@ -252,7 +252,7 @@ AssumptionCache &AssumptionCacheTracker::getAssumptionCache(Function &F) { // Ok, build a new cache by scanning the function, insert it and the value // handle into our map, and return the newly populated cache. auto IP = AssumptionCaches.insert(std::make_pair( - FunctionCallbackVH(&F, this), llvm::make_unique(F))); + FunctionCallbackVH(&F, this), std::make_unique(F))); assert(IP.second && "Scanning function already in the map?"); return *IP.first->second; } diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp index ec5e94d499b..70aeb1a688e 100644 --- a/lib/Analysis/CallGraph.cpp +++ b/lib/Analysis/CallGraph.cpp @@ -29,7 +29,7 @@ using namespace llvm; CallGraph::CallGraph(Module &M) : M(M), ExternalCallingNode(getOrInsertFunction(nullptr)), - CallsExternalNode(llvm::make_unique(nullptr)) { + CallsExternalNode(std::make_unique(nullptr)) { // Add every function to the call graph. for (Function &F : M) addToCallGraph(&F); @@ -150,7 +150,7 @@ CallGraphNode *CallGraph::getOrInsertFunction(const Function *F) { return CGN.get(); assert((!F || F->getParent() == &M) && "Function not in current module!"); - CGN = llvm::make_unique(const_cast(F)); + CGN = std::make_unique(const_cast(F)); return CGN.get(); } diff --git a/lib/Analysis/DependenceAnalysis.cpp b/lib/Analysis/DependenceAnalysis.cpp index 75f269e84f9..0038c9fb9ce 100644 --- a/lib/Analysis/DependenceAnalysis.cpp +++ b/lib/Analysis/DependenceAnalysis.cpp @@ -254,7 +254,7 @@ FullDependence::FullDependence(Instruction *Source, Instruction *Destination, LoopIndependent(PossiblyLoopIndependent) { Consistent = true; if (CommonLevels) - DV = make_unique(CommonLevels); + DV = std::make_unique(CommonLevels); } // The rest are simple getters that hide the implementation. @@ -3415,7 +3415,7 @@ DependenceInfo::depends(Instruction *Src, Instruction *Dst, if (!isLoadOrStore(Src) || !isLoadOrStore(Dst)) { // can only analyze simple loads and stores, i.e., no calls, invokes, etc. LLVM_DEBUG(dbgs() << "can only handle simple loads and stores\n"); - return make_unique(Src, Dst); + return std::make_unique(Src, Dst); } assert(isLoadOrStore(Src) && "instruction is not load or store"); @@ -3430,7 +3430,7 @@ DependenceInfo::depends(Instruction *Src, Instruction *Dst, case PartialAlias: // cannot analyse objects if we don't understand their aliasing. LLVM_DEBUG(dbgs() << "can't analyze may or partial alias\n"); - return make_unique(Src, Dst); + return std::make_unique(Src, Dst); case NoAlias: // If the objects noalias, they are distinct, accesses are independent. LLVM_DEBUG(dbgs() << "no alias\n"); @@ -3777,7 +3777,7 @@ DependenceInfo::depends(Instruction *Src, Instruction *Dst, return nullptr; } - return make_unique(std::move(Result)); + return std::make_unique(std::move(Result)); } diff --git a/lib/Analysis/IndirectCallPromotionAnalysis.cpp b/lib/Analysis/IndirectCallPromotionAnalysis.cpp index 6ff840efcb6..68153de8219 100644 --- a/lib/Analysis/IndirectCallPromotionAnalysis.cpp +++ b/lib/Analysis/IndirectCallPromotionAnalysis.cpp @@ -53,7 +53,7 @@ static cl::opt "call callsite")); ICallPromotionAnalysis::ICallPromotionAnalysis() { - ValueDataArray = llvm::make_unique(MaxNumPromotions); + ValueDataArray = std::make_unique(MaxNumPromotions); } bool ICallPromotionAnalysis::isPromotionProfitable(uint64_t Count, diff --git a/lib/Analysis/LazyBranchProbabilityInfo.cpp b/lib/Analysis/LazyBranchProbabilityInfo.cpp index f2592c26b37..7fd61b4e0b2 100644 --- a/lib/Analysis/LazyBranchProbabilityInfo.cpp +++ b/lib/Analysis/LazyBranchProbabilityInfo.cpp @@ -56,7 +56,7 @@ void LazyBranchProbabilityInfoPass::releaseMemory() { LBPI.reset(); } bool LazyBranchProbabilityInfoPass::runOnFunction(Function &F) { LoopInfo &LI = getAnalysis().getLoopInfo(); TargetLibraryInfo &TLI = getAnalysis().getTLI(); - LBPI = llvm::make_unique(&F, &LI, &TLI); + LBPI = std::make_unique(&F, &LI, &TLI); return false; } diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp index 542ff709d47..6c6fe8730b6 100644 --- a/lib/Analysis/LazyValueInfo.cpp +++ b/lib/Analysis/LazyValueInfo.cpp @@ -188,7 +188,7 @@ namespace { else { auto It = ValueCache.find_as(Val); if (It == ValueCache.end()) { - ValueCache[Val] = make_unique(Val, this); + ValueCache[Val] = std::make_unique(Val, this); It = ValueCache.find_as(Val); assert(It != ValueCache.end() && "Val was just added to the map!"); } diff --git a/lib/Analysis/LegacyDivergenceAnalysis.cpp b/lib/Analysis/LegacyDivergenceAnalysis.cpp index 2fd8b8d6e1d..7a12f597969 100644 --- a/lib/Analysis/LegacyDivergenceAnalysis.cpp +++ b/lib/Analysis/LegacyDivergenceAnalysis.cpp @@ -336,7 +336,7 @@ bool LegacyDivergenceAnalysis::runOnFunction(Function &F) { if (shouldUseGPUDivergenceAnalysis(F)) { // run the new GPU divergence analysis auto &LI = getAnalysis().getLoopInfo(); - gpuDA = llvm::make_unique(F, DT, PDT, LI, TTI); + gpuDA = std::make_unique(F, DT, PDT, LI, TTI); } else { // run LLVM's existing DivergenceAnalysis diff --git a/lib/Analysis/LoopAccessAnalysis.cpp b/lib/Analysis/LoopAccessAnalysis.cpp index d1a9d107870..6c677a2ce53 100644 --- a/lib/Analysis/LoopAccessAnalysis.cpp +++ b/lib/Analysis/LoopAccessAnalysis.cpp @@ -2099,7 +2099,7 @@ OptimizationRemarkAnalysis &LoopAccessInfo::recordAnalysis(StringRef RemarkName, DL = I->getDebugLoc(); } - Report = make_unique(DEBUG_TYPE, RemarkName, DL, + Report = std::make_unique(DEBUG_TYPE, RemarkName, DL, CodeRegion); return *Report; } @@ -2344,9 +2344,9 @@ void LoopAccessInfo::collectStridedAccess(Value *MemAccess) { LoopAccessInfo::LoopAccessInfo(Loop *L, ScalarEvolution *SE, const TargetLibraryInfo *TLI, AliasAnalysis *AA, DominatorTree *DT, LoopInfo *LI) - : PSE(llvm::make_unique(*SE, *L)), - PtrRtChecking(llvm::make_unique(SE)), - DepChecker(llvm::make_unique(*PSE, L)), TheLoop(L), + : PSE(std::make_unique(*SE, *L)), + PtrRtChecking(std::make_unique(SE)), + DepChecker(std::make_unique(*PSE, L)), TheLoop(L), NumLoads(0), NumStores(0), MaxSafeDepDistBytes(-1), CanVecMem(false), HasConvergentOp(false), HasDependenceInvolvingLoopInvariantAddress(false) { @@ -2401,7 +2401,7 @@ const LoopAccessInfo &LoopAccessLegacyAnalysis::getInfo(Loop *L) { auto &LAI = LoopAccessInfoMap[L]; if (!LAI) - LAI = llvm::make_unique(L, SE, TLI, AA, DT, LI); + LAI = std::make_unique(L, SE, TLI, AA, DT, LI); return *LAI.get(); } diff --git a/lib/Analysis/LoopCacheAnalysis.cpp b/lib/Analysis/LoopCacheAnalysis.cpp index f76f78e0a6e..10d2fe07884 100644 --- a/lib/Analysis/LoopCacheAnalysis.cpp +++ b/lib/Analysis/LoopCacheAnalysis.cpp @@ -484,7 +484,7 @@ CacheCost::getCacheCost(Loop &Root, LoopStandardAnalysisResults &AR, return nullptr; } - return make_unique(Loops, AR.LI, AR.SE, AR.TTI, AR.AA, DI, TRT); + return std::make_unique(Loops, AR.LI, AR.SE, AR.TTI, AR.AA, DI, TRT); } void CacheCost::calculateCacheFootprint() { diff --git a/lib/Analysis/MemorySSA.cpp b/lib/Analysis/MemorySSA.cpp index ed4b6456232..26e3cd70161 100644 --- a/lib/Analysis/MemorySSA.cpp +++ b/lib/Analysis/MemorySSA.cpp @@ -1238,7 +1238,7 @@ MemorySSA::AccessList *MemorySSA::getOrCreateAccessList(const BasicBlock *BB) { auto Res = PerBlockAccesses.insert(std::make_pair(BB, nullptr)); if (Res.second) - Res.first->second = llvm::make_unique(); + Res.first->second = std::make_unique(); return Res.first->second.get(); } @@ -1246,7 +1246,7 @@ MemorySSA::DefsList *MemorySSA::getOrCreateDefsList(const BasicBlock *BB) { auto Res = PerBlockDefs.insert(std::make_pair(BB, nullptr)); if (Res.second) - Res.first->second = llvm::make_unique(); + Res.first->second = std::make_unique(); return Res.first->second.get(); } @@ -1555,10 +1555,10 @@ MemorySSA::CachingWalker *MemorySSA::getWalkerImpl() { if (!WalkerBase) WalkerBase = - llvm::make_unique>(this, AA, DT); + std::make_unique>(this, AA, DT); Walker = - llvm::make_unique>(this, WalkerBase.get()); + std::make_unique>(this, WalkerBase.get()); return Walker.get(); } @@ -1568,10 +1568,10 @@ MemorySSAWalker *MemorySSA::getSkipSelfWalker() { if (!WalkerBase) WalkerBase = - llvm::make_unique>(this, AA, DT); + std::make_unique>(this, AA, DT); SkipWalker = - llvm::make_unique>(this, WalkerBase.get()); + std::make_unique>(this, WalkerBase.get()); return SkipWalker.get(); } @@ -2256,7 +2256,7 @@ MemorySSAAnalysis::Result MemorySSAAnalysis::run(Function &F, FunctionAnalysisManager &AM) { auto &DT = AM.getResult(F); auto &AA = AM.getResult(F); - return MemorySSAAnalysis::Result(llvm::make_unique(F, &AA, &DT)); + return MemorySSAAnalysis::Result(std::make_unique(F, &AA, &DT)); } bool MemorySSAAnalysis::Result::invalidate( diff --git a/lib/Analysis/ModuleSummaryAnalysis.cpp b/lib/Analysis/ModuleSummaryAnalysis.cpp index b10678a2184..29d95d0e989 100644 --- a/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -467,7 +467,7 @@ static void computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M, // FIXME: refactor this to use the same code that inliner is using. // Don't try to import functions with noinline attribute. F.getAttributes().hasFnAttribute(Attribute::NoInline)}; - auto FuncSummary = llvm::make_unique( + auto FuncSummary = std::make_unique( Flags, NumInsts, FunFlags, /*EntryCount=*/0, std::move(Refs), CallGraphEdges.takeVector(), TypeTests.takeVector(), TypeTestAssumeVCalls.takeVector(), TypeCheckedLoadVCalls.takeVector(), @@ -598,7 +598,7 @@ static void computeVariableSummary(ModuleSummaryIndex &Index, !V.hasComdat() && !V.hasAppendingLinkage() && !V.isInterposable() && !V.hasAvailableExternallyLinkage() && !V.hasDLLExportStorageClass(); GlobalVarSummary::GVarFlags VarFlags(CanBeInternalized, CanBeInternalized); - auto GVarSummary = llvm::make_unique(Flags, VarFlags, + auto GVarSummary = std::make_unique(Flags, VarFlags, RefEdges.takeVector()); if (NonRenamableLocal) CantBePromoted.insert(V.getGUID()); @@ -616,7 +616,7 @@ computeAliasSummary(ModuleSummaryIndex &Index, const GlobalAlias &A, GlobalValueSummary::GVFlags Flags(A.getLinkage(), NonRenamableLocal, /* Live = */ false, A.isDSOLocal(), A.hasLinkOnceODRLinkage() && A.hasGlobalUnnamedAddr()); - auto AS = llvm::make_unique(Flags); + auto AS = std::make_unique(Flags); auto *Aliasee = A.getBaseObject(); auto AliaseeVI = Index.getValueInfo(Aliasee->getGUID()); assert(AliaseeVI && "Alias expects aliasee summary to be available"); @@ -696,7 +696,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex( // Create the appropriate summary type. if (Function *F = dyn_cast(GV)) { std::unique_ptr Summary = - llvm::make_unique( + std::make_unique( GVFlags, /*InstCount=*/0, FunctionSummary::FFlags{ F->hasFnAttribute(Attribute::ReadNone), @@ -714,7 +714,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex( Index.addGlobalValueSummary(*GV, std::move(Summary)); } else { std::unique_ptr Summary = - llvm::make_unique( + std::make_unique( GVFlags, GlobalVarSummary::GVarFlags(false, false), ArrayRef{}); Index.addGlobalValueSummary(*GV, std::move(Summary)); @@ -741,7 +741,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex( else if (F.hasProfileData()) { LoopInfo LI{DT}; BranchProbabilityInfo BPI{F, LI}; - BFIPtr = llvm::make_unique(F, BPI, LI); + BFIPtr = std::make_unique(F, BPI, LI); BFI = BFIPtr.get(); } diff --git a/lib/Analysis/OptimizationRemarkEmitter.cpp b/lib/Analysis/OptimizationRemarkEmitter.cpp index 72c40a0be23..07a5619a35b 100644 --- a/lib/Analysis/OptimizationRemarkEmitter.cpp +++ b/lib/Analysis/OptimizationRemarkEmitter.cpp @@ -39,7 +39,7 @@ OptimizationRemarkEmitter::OptimizationRemarkEmitter(const Function *F) BPI.calculate(*F, LI); // Finally compute BFI. - OwnedBFI = llvm::make_unique(*F, BPI, LI); + OwnedBFI = std::make_unique(*F, BPI, LI); BFI = OwnedBFI.get(); } @@ -97,7 +97,7 @@ bool OptimizationRemarkEmitterWrapperPass::runOnFunction(Function &Fn) { else BFI = nullptr; - ORE = llvm::make_unique(&Fn, BFI); + ORE = std::make_unique(&Fn, BFI); return false; } diff --git a/lib/Analysis/OrderedInstructions.cpp b/lib/Analysis/OrderedInstructions.cpp index 458c0a7de6c..e947e5e388a 100644 --- a/lib/Analysis/OrderedInstructions.cpp +++ b/lib/Analysis/OrderedInstructions.cpp @@ -21,7 +21,7 @@ bool OrderedInstructions::localDominates(const Instruction *InstA, const BasicBlock *IBB = InstA->getParent(); auto OBB = OBBMap.find(IBB); if (OBB == OBBMap.end()) - OBB = OBBMap.insert({IBB, make_unique(IBB)}).first; + OBB = OBBMap.insert({IBB, std::make_unique(IBB)}).first; return OBB->second->dominates(InstA, InstB); } diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index e707e957a66..eb66a7c82b5 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -3107,7 +3107,7 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) { ParseToken(lltok::rbrace, "expected end of struct constant")) return true; - ID.ConstantStructElts = make_unique(Elts.size()); + ID.ConstantStructElts = std::make_unique(Elts.size()); ID.UIntVal = Elts.size(); memcpy(ID.ConstantStructElts.get(), Elts.data(), Elts.size() * sizeof(Elts[0])); @@ -3129,7 +3129,7 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) { return true; if (isPackedStruct) { - ID.ConstantStructElts = make_unique(Elts.size()); + ID.ConstantStructElts = std::make_unique(Elts.size()); memcpy(ID.ConstantStructElts.get(), Elts.data(), Elts.size() * sizeof(Elts[0])); ID.UIntVal = Elts.size(); @@ -8088,7 +8088,7 @@ bool LLParser::ParseFunctionSummary(std::string Name, GlobalValue::GUID GUID, if (ParseToken(lltok::rparen, "expected ')' here")) return true; - auto FS = llvm::make_unique( + auto FS = std::make_unique( GVFlags, InstCount, FFlags, /*EntryCount=*/0, std::move(Refs), std::move(Calls), std::move(TypeIdInfo.TypeTests), std::move(TypeIdInfo.TypeTestAssumeVCalls), @@ -8148,7 +8148,7 @@ bool LLParser::ParseVariableSummary(std::string Name, GlobalValue::GUID GUID, return true; auto GS = - llvm::make_unique(GVFlags, GVarFlags, std::move(Refs)); + std::make_unique(GVFlags, GVarFlags, std::move(Refs)); GS->setModulePath(ModulePath); GS->setVTableFuncs(std::move(VTableFuncs)); @@ -8189,7 +8189,7 @@ bool LLParser::ParseAliasSummary(std::string Name, GlobalValue::GUID GUID, if (ParseToken(lltok::rparen, "expected ')' here")) return true; - auto AS = llvm::make_unique(GVFlags); + auto AS = std::make_unique(GVFlags); AS->setModulePath(ModulePath); diff --git a/lib/AsmParser/Parser.cpp b/lib/AsmParser/Parser.cpp index b13c6237f41..b7f552a6fcc 100644 --- a/lib/AsmParser/Parser.cpp +++ b/lib/AsmParser/Parser.cpp @@ -42,7 +42,7 @@ llvm::parseAssembly(MemoryBufferRef F, SMDiagnostic &Err, LLVMContext &Context, SlotMapping *Slots, bool UpgradeDebugInfo, StringRef DataLayoutString) { std::unique_ptr M = - make_unique(F.getBufferIdentifier(), Context); + std::make_unique(F.getBufferIdentifier(), Context); if (parseAssemblyInto(F, M.get(), nullptr, Err, Slots, UpgradeDebugInfo, DataLayoutString)) @@ -71,9 +71,9 @@ ParsedModuleAndIndex llvm::parseAssemblyWithIndex( MemoryBufferRef F, SMDiagnostic &Err, LLVMContext &Context, SlotMapping *Slots, bool UpgradeDebugInfo, StringRef DataLayoutString) { std::unique_ptr M = - make_unique(F.getBufferIdentifier(), Context); + std::make_unique(F.getBufferIdentifier(), Context); std::unique_ptr Index = - make_unique(/*HaveGVs=*/true); + std::make_unique(/*HaveGVs=*/true); if (parseAssemblyInto(F, M.get(), Index.get(), Err, Slots, UpgradeDebugInfo, DataLayoutString)) @@ -123,7 +123,7 @@ static bool parseSummaryIndexAssemblyInto(MemoryBufferRef F, std::unique_ptr llvm::parseSummaryIndexAssembly(MemoryBufferRef F, SMDiagnostic &Err) { std::unique_ptr Index = - make_unique(/*HaveGVs=*/false); + std::make_unique(/*HaveGVs=*/false); if (parseSummaryIndexAssemblyInto(F, *Index, Err)) return nullptr; diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 997b556f0f9..32ae4cd9956 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -5874,7 +5874,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { ArrayRef(Record).slice(CallGraphEdgeStartIndex), IsOldProfileFormat, HasProfile, HasRelBF); setSpecialRefs(Refs, NumRORefs, NumWORefs); - auto FS = llvm::make_unique( + auto FS = std::make_unique( Flags, InstCount, getDecodedFFlags(RawFunFlags), /*EntryCount=*/0, std::move(Refs), std::move(Calls), std::move(PendingTypeTests), std::move(PendingTypeTestAssumeVCalls), @@ -5900,7 +5900,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { uint64_t RawFlags = Record[1]; unsigned AliaseeID = Record[2]; auto Flags = getDecodedGVSummaryFlags(RawFlags, Version); - auto AS = llvm::make_unique(Flags); + auto AS = std::make_unique(Flags); // The module path string ref set in the summary must be owned by the // index's module string table. Since we don't have a module path // string table section in the per-module index, we create a single @@ -5934,7 +5934,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { std::vector Refs = makeRefList(ArrayRef(Record).slice(RefArrayStart)); auto FS = - llvm::make_unique(Flags, GVF, std::move(Refs)); + std::make_unique(Flags, GVF, std::move(Refs)); FS->setModulePath(getThisModule()->first()); auto GUID = getValueInfoFromValueId(ValueID); FS->setOriginalName(GUID.second); @@ -5961,7 +5961,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { VTableFuncs.push_back({Callee, Offset}); } auto VS = - llvm::make_unique(Flags, GVF, std::move(Refs)); + std::make_unique(Flags, GVF, std::move(Refs)); VS->setModulePath(getThisModule()->first()); VS->setVTableFuncs(VTableFuncs); auto GUID = getValueInfoFromValueId(ValueID); @@ -6019,7 +6019,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { IsOldProfileFormat, HasProfile, false); ValueInfo VI = getValueInfoFromValueId(ValueID).first; setSpecialRefs(Refs, NumRORefs, NumWORefs); - auto FS = llvm::make_unique( + auto FS = std::make_unique( Flags, InstCount, getDecodedFFlags(RawFunFlags), EntryCount, std::move(Refs), std::move(Edges), std::move(PendingTypeTests), std::move(PendingTypeTestAssumeVCalls), @@ -6046,7 +6046,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { uint64_t RawFlags = Record[2]; unsigned AliaseeValueId = Record[3]; auto Flags = getDecodedGVSummaryFlags(RawFlags, Version); - auto AS = llvm::make_unique(Flags); + auto AS = std::make_unique(Flags); LastSeenSummary = AS.get(); AS->setModulePath(ModuleIdMap[ModuleId]); @@ -6075,7 +6075,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { std::vector Refs = makeRefList(ArrayRef(Record).slice(RefArrayStart)); auto FS = - llvm::make_unique(Flags, GVF, std::move(Refs)); + std::make_unique(Flags, GVF, std::move(Refs)); LastSeenSummary = FS.get(); FS->setModulePath(ModuleIdMap[ModuleId]); ValueInfo VI = getValueInfoFromValueId(ValueID).first; @@ -6438,7 +6438,7 @@ BitcodeModule::getModuleImpl(LLVMContext &Context, bool MaterializeAll, Context); std::unique_ptr M = - llvm::make_unique(ModuleIdentifier, Context); + std::make_unique(ModuleIdentifier, Context); M->setMaterializer(R); // Delay parsing Metadata if ShouldLazyLoadMetadata is true. @@ -6485,7 +6485,7 @@ Expected> BitcodeModule::getSummary() { if (Error JumpFailed = Stream.JumpToBit(ModuleBit)) return std::move(JumpFailed); - auto Index = llvm::make_unique(/*HaveGVs=*/false); + auto Index = std::make_unique(/*HaveGVs=*/false); ModuleSummaryIndexBitcodeReader R(std::move(Stream), Strtab, *Index, ModuleIdentifier, 0); diff --git a/lib/Bitcode/Reader/MetadataLoader.cpp b/lib/Bitcode/Reader/MetadataLoader.cpp index 108f7118958..fa50ec5766a 100644 --- a/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/lib/Bitcode/Reader/MetadataLoader.cpp @@ -2133,7 +2133,7 @@ MetadataLoader::MetadataLoader(BitstreamCursor &Stream, Module &TheModule, BitcodeReaderValueList &ValueList, bool IsImporting, std::function getTypeByID) - : Pimpl(llvm::make_unique( + : Pimpl(std::make_unique( Stream, TheModule, ValueList, std::move(getTypeByID), IsImporting)) {} Error MetadataLoader::parseMetadata(bool ModuleLevel) { diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 0319f256c6e..cc1566929e3 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -311,7 +311,7 @@ bool AsmPrinter::doInitialization(Module &M) { if (MAI->doesSupportDebugInformation()) { bool EmitCodeView = MMI->getModule()->getCodeViewFlag(); if (EmitCodeView && TM.getTargetTriple().isOSWindows()) { - Handlers.emplace_back(llvm::make_unique(this), + Handlers.emplace_back(std::make_unique(this), DbgTimerName, DbgTimerDescription, CodeViewLineTablesGroupName, CodeViewLineTablesGroupDescription); @@ -380,7 +380,7 @@ bool AsmPrinter::doInitialization(Module &M) { if (mdconst::extract_or_null( MMI->getModule()->getModuleFlag("cfguardtable"))) - Handlers.emplace_back(llvm::make_unique(this), CFGuardName, + Handlers.emplace_back(std::make_unique(this), CFGuardName, CFGuardDescription, DWARFGroupName, DWARFGroupDescription); @@ -1025,7 +1025,7 @@ void AsmPrinter::EmitFunctionBody() { // Get MachineDominatorTree or compute it on the fly if it's unavailable MDT = getAnalysisIfAvailable(); if (!MDT) { - OwnedMDT = make_unique(); + OwnedMDT = std::make_unique(); OwnedMDT->getBase().recalculate(*MF); MDT = OwnedMDT.get(); } @@ -1033,7 +1033,7 @@ void AsmPrinter::EmitFunctionBody() { // Get MachineLoopInfo or compute it on the fly if it's unavailable MLI = getAnalysisIfAvailable(); if (!MLI) { - OwnedMLI = make_unique(); + OwnedMLI = std::make_unique(); OwnedMLI->getBase().analyze(MDT->getBase()); MLI = OwnedMLI.get(); } diff --git a/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp index 5e49fec9c05..420df26a2b8 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp @@ -72,7 +72,7 @@ static void srcMgrDiagHandler(const SMDiagnostic &Diag, void *diagInfo) { unsigned AsmPrinter::addInlineAsmDiagBuffer(StringRef AsmStr, const MDNode *LocMDNode) const { if (!DiagInfo) { - DiagInfo = make_unique(); + DiagInfo = std::make_unique(); MCContext &Context = MMI->getContext(); Context.setInlineSourceManager(&DiagInfo->SrcMgr); diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index ea836469771..65060966a4e 100644 --- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -648,9 +648,9 @@ void CodeViewDebug::emitTypeInformation() { if (OS.isVerboseAsm()) { // To construct block comment describing the type record for readability. - SP = llvm::make_unique(CommentOS); + SP = std::make_unique(CommentOS); SP->setPrefix(CommentPrefix); - TDV = llvm::make_unique(Table, SP.get(), false); + TDV = std::make_unique(Table, SP.get(), false); Pipeline.addCallbackToPipeline(*TDV); } @@ -1363,7 +1363,7 @@ void CodeViewDebug::beginFunctionImpl(const MachineFunction *MF) { const TargetRegisterInfo *TRI = TSI.getRegisterInfo(); const MachineFrameInfo &MFI = MF->getFrameInfo(); const Function &GV = MF->getFunction(); - auto Insertion = FnDebugInfo.insert({&GV, llvm::make_unique()}); + auto Insertion = FnDebugInfo.insert({&GV, std::make_unique()}); assert(Insertion.second && "function already has info"); CurFn = Insertion.first->second.get(); CurFn->FuncId = NextFuncId++; @@ -3015,7 +3015,7 @@ void CodeViewDebug::collectGlobalVariableInfo() { auto Insertion = ScopeGlobals.insert( {Scope, std::unique_ptr()}); if (Insertion.second) - Insertion.first->second = llvm::make_unique(); + Insertion.first->second = std::make_unique(); VariableList = Insertion.first->second.get(); } else if (GV->hasComdat()) // Emit this global variable into a COMDAT section. diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 1b6326c1872..46c8bd8a0ed 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -208,7 +208,7 @@ void DwarfCompileUnit::addLocationAttribute( if (!Loc) { addToAccelTable = true; Loc = new (DIEValueAllocator) DIELoc; - DwarfExpr = llvm::make_unique(*Asm, *this, *Loc); + DwarfExpr = std::make_unique(*Asm, *this, *Loc); } if (Expr) { @@ -1071,11 +1071,11 @@ void DwarfCompileUnit::createAbstractEntity(const DINode *Node, assert(Scope && Scope->isAbstractScope()); auto &Entity = getAbstractEntities()[Node]; if (isa(Node)) { - Entity = llvm::make_unique( + Entity = std::make_unique( cast(Node), nullptr /* IA */);; DU->addScopeVariable(Scope, cast(Entity.get())); } else if (isa(Node)) { - Entity = llvm::make_unique( + Entity = std::make_unique( cast(Node), nullptr /* IA */); DU->addScopeLabel(Scope, cast(Entity.get())); } diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index d828c9097e9..364119a6ca1 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -279,7 +279,7 @@ void DbgVariable::initializeDbgValue(const MachineInstr *DbgValue) { assert(getInlinedAt() == DbgValue->getDebugLoc()->getInlinedAt() && "Wrong inlined-at"); - ValueLoc = llvm::make_unique(getDebugLocValue(DbgValue)); + ValueLoc = std::make_unique(getDebugLocValue(DbgValue)); if (auto *E = DbgValue->getDebugExpression()) if (E->getNumElements()) FrameIndexExprs.push_back({0, E}); @@ -864,7 +864,7 @@ DwarfDebug::getOrCreateDwarfCompileUnit(const DICompileUnit *DIUnit) { CompilationDir = DIUnit->getDirectory(); - auto OwnedUnit = llvm::make_unique( + auto OwnedUnit = std::make_unique( InfoHolder.getUnits().size(), DIUnit, Asm, this, &InfoHolder); DwarfCompileUnit &NewCU = *OwnedUnit; InfoHolder.addUnit(std::move(OwnedUnit)); @@ -1289,7 +1289,7 @@ void DwarfDebug::collectVariableInfoFromMFTable( continue; ensureAbstractEntityIsCreatedIfScoped(TheCU, Var.first, Scope->getScopeNode()); - auto RegVar = llvm::make_unique( + auto RegVar = std::make_unique( cast(Var.first), Var.second); RegVar->initializeMMI(VI.Expr, VI.Slot); if (DbgVariable *DbgVar = MFVars.lookup(Var)) @@ -1500,13 +1500,13 @@ DbgEntity *DwarfDebug::createConcreteEntity(DwarfCompileUnit &TheCU, ensureAbstractEntityIsCreatedIfScoped(TheCU, Node, Scope.getScopeNode()); if (isa(Node)) { ConcreteEntities.push_back( - llvm::make_unique(cast(Node), + std::make_unique(cast(Node), Location)); InfoHolder.addScopeVariable(&Scope, cast(ConcreteEntities.back().get())); } else if (isa(Node)) { ConcreteEntities.push_back( - llvm::make_unique(cast(Node), + std::make_unique(cast(Node), Location, Sym)); InfoHolder.addScopeLabel(&Scope, cast(ConcreteEntities.back().get())); @@ -2824,7 +2824,7 @@ void DwarfDebug::initSkeletonUnit(const DwarfUnit &U, DIE &Die, DwarfCompileUnit &DwarfDebug::constructSkeletonCU(const DwarfCompileUnit &CU) { - auto OwnedUnit = llvm::make_unique( + auto OwnedUnit = std::make_unique( CU.getUniqueID(), CU.getCUNode(), Asm, this, &SkeletonHolder); DwarfCompileUnit &NewCU = *OwnedUnit; NewCU.setSection(Asm->getObjFileLowering().getDwarfInfoSection()); @@ -2924,7 +2924,7 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU, bool TopLevelType = TypeUnitsUnderConstruction.empty(); AddrPool.resetUsedFlag(); - auto OwnedUnit = llvm::make_unique(CU, Asm, this, &InfoHolder, + auto OwnedUnit = std::make_unique(CU, Asm, this, &InfoHolder, getDwoLineTable(CU)); DwarfTypeUnit &NewTU = *OwnedUnit; DIE &UnitDie = NewTU.getUnitDie(); diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 4f3630f84c9..843caf1ab18 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -153,7 +153,7 @@ public: assert(!ValueLoc && "Already initialized?"); assert(!Value.getExpression()->isFragment() && "Fragments not supported."); - ValueLoc = llvm::make_unique(Value); + ValueLoc = std::make_unique(Value); if (auto *E = ValueLoc->getExpression()) if (E->getNumElements()) FrameIndexExprs.push_back({0, E}); diff --git a/lib/CodeGen/CodeGenPrepare.cpp b/lib/CodeGen/CodeGenPrepare.cpp index 511b7f73857..d4d5fcd48cb 100644 --- a/lib/CodeGen/CodeGenPrepare.cpp +++ b/lib/CodeGen/CodeGenPrepare.cpp @@ -344,7 +344,7 @@ class TypePromotionTransaction; // Get the DominatorTree, building if necessary. DominatorTree &getDT(Function &F) { if (!DT) - DT = llvm::make_unique(F); + DT = std::make_unique(F); return *DT; } @@ -2680,26 +2680,26 @@ private: void TypePromotionTransaction::setOperand(Instruction *Inst, unsigned Idx, Value *NewVal) { - Actions.push_back(llvm::make_unique( + Actions.push_back(std::make_unique( Inst, Idx, NewVal)); } void TypePromotionTransaction::eraseInstruction(Instruction *Inst, Value *NewVal) { Actions.push_back( - llvm::make_unique( + std::make_unique( Inst, RemovedInsts, NewVal)); } void TypePromotionTransaction::replaceAllUsesWith(Instruction *Inst, Value *New) { Actions.push_back( - llvm::make_unique(Inst, New)); + std::make_unique(Inst, New)); } void TypePromotionTransaction::mutateType(Instruction *Inst, Type *NewTy) { Actions.push_back( - llvm::make_unique(Inst, NewTy)); + std::make_unique(Inst, NewTy)); } Value *TypePromotionTransaction::createTrunc(Instruction *Opnd, @@ -2729,7 +2729,7 @@ Value *TypePromotionTransaction::createZExt(Instruction *Inst, void TypePromotionTransaction::moveBefore(Instruction *Inst, Instruction *Before) { Actions.push_back( - llvm::make_unique( + std::make_unique( Inst, Before)); } diff --git a/lib/CodeGen/GCMetadata.cpp b/lib/CodeGen/GCMetadata.cpp index 9c53550eaa9..c1d22ef8919 100644 --- a/lib/CodeGen/GCMetadata.cpp +++ b/lib/CodeGen/GCMetadata.cpp @@ -72,7 +72,7 @@ GCFunctionInfo &GCModuleInfo::getFunctionInfo(const Function &F) { return *I->second; GCStrategy *S = getGCStrategy(F.getGC()); - Functions.push_back(llvm::make_unique(F, *S)); + Functions.push_back(std::make_unique(F, *S)); GCFunctionInfo *GFI = Functions.back().get(); FInfoMap[&F] = GFI; return *GFI; diff --git a/lib/CodeGen/GlobalISel/CSEInfo.cpp b/lib/CodeGen/GlobalISel/CSEInfo.cpp index 4518dbee1a9..78939057e8a 100644 --- a/lib/CodeGen/GlobalISel/CSEInfo.cpp +++ b/lib/CodeGen/GlobalISel/CSEInfo.cpp @@ -65,9 +65,9 @@ std::unique_ptr llvm::getStandardCSEConfigForOpt(CodeGenOpt::Level Level) { std::unique_ptr Config; if (Level == CodeGenOpt::None) - Config = make_unique(); + Config = std::make_unique(); else - Config = make_unique(); + Config = std::make_unique(); return Config; } diff --git a/lib/CodeGen/GlobalISel/Combiner.cpp b/lib/CodeGen/GlobalISel/Combiner.cpp index 31cb1dbbc9b..644ce2e604b 100644 --- a/lib/CodeGen/GlobalISel/Combiner.cpp +++ b/lib/CodeGen/GlobalISel/Combiner.cpp @@ -92,7 +92,7 @@ bool Combiner::combineMachineInstrs(MachineFunction &MF, return false; Builder = - CSEInfo ? make_unique() : make_unique(); + CSEInfo ? std::make_unique() : std::make_unique(); MRI = &MF.getRegInfo(); Builder->setMF(MF); if (CSEInfo) diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index 19753fbce5a..81ea7b539be 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -2193,26 +2193,26 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) { : TPC->isGISelCSEEnabled(); if (EnableCSE) { - EntryBuilder = make_unique(CurMF); + EntryBuilder = std::make_unique(CurMF); CSEInfo = &Wrapper.get(TPC->getCSEConfig()); EntryBuilder->setCSEInfo(CSEInfo); - CurBuilder = make_unique(CurMF); + CurBuilder = std::make_unique(CurMF); CurBuilder->setCSEInfo(CSEInfo); } else { - EntryBuilder = make_unique(); - CurBuilder = make_unique(); + EntryBuilder = std::make_unique(); + CurBuilder = std::make_unique(); } CLI = MF->getSubtarget().getCallLowering(); CurBuilder->setMF(*MF); EntryBuilder->setMF(*MF); MRI = &MF->getRegInfo(); DL = &F.getParent()->getDataLayout(); - ORE = llvm::make_unique(&F); + ORE = std::make_unique(&F); FuncInfo.MF = MF; FuncInfo.BPI = nullptr; const auto &TLI = *MF->getSubtarget().getTargetLowering(); const TargetMachine &TM = MF->getTarget(); - SL = make_unique(this, FuncInfo); + SL = std::make_unique(this, FuncInfo); SL->init(TLI, TM, *DL); EnableOpts = TM.getOptLevel() != CodeGenOpt::None && !skipFunction(F); diff --git a/lib/CodeGen/GlobalISel/Legalizer.cpp b/lib/CodeGen/GlobalISel/Legalizer.cpp index b5b26bff34b..6391a5ee011 100644 --- a/lib/CodeGen/GlobalISel/Legalizer.cpp +++ b/lib/CodeGen/GlobalISel/Legalizer.cpp @@ -184,11 +184,11 @@ bool Legalizer::runOnMachineFunction(MachineFunction &MF) { : TPC.isGISelCSEEnabled(); if (EnableCSE) { - MIRBuilder = make_unique(); + MIRBuilder = std::make_unique(); CSEInfo = &Wrapper.get(TPC.getCSEConfig()); MIRBuilder->setCSEInfo(CSEInfo); } else - MIRBuilder = make_unique(); + MIRBuilder = std::make_unique(); // This observer keeps the worklist updated. LegalizerWorkListManager WorkListObserver(InstList, ArtifactList); // We want both WorkListObserver as well as CSEInfo to observe all changes. diff --git a/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/lib/CodeGen/GlobalISel/RegBankSelect.cpp index 25bcfa91fa4..e69dc136096 100644 --- a/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -92,7 +92,7 @@ void RegBankSelect::init(MachineFunction &MF) { MBPI = nullptr; } MIRBuilder.setMF(MF); - MORE = llvm::make_unique(MF, MBFI); + MORE = std::make_unique(MF, MBFI); } void RegBankSelect::getAnalysisUsage(AnalysisUsage &AU) const { diff --git a/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp b/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp index f9c1ec515dc..82eaa88abc7 100644 --- a/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp +++ b/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp @@ -283,7 +283,7 @@ RegisterBankInfo::getPartialMapping(unsigned StartIdx, unsigned Length, ++NumPartialMappingsCreated; auto &PartMapping = MapOfPartialMappings[Hash]; - PartMapping = llvm::make_unique(StartIdx, Length, RegBank); + PartMapping = std::make_unique(StartIdx, Length, RegBank); return *PartMapping; } @@ -317,7 +317,7 @@ RegisterBankInfo::getValueMapping(const PartialMapping *BreakDown, ++NumValueMappingsCreated; auto &ValMapping = MapOfValueMappings[Hash]; - ValMapping = llvm::make_unique(BreakDown, NumBreakDowns); + ValMapping = std::make_unique(BreakDown, NumBreakDowns); return *ValMapping; } @@ -341,7 +341,7 @@ RegisterBankInfo::getOperandsMapping(Iterator Begin, Iterator End) const { // mapping, because we use the pointer of the ValueMapping // to hash and we expect them to uniquely identify an instance // of value mapping. - Res = llvm::make_unique(std::distance(Begin, End)); + Res = std::make_unique(std::distance(Begin, End)); unsigned Idx = 0; for (Iterator It = Begin; It != End; ++It, ++Idx) { const ValueMapping *ValMap = *It; @@ -391,7 +391,7 @@ RegisterBankInfo::getInstructionMappingImpl( ++NumInstructionMappingsCreated; auto &InstrMapping = MapOfInstructionMappings[Hash]; - InstrMapping = llvm::make_unique( + InstrMapping = std::make_unique( ID, Cost, OperandsMapping, NumOperands); return *InstrMapping; } diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp index b17a253fe23..6f6581e360c 100644 --- a/lib/CodeGen/IfConversion.cpp +++ b/lib/CodeGen/IfConversion.cpp @@ -1200,7 +1200,7 @@ void IfConverter::AnalyzeBlock( // \ / // TailBB // Note TailBB can be empty. - Tokens.push_back(llvm::make_unique( + Tokens.push_back(std::make_unique( BBI, ICDiamond, TNeedSub | FNeedSub, Dups, Dups2, (bool) TrueBBICalc.ClobbersPred, (bool) FalseBBICalc.ClobbersPred)); Enqueued = true; @@ -1218,7 +1218,7 @@ void IfConverter::AnalyzeBlock( // / \ / \ // FalseBB TrueBB FalseBB // - Tokens.push_back(llvm::make_unique( + Tokens.push_back(std::make_unique( BBI, ICForkedDiamond, TNeedSub | FNeedSub, Dups, Dups2, (bool) TrueBBICalc.ClobbersPred, (bool) FalseBBICalc.ClobbersPred)); Enqueued = true; @@ -1238,7 +1238,7 @@ void IfConverter::AnalyzeBlock( // | / // FBB Tokens.push_back( - llvm::make_unique(BBI, ICTriangle, TNeedSub, Dups)); + std::make_unique(BBI, ICTriangle, TNeedSub, Dups)); Enqueued = true; } @@ -1247,7 +1247,7 @@ void IfConverter::AnalyzeBlock( TrueBBI.ExtraCost2, Prediction) && FeasibilityAnalysis(TrueBBI, BBI.BrCond, true, true)) { Tokens.push_back( - llvm::make_unique(BBI, ICTriangleRev, TNeedSub, Dups)); + std::make_unique(BBI, ICTriangleRev, TNeedSub, Dups)); Enqueued = true; } @@ -1263,7 +1263,7 @@ void IfConverter::AnalyzeBlock( // | // FBB Tokens.push_back( - llvm::make_unique(BBI, ICSimple, TNeedSub, Dups)); + std::make_unique(BBI, ICSimple, TNeedSub, Dups)); Enqueued = true; } @@ -1275,7 +1275,7 @@ void IfConverter::AnalyzeBlock( FalseBBI.NonPredSize + FalseBBI.ExtraCost, FalseBBI.ExtraCost2, Prediction.getCompl()) && FeasibilityAnalysis(FalseBBI, RevCond, true)) { - Tokens.push_back(llvm::make_unique(BBI, ICTriangleFalse, + Tokens.push_back(std::make_unique(BBI, ICTriangleFalse, FNeedSub, Dups)); Enqueued = true; } @@ -1287,7 +1287,7 @@ void IfConverter::AnalyzeBlock( FalseBBI.ExtraCost2, Prediction.getCompl()) && FeasibilityAnalysis(FalseBBI, RevCond, true, true)) { Tokens.push_back( - llvm::make_unique(BBI, ICTriangleFRev, FNeedSub, Dups)); + std::make_unique(BBI, ICTriangleFRev, FNeedSub, Dups)); Enqueued = true; } @@ -1297,7 +1297,7 @@ void IfConverter::AnalyzeBlock( FalseBBI.ExtraCost2, Prediction.getCompl()) && FeasibilityAnalysis(FalseBBI, RevCond)) { Tokens.push_back( - llvm::make_unique(BBI, ICSimpleFalse, FNeedSub, Dups)); + std::make_unique(BBI, ICSimpleFalse, FNeedSub, Dups)); Enqueued = true; } } diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp index 3a320d9243e..7fb3fff5cb6 100644 --- a/lib/CodeGen/InlineSpiller.cpp +++ b/lib/CodeGen/InlineSpiller.cpp @@ -1145,7 +1145,7 @@ void HoistSpillHelper::addToMergeableSpills(MachineInstr &Spill, int StackSlot, // save a copy of LiveInterval in StackSlotToOrigLI because the original // LiveInterval may be cleared after all its references are spilled. if (StackSlotToOrigLI.find(StackSlot) == StackSlotToOrigLI.end()) { - auto LI = llvm::make_unique(OrigLI.reg, OrigLI.weight); + auto LI = std::make_unique(OrigLI.reg, OrigLI.weight); LI->assign(OrigLI, Allocator); StackSlotToOrigLI[StackSlot] = std::move(LI); } diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 886ae7e94ad..cd70792146d 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -139,7 +139,7 @@ bool LLVMTargetMachine::addAsmPrinter(PassManagerBase &PM, std::unique_ptr MAB( getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions)); - auto FOut = llvm::make_unique(Out); + auto FOut = std::make_unique(Out); MCStreamer *S = getTarget().createAsmStreamer( Context, std::move(FOut), Options.MCOptions.AsmVerbose, Options.MCOptions.MCUseDwarfDirectory, InstPrinter, std::move(MCE), diff --git a/lib/CodeGen/LazyMachineBlockFrequencyInfo.cpp b/lib/CodeGen/LazyMachineBlockFrequencyInfo.cpp index 200ac0ba15b..cef5085ae07 100644 --- a/lib/CodeGen/LazyMachineBlockFrequencyInfo.cpp +++ b/lib/CodeGen/LazyMachineBlockFrequencyInfo.cpp @@ -73,18 +73,18 @@ LazyMachineBlockFrequencyInfoPass::calculateIfNotAvailable() const { if (!MDT) { LLVM_DEBUG(dbgs() << "Building DominatorTree on the fly\n"); - OwnedMDT = make_unique(); + OwnedMDT = std::make_unique(); OwnedMDT->getBase().recalculate(*MF); MDT = OwnedMDT.get(); } // Generate LoopInfo from it. - OwnedMLI = make_unique(); + OwnedMLI = std::make_unique(); OwnedMLI->getBase().analyze(MDT->getBase()); MLI = OwnedMLI.get(); } - OwnedMBFI = make_unique(); + OwnedMBFI = std::make_unique(); OwnedMBFI->calculate(*MF, MBPI, *MLI); return *OwnedMBFI.get(); } diff --git a/lib/CodeGen/LiveDebugValues.cpp b/lib/CodeGen/LiveDebugValues.cpp index 02a6e37b477..3e0f51fb6d4 100644 --- a/lib/CodeGen/LiveDebugValues.cpp +++ b/lib/CodeGen/LiveDebugValues.cpp @@ -1308,7 +1308,7 @@ bool LiveDebugValues::runOnMachineFunction(MachineFunction &MF) { TII = MF.getSubtarget().getInstrInfo(); TFI = MF.getSubtarget().getFrameLowering(); TFI->determineCalleeSaves(MF, CalleeSavedRegs, - make_unique().get()); + std::make_unique().get()); LS.initialize(MF); bool Changed = ExtendRanges(MF); diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp index afe48bfffe8..6ba8c48fcee 100644 --- a/lib/CodeGen/LiveDebugVariables.cpp +++ b/lib/CodeGen/LiveDebugVariables.cpp @@ -570,7 +570,7 @@ UserValue *LDVImpl::getUserValue(const DILocalVariable *Var, } userValues.push_back( - llvm::make_unique(Var, Expr, DL, allocator)); + std::make_unique(Var, Expr, DL, allocator)); UserValue *UV = userValues.back().get(); Leader = UserValue::merge(Leader, UV); return UV; @@ -666,7 +666,7 @@ bool LDVImpl::handleDebugLabel(MachineInstr &MI, SlotIndex Idx) { } } if (!Found) - userLabels.push_back(llvm::make_unique(Label, DL, Idx)); + userLabels.push_back(std::make_unique(Label, DL, Idx)); return true; } diff --git a/lib/CodeGen/MIRParser/MIRParser.cpp b/lib/CodeGen/MIRParser/MIRParser.cpp index a85a25cd709..f3dcb9c1214 100644 --- a/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/lib/CodeGen/MIRParser/MIRParser.cpp @@ -216,7 +216,7 @@ std::unique_ptr MIRParserImpl::parseIRModule() { return nullptr; // Create an empty module when the MIR file is empty. NoMIRDocuments = true; - return llvm::make_unique(Filename, Context); + return std::make_unique(Filename, Context); } std::unique_ptr M; @@ -236,7 +236,7 @@ std::unique_ptr MIRParserImpl::parseIRModule() { NoMIRDocuments = true; } else { // Create an new, empty module. - M = llvm::make_unique(Filename, Context); + M = std::make_unique(Filename, Context); NoLLVMIR = true; } return M; @@ -949,6 +949,6 @@ llvm::createMIRParser(std::unique_ptr Contents, "Can't read MIR with a Context that discards named Values"))); return nullptr; } - return llvm::make_unique( - llvm::make_unique(std::move(Contents), Filename, Context)); + return std::make_unique( + std::make_unique(std::move(Contents), Filename, Context)); } diff --git a/lib/CodeGen/MachineBlockPlacement.cpp b/lib/CodeGen/MachineBlockPlacement.cpp index bbef2598fb1..4e48b810460 100644 --- a/lib/CodeGen/MachineBlockPlacement.cpp +++ b/lib/CodeGen/MachineBlockPlacement.cpp @@ -3015,7 +3015,7 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) { F = &MF; MBPI = &getAnalysis(); - MBFI = llvm::make_unique( + MBFI = std::make_unique( getAnalysis()); MLI = &getAnalysis(); TII = MF.getSubtarget().getInstrInfo(); diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index e4172db4f8c..b771dd1a351 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -200,7 +200,7 @@ void MachineFunction::init() { "Target-incompatible DataLayout attached\n"); PSVManager = - llvm::make_unique(*(getSubtarget(). + std::make_unique(*(getSubtarget(). getInstrInfo())); } diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 2c141d0373f..7316148e4c0 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -1725,7 +1725,7 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST, MFI = &MF->getFrameInfo(); Context = &MF->getFunction().getContext(); } else { - CtxPtr = llvm::make_unique(); + CtxPtr = std::make_unique(); Context = CtxPtr.get(); } diff --git a/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp b/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp index 27db9106b33..b82403ae1b8 100644 --- a/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp +++ b/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp @@ -76,7 +76,7 @@ bool MachineOptimizationRemarkEmitterPass::runOnMachineFunction( else MBFI = nullptr; - ORE = llvm::make_unique(MF, MBFI); + ORE = std::make_unique(MF, MBFI); return false; } diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp index 3d599b4cab1..ea322bf0d2d 100644 --- a/lib/CodeGen/MachineScheduler.cpp +++ b/lib/CodeGen/MachineScheduler.cpp @@ -1538,14 +1538,14 @@ namespace llvm { std::unique_ptr createLoadClusterDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) { - return EnableMemOpCluster ? llvm::make_unique(TII, TRI) + return EnableMemOpCluster ? std::make_unique(TII, TRI) : nullptr; } std::unique_ptr createStoreClusterDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) { - return EnableMemOpCluster ? llvm::make_unique(TII, TRI) + return EnableMemOpCluster ? std::make_unique(TII, TRI) : nullptr; } @@ -1657,7 +1657,7 @@ namespace llvm { std::unique_ptr createCopyConstrainDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) { - return llvm::make_unique(TII, TRI); + return std::make_unique(TII, TRI); } } // end namespace llvm @@ -3297,7 +3297,7 @@ void GenericScheduler::schedNode(SUnit *SU, bool IsTopNode) { /// default scheduler if the target does not set a default. ScheduleDAGMILive *llvm::createGenericSchedLive(MachineSchedContext *C) { ScheduleDAGMILive *DAG = - new ScheduleDAGMILive(C, llvm::make_unique(C)); + new ScheduleDAGMILive(C, std::make_unique(C)); // Register DAG post-processors. // // FIXME: extend the mutation API to allow earlier mutations to instantiate @@ -3449,7 +3449,7 @@ void PostGenericScheduler::schedNode(SUnit *SU, bool IsTopNode) { } ScheduleDAGMI *llvm::createGenericSchedPostRA(MachineSchedContext *C) { - return new ScheduleDAGMI(C, llvm::make_unique(C), + return new ScheduleDAGMI(C, std::make_unique(C), /*RemoveKillFlags=*/true); } @@ -3560,10 +3560,10 @@ public: } // end anonymous namespace static ScheduleDAGInstrs *createILPMaxScheduler(MachineSchedContext *C) { - return new ScheduleDAGMILive(C, llvm::make_unique(true)); + return new ScheduleDAGMILive(C, std::make_unique(true)); } static ScheduleDAGInstrs *createILPMinScheduler(MachineSchedContext *C) { - return new ScheduleDAGMILive(C, llvm::make_unique(false)); + return new ScheduleDAGMILive(C, std::make_unique(false)); } static MachineSchedRegistry ILPMaxRegistry( @@ -3657,7 +3657,7 @@ static ScheduleDAGInstrs *createInstructionShuffler(MachineSchedContext *C) { assert((TopDown || !ForceTopDown) && "-misched-topdown incompatible with -misched-bottomup"); return new ScheduleDAGMILive( - C, llvm::make_unique(Alternate, TopDown)); + C, std::make_unique(Alternate, TopDown)); } static MachineSchedRegistry ShufflerRegistry( diff --git a/lib/CodeGen/MacroFusion.cpp b/lib/CodeGen/MacroFusion.cpp index 2db1e86905a..d21eae222af 100644 --- a/lib/CodeGen/MacroFusion.cpp +++ b/lib/CodeGen/MacroFusion.cpp @@ -176,7 +176,7 @@ std::unique_ptr llvm::createMacroFusionDAGMutation( ShouldSchedulePredTy shouldScheduleAdjacent) { if(EnableMacroFusion) - return llvm::make_unique(shouldScheduleAdjacent, true); + return std::make_unique(shouldScheduleAdjacent, true); return nullptr; } @@ -184,6 +184,6 @@ std::unique_ptr llvm::createBranchMacroFusionDAGMutation( ShouldSchedulePredTy shouldScheduleAdjacent) { if(EnableMacroFusion) - return llvm::make_unique(shouldScheduleAdjacent, false); + return std::make_unique(shouldScheduleAdjacent, false); return nullptr; } diff --git a/lib/CodeGen/PseudoSourceValue.cpp b/lib/CodeGen/PseudoSourceValue.cpp index da3ef4b771f..74e721dbd13 100644 --- a/lib/CodeGen/PseudoSourceValue.cpp +++ b/lib/CodeGen/PseudoSourceValue.cpp @@ -129,7 +129,7 @@ const PseudoSourceValue * PseudoSourceValueManager::getFixedStack(int FI) { std::unique_ptr &V = FSValues[FI]; if (!V) - V = llvm::make_unique(FI, TII); + V = std::make_unique(FI, TII); return V.get(); } @@ -138,7 +138,7 @@ PseudoSourceValueManager::getGlobalValueCallEntry(const GlobalValue *GV) { std::unique_ptr &E = GlobalCallEntries[GV]; if (!E) - E = llvm::make_unique(GV, TII); + E = std::make_unique(GV, TII); return E.get(); } @@ -147,6 +147,6 @@ PseudoSourceValueManager::getExternalSymbolCallEntry(const char *ES) { std::unique_ptr &E = ExternalCallEntries[ES]; if (!E) - E = llvm::make_unique(ES, TII); + E = std::make_unique(ES, TII); return E.get(); } diff --git a/lib/CodeGen/RegAllocPBQP.cpp b/lib/CodeGen/RegAllocPBQP.cpp index 217947e0c9c..3c4a46b12f9 100644 --- a/lib/CodeGen/RegAllocPBQP.cpp +++ b/lib/CodeGen/RegAllocPBQP.cpp @@ -824,11 +824,11 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) { if (!VRegsToAlloc.empty()) { const TargetSubtargetInfo &Subtarget = MF.getSubtarget(); std::unique_ptr ConstraintsRoot = - llvm::make_unique(); - ConstraintsRoot->addConstraint(llvm::make_unique()); - ConstraintsRoot->addConstraint(llvm::make_unique()); + std::make_unique(); + ConstraintsRoot->addConstraint(std::make_unique()); + ConstraintsRoot->addConstraint(std::make_unique()); if (PBQPCoalescing) - ConstraintsRoot->addConstraint(llvm::make_unique()); + ConstraintsRoot->addConstraint(std::make_unique()); ConstraintsRoot->addConstraint(Subtarget.getCustomPBQPConstraints()); bool PBQPAllocComplete = false; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h index 0072e33f23b..bfcf30b430b 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -426,7 +426,7 @@ public: SelectionDAGBuilder(SelectionDAG &dag, FunctionLoweringInfo &funcinfo, SwiftErrorValueTracking &swifterror, CodeGenOpt::Level ol) : SDNodeOrder(LowestSDNodeOrder), TM(dag.getTarget()), DAG(dag), - SL(make_unique(this, funcinfo)), FuncInfo(funcinfo), + SL(std::make_unique(this, funcinfo)), FuncInfo(funcinfo), SwiftError(swifterror) {} void init(GCFunctionInfo *gfi, AliasAnalysis *AA, diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 434dc3a62ca..c8fac8fbdcc 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -436,7 +436,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { RegInfo = &MF->getRegInfo(); LibInfo = &getAnalysis().getTLI(); GFI = Fn.hasGC() ? &getAnalysis().getFunctionInfo(Fn) : nullptr; - ORE = make_unique(&Fn); + ORE = std::make_unique(&Fn); auto *DTWP = getAnalysisIfAvailable(); DominatorTree *DT = DTWP ? &DTWP->getDomTree() : nullptr; auto *LIWP = getAnalysisIfAvailable(); diff --git a/lib/CodeGen/TargetPassConfig.cpp b/lib/CodeGen/TargetPassConfig.cpp index 36df02692f8..953d307cf59 100644 --- a/lib/CodeGen/TargetPassConfig.cpp +++ b/lib/CodeGen/TargetPassConfig.cpp @@ -1231,5 +1231,5 @@ bool TargetPassConfig::isGISelCSEEnabled() const { } std::unique_ptr TargetPassConfig::getCSEConfig() const { - return make_unique(); + return std::make_unique(); } diff --git a/lib/DebugInfo/DWARF/DWARFContext.cpp b/lib/DebugInfo/DWARF/DWARFContext.cpp index b18eb9f5989..770f129753e 100644 --- a/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -660,7 +660,7 @@ const DWARFUnitIndex &DWARFContext::getCUIndex() { DataExtractor CUIndexData(DObj->getCUIndexSection(), isLittleEndian(), 0); - CUIndex = llvm::make_unique(DW_SECT_INFO); + CUIndex = std::make_unique(DW_SECT_INFO); CUIndex->parse(CUIndexData); return *CUIndex; } @@ -671,7 +671,7 @@ const DWARFUnitIndex &DWARFContext::getTUIndex() { DataExtractor TUIndexData(DObj->getTUIndexSection(), isLittleEndian(), 0); - TUIndex = llvm::make_unique(DW_SECT_TYPES); + TUIndex = std::make_unique(DW_SECT_TYPES); TUIndex->parse(TUIndexData); return *TUIndex; } @@ -681,7 +681,7 @@ DWARFGdbIndex &DWARFContext::getGdbIndex() { return *GdbIndex; DataExtractor GdbIndexData(DObj->getGdbIndexSection(), true /*LE*/, 0); - GdbIndex = llvm::make_unique(); + GdbIndex = std::make_unique(); GdbIndex->parse(GdbIndexData); return *GdbIndex; } @@ -1803,16 +1803,16 @@ std::unique_ptr DWARFContext::create(const object::ObjectFile &Obj, const LoadedObjectInfo *L, function_ref HandleError, std::string DWPName) { - auto DObj = llvm::make_unique(Obj, L, HandleError); - return llvm::make_unique(std::move(DObj), std::move(DWPName)); + auto DObj = std::make_unique(Obj, L, HandleError); + return std::make_unique(std::move(DObj), std::move(DWPName)); } std::unique_ptr DWARFContext::create(const StringMap> &Sections, uint8_t AddrSize, bool isLittleEndian) { auto DObj = - llvm::make_unique(Sections, AddrSize, isLittleEndian); - return llvm::make_unique(std::move(DObj), ""); + std::make_unique(Sections, AddrSize, isLittleEndian); + return std::make_unique(std::move(DObj), ""); } Error DWARFContext::loadRegisterInfo(const object::ObjectFile &Obj) { diff --git a/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp b/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp index c073a169544..81b00f65741 100644 --- a/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp +++ b/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp @@ -461,7 +461,7 @@ void DWARFDebugFrame::parse(DWARFDataExtractor Data) { } } - auto Cie = llvm::make_unique( + auto Cie = std::make_unique( StartOffset, Length, Version, AugmentationString, AddressSize, SegmentDescriptorSize, CodeAlignmentFactor, DataAlignmentFactor, ReturnAddressRegister, AugmentationData, FDEPointerEncoding, diff --git a/lib/DebugInfo/DWARF/DWARFUnit.cpp b/lib/DebugInfo/DWARF/DWARFUnit.cpp index cc5a8d77ebc..833377e14bb 100644 --- a/lib/DebugInfo/DWARF/DWARFUnit.cpp +++ b/lib/DebugInfo/DWARF/DWARFUnit.cpp @@ -83,11 +83,11 @@ void DWARFUnitVector::addUnitsImpl( return nullptr; std::unique_ptr U; if (Header.isTypeUnit()) - U = llvm::make_unique(Context, InfoSection, Header, DA, + U = std::make_unique(Context, InfoSection, Header, DA, RS, LocSection, SS, SOS, AOS, LS, LE, IsDWO, *this); else - U = llvm::make_unique(Context, InfoSection, Header, + U = std::make_unique(Context, InfoSection, Header, DA, RS, LocSection, SS, SOS, AOS, LS, LE, IsDWO, *this); return U; diff --git a/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp b/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp index 7d0691dc4b2..f29c1e6cc5c 100644 --- a/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp +++ b/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp @@ -54,10 +54,10 @@ bool DWARFUnitIndex::parseImpl(DataExtractor IndexData) { (2 * Header.NumUnits + 1) * 4 * Header.NumColumns)) return false; - Rows = llvm::make_unique(Header.NumBuckets); + Rows = std::make_unique(Header.NumBuckets); auto Contribs = - llvm::make_unique(Header.NumUnits); - ColumnKinds = llvm::make_unique(Header.NumColumns); + std::make_unique(Header.NumUnits); + ColumnKinds = std::make_unique(Header.NumColumns); // Read Hash Table of Signatures for (unsigned i = 0; i != Header.NumBuckets; ++i) @@ -70,7 +70,7 @@ bool DWARFUnitIndex::parseImpl(DataExtractor IndexData) { continue; Rows[i].Index = this; Rows[i].Contributions = - llvm::make_unique(Header.NumColumns); + std::make_unique(Header.NumColumns); Contribs[Index - 1] = Rows[i].Contributions.get(); } diff --git a/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/lib/DebugInfo/DWARF/DWARFVerifier.cpp index 16fbcac4bfc..8ea27402bc4 100644 --- a/lib/DebugInfo/DWARF/DWARFVerifier.cpp +++ b/lib/DebugInfo/DWARF/DWARFVerifier.cpp @@ -294,7 +294,7 @@ unsigned DWARFVerifier::verifyUnitSection(const DWARFSection &S, switch (UnitType) { case dwarf::DW_UT_type: case dwarf::DW_UT_split_type: { - Unit = TypeUnitVector.addUnit(llvm::make_unique( + Unit = TypeUnitVector.addUnit(std::make_unique( DCtx, S, Header, DCtx.getDebugAbbrev(), &DObj.getRangesSection(), &DObj.getLocSection(), DObj.getStrSection(), DObj.getStrOffsetsSection(), &DObj.getAppleObjCSection(), @@ -308,7 +308,7 @@ unsigned DWARFVerifier::verifyUnitSection(const DWARFSection &S, case dwarf::DW_UT_partial: // UnitType = 0 means that we are verifying a compile unit in DWARF v4. case 0: { - Unit = CompileUnitVector.addUnit(llvm::make_unique( + Unit = CompileUnitVector.addUnit(std::make_unique( DCtx, S, Header, DCtx.getDebugAbbrev(), &DObj.getRangesSection(), &DObj.getLocSection(), DObj.getStrSection(), DObj.getStrOffsetsSection(), &DObj.getAppleObjCSection(), diff --git a/lib/DebugInfo/MSF/MappedBlockStream.cpp b/lib/DebugInfo/MSF/MappedBlockStream.cpp index df925771f0d..5dc9c86b34f 100644 --- a/lib/DebugInfo/MSF/MappedBlockStream.cpp +++ b/lib/DebugInfo/MSF/MappedBlockStream.cpp @@ -52,7 +52,7 @@ MappedBlockStream::MappedBlockStream(uint32_t BlockSize, std::unique_ptr MappedBlockStream::createStream( uint32_t BlockSize, const MSFStreamLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator) { - return llvm::make_unique>( + return std::make_unique>( BlockSize, Layout, MsfData, Allocator); } @@ -63,7 +63,7 @@ std::unique_ptr MappedBlockStream::createIndexedStream( MSFStreamLayout SL; SL.Blocks = Layout.StreamMap[StreamIndex]; SL.Length = Layout.StreamSizes[StreamIndex]; - return llvm::make_unique>( + return std::make_unique>( Layout.SB->BlockSize, SL, MsfData, Allocator); } @@ -318,7 +318,7 @@ WritableMappedBlockStream::createStream(uint32_t BlockSize, const MSFStreamLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator) { - return llvm::make_unique>( + return std::make_unique>( BlockSize, Layout, MsfData, Allocator); } diff --git a/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp b/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp index a8ae076e1d6..c2552f55703 100644 --- a/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp +++ b/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp @@ -405,7 +405,7 @@ DIARawSymbol::findChildren(PDB_SymType Type) const { return nullptr; } - return llvm::make_unique(Session, DiaEnumerator); + return std::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -423,7 +423,7 @@ DIARawSymbol::findChildren(PDB_SymType Type, StringRef Name, Symbol->findChildrenEx(EnumVal, Name16Str, CompareFlags, &DiaEnumerator)) return nullptr; - return llvm::make_unique(Session, DiaEnumerator); + return std::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -443,7 +443,7 @@ DIARawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name, Section, Offset, &DiaEnumerator)) return nullptr; - return llvm::make_unique(Session, DiaEnumerator); + return std::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -462,7 +462,7 @@ DIARawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name, &DiaEnumerator)) return nullptr; - return llvm::make_unique(Session, DiaEnumerator); + return std::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -480,7 +480,7 @@ DIARawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name, &DiaEnumerator)) return nullptr; - return llvm::make_unique(Session, DiaEnumerator); + return std::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -489,7 +489,7 @@ DIARawSymbol::findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const { if (S_OK != Symbol->findInlineFramesByAddr(Section, Offset, &DiaEnumerator)) return nullptr; - return llvm::make_unique(Session, DiaEnumerator); + return std::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -498,7 +498,7 @@ DIARawSymbol::findInlineFramesByRVA(uint32_t RVA) const { if (S_OK != Symbol->findInlineFramesByRVA(RVA, &DiaEnumerator)) return nullptr; - return llvm::make_unique(Session, DiaEnumerator); + return std::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -507,7 +507,7 @@ DIARawSymbol::findInlineFramesByVA(uint64_t VA) const { if (S_OK != Symbol->findInlineFramesByVA(VA, &DiaEnumerator)) return nullptr; - return llvm::make_unique(Session, DiaEnumerator); + return std::make_unique(Session, DiaEnumerator); } std::unique_ptr DIARawSymbol::findInlineeLines() const { @@ -515,7 +515,7 @@ std::unique_ptr DIARawSymbol::findInlineeLines() const { if (S_OK != Symbol->findInlineeLines(&DiaEnumerator)) return nullptr; - return llvm::make_unique(DiaEnumerator); + return std::make_unique(DiaEnumerator); } std::unique_ptr @@ -526,7 +526,7 @@ DIARawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset, Symbol->findInlineeLinesByAddr(Section, Offset, Length, &DiaEnumerator)) return nullptr; - return llvm::make_unique(DiaEnumerator); + return std::make_unique(DiaEnumerator); } std::unique_ptr @@ -535,7 +535,7 @@ DIARawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const { if (S_OK != Symbol->findInlineeLinesByRVA(RVA, Length, &DiaEnumerator)) return nullptr; - return llvm::make_unique(DiaEnumerator); + return std::make_unique(DiaEnumerator); } std::unique_ptr @@ -544,7 +544,7 @@ DIARawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const { if (S_OK != Symbol->findInlineeLinesByVA(VA, Length, &DiaEnumerator)) return nullptr; - return llvm::make_unique(DiaEnumerator); + return std::make_unique(DiaEnumerator); } void DIARawSymbol::getDataBytes(llvm::SmallVector &bytes) const { @@ -776,7 +776,7 @@ std::unique_ptr DIARawSymbol::getSrcLineOnTypeDefn() const { if (FAILED(Symbol->getSrcLineOnTypeDefn(&LineNumber)) || !LineNumber) return nullptr; - return llvm::make_unique(LineNumber); + return std::make_unique(LineNumber); } uint32_t DIARawSymbol::getStride() const { @@ -871,7 +871,7 @@ DIARawSymbol::getVirtualBaseTableType() const { if (FAILED(Symbol->get_virtualBaseTableType(&TableType)) || !TableType) return nullptr; - auto RawVT = llvm::make_unique(Session, TableType); + auto RawVT = std::make_unique(Session, TableType); auto Pointer = PDBSymbol::createAs(Session, std::move(RawVT)); return unique_dyn_cast(Pointer->getPointeeType()); diff --git a/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp b/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp index e2d928f2c4b..4f0e078e671 100644 --- a/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp +++ b/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp @@ -23,7 +23,7 @@ std::unique_ptr DIASectionContrib::getCompiland() const { if (FAILED(Section->get_compiland(&Symbol))) return nullptr; - auto RawSymbol = llvm::make_unique(Session, Symbol); + auto RawSymbol = std::make_unique(Session, Symbol); return PDBSymbol::createAs(Session, std::move(RawSymbol)); } diff --git a/lib/DebugInfo/PDB/DIA/DIASession.cpp b/lib/DebugInfo/PDB/DIA/DIASession.cpp index 2544a889056..64ffa776bbd 100644 --- a/lib/DebugInfo/PDB/DIA/DIASession.cpp +++ b/lib/DebugInfo/PDB/DIA/DIASession.cpp @@ -150,7 +150,7 @@ std::unique_ptr DIASession::getGlobalScope() { if (S_OK != Session->get_globalScope(&GlobalScope)) return nullptr; - auto RawSymbol = llvm::make_unique(*this, GlobalScope); + auto RawSymbol = std::make_unique(*this, GlobalScope); auto PdbSymbol(PDBSymbol::create(*this, std::move(RawSymbol))); std::unique_ptr ExeSymbol( static_cast(PdbSymbol.release())); @@ -185,7 +185,7 @@ DIASession::getSymbolById(SymIndexId SymbolId) const { if (S_OK != Session->symbolById(SymbolId, &LocatedSymbol)) return nullptr; - auto RawSymbol = llvm::make_unique(*this, LocatedSymbol); + auto RawSymbol = std::make_unique(*this, LocatedSymbol); return PDBSymbol::create(*this, std::move(RawSymbol)); } @@ -202,7 +202,7 @@ DIASession::findSymbolByAddress(uint64_t Address, PDB_SymType Type) const { if (S_OK != Session->findSymbolByRVA(RVA, EnumVal, &Symbol)) return nullptr; } - auto RawSymbol = llvm::make_unique(*this, Symbol); + auto RawSymbol = std::make_unique(*this, Symbol); return PDBSymbol::create(*this, std::move(RawSymbol)); } @@ -214,7 +214,7 @@ std::unique_ptr DIASession::findSymbolByRVA(uint32_t RVA, if (S_OK != Session->findSymbolByRVA(RVA, EnumVal, &Symbol)) return nullptr; - auto RawSymbol = llvm::make_unique(*this, Symbol); + auto RawSymbol = std::make_unique(*this, Symbol); return PDBSymbol::create(*this, std::move(RawSymbol)); } @@ -227,7 +227,7 @@ DIASession::findSymbolBySectOffset(uint32_t Sect, uint32_t Offset, if (S_OK != Session->findSymbolByAddr(Sect, Offset, EnumVal, &Symbol)) return nullptr; - auto RawSymbol = llvm::make_unique(*this, Symbol); + auto RawSymbol = std::make_unique(*this, Symbol); return PDBSymbol::create(*this, std::move(RawSymbol)); } @@ -243,7 +243,7 @@ DIASession::findLineNumbers(const PDBSymbolCompiland &Compiland, RawFile.getDiaFile(), &LineNumbers)) return nullptr; - return llvm::make_unique(LineNumbers); + return std::make_unique(LineNumbers); } std::unique_ptr @@ -257,7 +257,7 @@ DIASession::findLineNumbersByAddress(uint64_t Address, uint32_t Length) const { if (S_OK != Session->findLinesByRVA(RVA, Length, &LineNumbers)) return nullptr; } - return llvm::make_unique(LineNumbers); + return std::make_unique(LineNumbers); } std::unique_ptr @@ -266,7 +266,7 @@ DIASession::findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const { if (S_OK != Session->findLinesByRVA(RVA, Length, &LineNumbers)) return nullptr; - return llvm::make_unique(LineNumbers); + return std::make_unique(LineNumbers); } std::unique_ptr @@ -276,7 +276,7 @@ DIASession::findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset, if (S_OK != Session->findLinesByAddr(Section, Offset, Length, &LineNumbers)) return nullptr; - return llvm::make_unique(LineNumbers); + return std::make_unique(LineNumbers); } std::unique_ptr @@ -298,7 +298,7 @@ DIASession::findSourceFiles(const PDBSymbolCompiland *Compiland, if (S_OK != Session->findFile(DiaCompiland, Utf16Pattern.m_str, Flags, &SourceFiles)) return nullptr; - return llvm::make_unique(*this, SourceFiles); + return std::make_unique(*this, SourceFiles); } std::unique_ptr @@ -334,7 +334,7 @@ std::unique_ptr DIASession::getAllSourceFiles() const { if (S_OK != Session->findFile(nullptr, nullptr, nsNone, &Files)) return nullptr; - return llvm::make_unique(*this, Files); + return std::make_unique(*this, Files); } std::unique_ptr DIASession::getSourceFilesForCompiland( @@ -347,7 +347,7 @@ std::unique_ptr DIASession::getSourceFilesForCompiland( Session->findFile(RawSymbol.getDiaSymbol(), nullptr, nsNone, &Files)) return nullptr; - return llvm::make_unique(*this, Files); + return std::make_unique(*this, Files); } std::unique_ptr @@ -356,7 +356,7 @@ DIASession::getSourceFileById(uint32_t FileId) const { if (S_OK != Session->findFileById(FileId, &LocatedFile)) return nullptr; - return llvm::make_unique(*this, LocatedFile); + return std::make_unique(*this, LocatedFile); } std::unique_ptr DIASession::getDebugStreams() const { @@ -364,7 +364,7 @@ std::unique_ptr DIASession::getDebugStreams() const { if (S_OK != Session->getEnumDebugStreams(&DiaEnumerator)) return nullptr; - return llvm::make_unique(DiaEnumerator); + return std::make_unique(DiaEnumerator); } std::unique_ptr DIASession::getEnumTables() const { @@ -372,7 +372,7 @@ std::unique_ptr DIASession::getEnumTables() const { if (S_OK != Session->getEnumTables(&DiaEnumerator)) return nullptr; - return llvm::make_unique(DiaEnumerator); + return std::make_unique(DiaEnumerator); } template static CComPtr getTableEnumerator(IDiaSession &Session) { @@ -399,7 +399,7 @@ DIASession::getInjectedSources() const { if (!Files) return nullptr; - return llvm::make_unique(Files); + return std::make_unique(Files); } std::unique_ptr @@ -409,7 +409,7 @@ DIASession::getSectionContribs() const { if (!Sections) return nullptr; - return llvm::make_unique(*this, Sections); + return std::make_unique(*this, Sections); } std::unique_ptr @@ -419,5 +419,5 @@ DIASession::getFrameData() const { if (!FD) return nullptr; - return llvm::make_unique(FD); + return std::make_unique(FD); } diff --git a/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp b/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp index 20b6c614254..419734771cc 100644 --- a/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp +++ b/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp @@ -180,12 +180,12 @@ Error DbiModuleDescriptorBuilder::commit(BinaryStreamWriter &ModiWriter, void DbiModuleDescriptorBuilder::addDebugSubsection( std::shared_ptr Subsection) { assert(Subsection); - C13Builders.push_back(llvm::make_unique( + C13Builders.push_back(std::make_unique( std::move(Subsection), CodeViewContainer::Pdb)); } void DbiModuleDescriptorBuilder::addDebugSubsection( const DebugSubsectionRecord &SubsectionContents) { - C13Builders.push_back(llvm::make_unique( + C13Builders.push_back(std::make_unique( SubsectionContents, CodeViewContainer::Pdb)); } diff --git a/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp b/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp index b7ade0072ee..0e00c2f7ff9 100644 --- a/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp +++ b/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp @@ -114,7 +114,7 @@ Expected DbiStreamBuilder::addModuleInfo(StringRef ModuleName) { uint32_t Index = ModiList.size(); ModiList.push_back( - llvm::make_unique(ModuleName, Index, Msf)); + std::make_unique(ModuleName, Index, Msf)); return *ModiList.back(); } diff --git a/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp b/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp index 8ed5b8b44c5..432f1e9b24d 100644 --- a/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp +++ b/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp @@ -183,8 +183,8 @@ void GSIHashStreamBuilder::finalizeBuckets(uint32_t RecordZeroOffset) { } GSIStreamBuilder::GSIStreamBuilder(msf::MSFBuilder &Msf) - : Msf(Msf), PSH(llvm::make_unique()), - GSH(llvm::make_unique()) {} + : Msf(Msf), PSH(std::make_unique()), + GSH(std::make_unique()) {} GSIStreamBuilder::~GSIStreamBuilder() {} diff --git a/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp b/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp index f17ff5bb01f..065bb2c401e 100644 --- a/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp +++ b/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp @@ -104,14 +104,14 @@ std::unique_ptr NativeEnumInjectedSources::getChildAtIndex(uint32_t N) const { if (N >= getChildCount()) return nullptr; - return make_unique(std::next(Stream.begin(), N)->second, + return std::make_unique(std::next(Stream.begin(), N)->second, File, Strings); } std::unique_ptr NativeEnumInjectedSources::getNext() { if (Cur == Stream.end()) return nullptr; - return make_unique((Cur++)->second, File, Strings); + return std::make_unique((Cur++)->second, File, Strings); } void NativeEnumInjectedSources::reset() { Cur = Stream.begin(); } diff --git a/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp b/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp index 8e43cf24495..2ad552470b6 100644 --- a/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp +++ b/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp @@ -30,68 +30,68 @@ void NativeRawSymbol::dump(raw_ostream &OS, int Indent, std::unique_ptr NativeRawSymbol::findChildren(PDB_SymType Type) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint32_t Section, uint32_t Offset) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint64_t VA) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint32_t RVA) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findInlineFramesByVA(uint64_t VA) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findInlineeLines() const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset, uint32_t Length) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const { - return llvm::make_unique>(); + return std::make_unique>(); } std::unique_ptr NativeRawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const { - return llvm::make_unique>(); + return std::make_unique>(); } void NativeRawSymbol::getDataBytes(SmallVector &bytes) const { diff --git a/lib/DebugInfo/PDB/Native/NativeSession.cpp b/lib/DebugInfo/PDB/Native/NativeSession.cpp index 8a49cb1c596..b45a5881dcb 100644 --- a/lib/DebugInfo/PDB/Native/NativeSession.cpp +++ b/lib/DebugInfo/PDB/Native/NativeSession.cpp @@ -59,18 +59,18 @@ NativeSession::~NativeSession() = default; Error NativeSession::createFromPdb(std::unique_ptr Buffer, std::unique_ptr &Session) { StringRef Path = Buffer->getBufferIdentifier(); - auto Stream = llvm::make_unique( + auto Stream = std::make_unique( std::move(Buffer), llvm::support::little); - auto Allocator = llvm::make_unique(); - auto File = llvm::make_unique(Path, std::move(Stream), *Allocator); + auto Allocator = std::make_unique(); + auto File = std::make_unique(Path, std::move(Stream), *Allocator); if (auto EC = File->parseFileHeaders()) return EC; if (auto EC = File->parseStreamData()) return EC; Session = - llvm::make_unique(std::move(File), std::move(Allocator)); + std::make_unique(std::move(File), std::move(Allocator)); return Error::success(); } @@ -202,7 +202,7 @@ NativeSession::getInjectedSources() const { consumeError(Strings.takeError()); return nullptr; } - return make_unique(*Pdb, *ISS, *Strings); + return std::make_unique(*Pdb, *ISS, *Strings); } std::unique_ptr diff --git a/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp b/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp index 9f5e86281a2..26ccb7daece 100644 --- a/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp +++ b/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp @@ -163,14 +163,14 @@ void NativeTypeEnum::dump(raw_ostream &OS, int Indent, std::unique_ptr NativeTypeEnum::findChildren(PDB_SymType Type) const { if (Type != PDB_SymType::Data) - return llvm::make_unique>(); + return std::make_unique>(); const NativeTypeEnum *ClassParent = nullptr; if (!Modifiers) ClassParent = this; else ClassParent = UnmodifiedType; - return llvm::make_unique(Session, *ClassParent); + return std::make_unique(Session, *ClassParent); } PDB_SymType NativeTypeEnum::getSymTag() const { return PDB_SymType::Enum; } diff --git a/lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp b/lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp index 405303469c1..f98a4c3043e 100644 --- a/lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp +++ b/lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp @@ -65,7 +65,7 @@ private: std::unique_ptr wrap(std::unique_ptr S) const { if (!S) return nullptr; - auto NTFA = llvm::make_unique(Session, std::move(S)); + auto NTFA = std::make_unique(Session, std::move(S)); return PDBSymbol::create(Session, std::move(NTFA)); } NativeSession &Session; @@ -133,9 +133,9 @@ void NativeTypeFunctionSig::dump(raw_ostream &OS, int Indent, std::unique_ptr NativeTypeFunctionSig::findChildren(PDB_SymType Type) const { if (Type != PDB_SymType::FunctionArg) - return llvm::make_unique>(); + return std::make_unique>(); - auto NET = llvm::make_unique(Session, + auto NET = std::make_unique(Session, /* copy */ ArgList.ArgIndices); return std::unique_ptr( new NativeEnumFunctionArgs(Session, std::move(NET))); diff --git a/lib/DebugInfo/PDB/Native/PDBFile.cpp b/lib/DebugInfo/PDB/Native/PDBFile.cpp index 983031dfcb7..9ac226b8913 100644 --- a/lib/DebugInfo/PDB/Native/PDBFile.cpp +++ b/lib/DebugInfo/PDB/Native/PDBFile.cpp @@ -264,7 +264,7 @@ Expected PDBFile::getPDBGlobalsStream() { safelyCreateIndexedStream(DbiS->getGlobalSymbolStreamIndex()); if (!GlobalS) return GlobalS.takeError(); - auto TempGlobals = llvm::make_unique(std::move(*GlobalS)); + auto TempGlobals = std::make_unique(std::move(*GlobalS)); if (auto EC = TempGlobals->reload()) return std::move(EC); Globals = std::move(TempGlobals); @@ -277,7 +277,7 @@ Expected PDBFile::getPDBInfoStream() { auto InfoS = safelyCreateIndexedStream(StreamPDB); if (!InfoS) return InfoS.takeError(); - auto TempInfo = llvm::make_unique(std::move(*InfoS)); + auto TempInfo = std::make_unique(std::move(*InfoS)); if (auto EC = TempInfo->reload()) return std::move(EC); Info = std::move(TempInfo); @@ -290,7 +290,7 @@ Expected PDBFile::getPDBDbiStream() { auto DbiS = safelyCreateIndexedStream(StreamDBI); if (!DbiS) return DbiS.takeError(); - auto TempDbi = llvm::make_unique(std::move(*DbiS)); + auto TempDbi = std::make_unique(std::move(*DbiS)); if (auto EC = TempDbi->reload(this)) return std::move(EC); Dbi = std::move(TempDbi); @@ -303,7 +303,7 @@ Expected PDBFile::getPDBTpiStream() { auto TpiS = safelyCreateIndexedStream(StreamTPI); if (!TpiS) return TpiS.takeError(); - auto TempTpi = llvm::make_unique(*this, std::move(*TpiS)); + auto TempTpi = std::make_unique(*this, std::move(*TpiS)); if (auto EC = TempTpi->reload()) return std::move(EC); Tpi = std::move(TempTpi); @@ -319,7 +319,7 @@ Expected PDBFile::getPDBIpiStream() { auto IpiS = safelyCreateIndexedStream(StreamIPI); if (!IpiS) return IpiS.takeError(); - auto TempIpi = llvm::make_unique(*this, std::move(*IpiS)); + auto TempIpi = std::make_unique(*this, std::move(*IpiS)); if (auto EC = TempIpi->reload()) return std::move(EC); Ipi = std::move(TempIpi); @@ -337,7 +337,7 @@ Expected PDBFile::getPDBPublicsStream() { safelyCreateIndexedStream(DbiS->getPublicSymbolStreamIndex()); if (!PublicS) return PublicS.takeError(); - auto TempPublics = llvm::make_unique(std::move(*PublicS)); + auto TempPublics = std::make_unique(std::move(*PublicS)); if (auto EC = TempPublics->reload()) return std::move(EC); Publics = std::move(TempPublics); @@ -356,7 +356,7 @@ Expected PDBFile::getPDBSymbolStream() { if (!SymbolS) return SymbolS.takeError(); - auto TempSymbols = llvm::make_unique(std::move(*SymbolS)); + auto TempSymbols = std::make_unique(std::move(*SymbolS)); if (auto EC = TempSymbols->reload()) return std::move(EC); Symbols = std::move(TempSymbols); @@ -370,7 +370,7 @@ Expected PDBFile::getStringTable() { if (!NS) return NS.takeError(); - auto N = llvm::make_unique(); + auto N = std::make_unique(); BinaryStreamReader Reader(**NS); if (auto EC = N->reload(Reader)) return std::move(EC); @@ -391,7 +391,7 @@ Expected PDBFile::getInjectedSourceStream() { if (!Strings) return Strings.takeError(); - auto IJ = llvm::make_unique(std::move(*IJS)); + auto IJ = std::make_unique(std::move(*IJS)); if (auto EC = IJ->reload(*Strings)) return std::move(EC); InjectedSources = std::move(IJ); diff --git a/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp index 8f5a048ea4b..abeb7ae99c9 100644 --- a/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp +++ b/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp @@ -42,7 +42,7 @@ Error PDBFileBuilder::initialize(uint32_t BlockSize) { auto ExpectedMsf = MSFBuilder::create(Allocator, BlockSize); if (!ExpectedMsf) return ExpectedMsf.takeError(); - Msf = llvm::make_unique(std::move(*ExpectedMsf)); + Msf = std::make_unique(std::move(*ExpectedMsf)); return Error::success(); } @@ -50,25 +50,25 @@ MSFBuilder &PDBFileBuilder::getMsfBuilder() { return *Msf; } InfoStreamBuilder &PDBFileBuilder::getInfoBuilder() { if (!Info) - Info = llvm::make_unique(*Msf, NamedStreams); + Info = std::make_unique(*Msf, NamedStreams); return *Info; } DbiStreamBuilder &PDBFileBuilder::getDbiBuilder() { if (!Dbi) - Dbi = llvm::make_unique(*Msf); + Dbi = std::make_unique(*Msf); return *Dbi; } TpiStreamBuilder &PDBFileBuilder::getTpiBuilder() { if (!Tpi) - Tpi = llvm::make_unique(*Msf, StreamTPI); + Tpi = std::make_unique(*Msf, StreamTPI); return *Tpi; } TpiStreamBuilder &PDBFileBuilder::getIpiBuilder() { if (!Ipi) - Ipi = llvm::make_unique(*Msf, StreamIPI); + Ipi = std::make_unique(*Msf, StreamIPI); return *Ipi; } @@ -78,7 +78,7 @@ PDBStringTableBuilder &PDBFileBuilder::getStringTableBuilder() { GSIStreamBuilder &PDBFileBuilder::getGsiBuilder() { if (!Gsi) - Gsi = llvm::make_unique(*Msf); + Gsi = std::make_unique(*Msf); return *Gsi; } diff --git a/lib/DebugInfo/PDB/Native/TpiStream.cpp b/lib/DebugInfo/PDB/Native/TpiStream.cpp index 8ee7f897b8b..ac19db03fab 100644 --- a/lib/DebugInfo/PDB/Native/TpiStream.cpp +++ b/lib/DebugInfo/PDB/Native/TpiStream.cpp @@ -112,7 +112,7 @@ Error TpiStream::reload() { HashStream = std::move(*HS); } - Types = llvm::make_unique( + Types = std::make_unique( TypeRecords, getNumTypeRecords(), getTypeIndexOffsets()); return Error::success(); } diff --git a/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp b/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp index 6b308453c2d..4f10f8524a9 100644 --- a/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp +++ b/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp @@ -135,7 +135,7 @@ Error TpiStreamBuilder::finalizeMsfLayout() { reinterpret_cast(HashBuffer.data()), calculateHashBufferSize()); HashValueStream = - llvm::make_unique(Bytes, llvm::support::little); + std::make_unique(Bytes, llvm::support::little); } return Error::success(); } diff --git a/lib/DebugInfo/PDB/PDBSymbolFunc.cpp b/lib/DebugInfo/PDB/PDBSymbolFunc.cpp index 7c3ba981fd6..cb0329bc0ed 100644 --- a/lib/DebugInfo/PDB/PDBSymbolFunc.cpp +++ b/lib/DebugInfo/PDB/PDBSymbolFunc.cpp @@ -79,7 +79,7 @@ private: std::unique_ptr> PDBSymbolFunc::getArguments() const { - return llvm::make_unique(Session, *this); + return std::make_unique(Session, *this); } void PDBSymbolFunc::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); } diff --git a/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp b/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp index 292320a6fe6..1373615522e 100644 --- a/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp +++ b/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp @@ -63,7 +63,7 @@ private: std::unique_ptr PDBSymbolTypeFunctionSig::getArguments() const { - return llvm::make_unique(Session, *this); + return std::make_unique(Session, *this); } void PDBSymbolTypeFunctionSig::dump(PDBSymDumper &Dumper) const { diff --git a/lib/DebugInfo/PDB/UDTLayout.cpp b/lib/DebugInfo/PDB/UDTLayout.cpp index acb1599480b..d8bc3dc06e6 100644 --- a/lib/DebugInfo/PDB/UDTLayout.cpp +++ b/lib/DebugInfo/PDB/UDTLayout.cpp @@ -71,7 +71,7 @@ DataMemberLayoutItem::DataMemberLayoutItem( DataMember(std::move(Member)) { auto Type = DataMember->getType(); if (auto UDT = unique_dyn_cast(Type)) { - UdtLayout = llvm::make_unique(std::move(UDT)); + UdtLayout = std::make_unique(std::move(UDT)); UsedBytes = UdtLayout->usedBytes(); } } @@ -205,7 +205,7 @@ void UDTLayoutBase::initializeChildren(const PDBSymbol &Sym) { for (auto &Base : Bases) { uint32_t Offset = Base->getOffset(); // Non-virtual bases never get elided. - auto BL = llvm::make_unique(*this, Offset, false, + auto BL = std::make_unique(*this, Offset, false, std::move(Base)); AllBases.push_back(BL.get()); @@ -216,7 +216,7 @@ void UDTLayoutBase::initializeChildren(const PDBSymbol &Sym) { assert(VTables.size() <= 1); if (!VTables.empty()) { auto VTLayout = - llvm::make_unique(*this, std::move(VTables[0])); + std::make_unique(*this, std::move(VTables[0])); VTable = VTLayout.get(); @@ -224,7 +224,7 @@ void UDTLayoutBase::initializeChildren(const PDBSymbol &Sym) { } for (auto &Data : Members) { - auto DM = llvm::make_unique(*this, std::move(Data)); + auto DM = std::make_unique(*this, std::move(Data)); addChildToLayout(std::move(DM)); } @@ -236,7 +236,7 @@ void UDTLayoutBase::initializeChildren(const PDBSymbol &Sym) { int VBPO = VB->getVirtualBasePointerOffset(); if (!hasVBPtrAtOffset(VBPO)) { if (auto VBP = VB->getRawSymbol().getVirtualBaseTableType()) { - auto VBPL = llvm::make_unique(*this, std::move(VBP), + auto VBPL = std::make_unique(*this, std::move(VBP), VBPO, VBP->getLength()); VBPtr = VBPL.get(); addChildToLayout(std::move(VBPL)); @@ -250,7 +250,7 @@ void UDTLayoutBase::initializeChildren(const PDBSymbol &Sym) { uint32_t Offset = UsedBytes.find_last() + 1; bool Elide = (Parent != nullptr); auto BL = - llvm::make_unique(*this, Offset, Elide, std::move(VB)); + std::make_unique(*this, Offset, Elide, std::move(VB)); AllBases.push_back(BL.get()); // Only lay this virtual base out directly inside of *this* class if this diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 75ac80f4b75..a425c612108 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -340,14 +340,14 @@ void *ArgvArray::reset(LLVMContext &C, ExecutionEngine *EE, Values.clear(); // Free the old contents. Values.reserve(InputArgv.size()); unsigned PtrSize = EE->getDataLayout().getPointerSize(); - Array = make_unique((InputArgv.size()+1)*PtrSize); + Array = std::make_unique((InputArgv.size()+1)*PtrSize); LLVM_DEBUG(dbgs() << "JIT: ARGV = " << (void *)Array.get() << "\n"); Type *SBytePtr = Type::getInt8PtrTy(C); for (unsigned i = 0; i != InputArgv.size(); ++i) { unsigned Size = InputArgv[i].size()+1; - auto Dest = make_unique(Size); + auto Dest = std::make_unique(Size); LLVM_DEBUG(dbgs() << "JIT: ARGV[" << i << "] = " << (void *)Dest.get() << "\n"); diff --git a/lib/ExecutionEngine/JITLink/JITLinkGeneric.h b/lib/ExecutionEngine/JITLink/JITLinkGeneric.h index e6fd6e38f7a..eeb2527bd1b 100644 --- a/lib/ExecutionEngine/JITLink/JITLinkGeneric.h +++ b/lib/ExecutionEngine/JITLink/JITLinkGeneric.h @@ -121,7 +121,7 @@ public: /// Link should be called with the constructor arguments for LinkerImpl, which /// will be forwarded to the constructor. template static void link(ArgTs &&... Args) { - auto L = llvm::make_unique(std::forward(Args)...); + auto L = std::make_unique(std::forward(Args)...); // Ownership of the linker is passed into the linker's doLink function to // allow it to be passed on to async continuations. diff --git a/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp b/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp index 92c7e49039a..c1040c942b2 100644 --- a/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp +++ b/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp @@ -34,7 +34,7 @@ Expected> MachOAtomGraphBuilder::buildGraph() { MachOAtomGraphBuilder::MachOAtomGraphBuilder(const object::MachOObjectFile &Obj) : Obj(Obj), - G(llvm::make_unique(Obj.getFileName(), getPointerSize(Obj), + G(std::make_unique(Obj.getFileName(), getPointerSize(Obj), getEndianness(Obj))) {} void MachOAtomGraphBuilder::addCustomAtomizer(StringRef SectionName, diff --git a/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp b/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp index 2ad9d24555f..bb5d96051da 100644 --- a/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp +++ b/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp @@ -177,7 +177,7 @@ void OProfileJITEventListener::notifyFreeingObject(ObjectKey Key) { namespace llvm { JITEventListener *JITEventListener::createOProfileJITEventListener() { - return new OProfileJITEventListener(llvm::make_unique()); + return new OProfileJITEventListener(std::make_unique()); } } // namespace llvm diff --git a/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp b/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp index a91dd4e796e..75ddbc30445 100644 --- a/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp +++ b/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp @@ -155,7 +155,7 @@ void CompileOnDemandLayer::emit(MaterializationResponsibility R, // Create a partitioning materialization unit and lodge it with the // implementation dylib. if (auto Err = PDR.getImplDylib().define( - llvm::make_unique( + std::make_unique( ES, std::move(TSM), R.getVModuleKey(), *this))) { ES.reportError(std::move(Err)); R.failMaterialization(); @@ -267,7 +267,7 @@ void CompileOnDemandLayer::emitPartition( // If the partition is empty, return the whole module to the symbol table. if (GVsToExtract->empty()) { - R.replace(llvm::make_unique( + R.replace(std::make_unique( std::move(TSM), R.getSymbols(), std::move(Defs), *this)); return; } @@ -310,7 +310,7 @@ void CompileOnDemandLayer::emitPartition( return; } - R.replace(llvm::make_unique( + R.replace(std::make_unique( ES, std::move(TSM), R.getVModuleKey(), *this)); BaseLayer.emit(std::move(R), std::move(*ExtractedTSM)); } diff --git a/lib/ExecutionEngine/Orc/CompileUtils.cpp b/lib/ExecutionEngine/Orc/CompileUtils.cpp index d46b6fcf9a5..f8251627a4e 100644 --- a/lib/ExecutionEngine/Orc/CompileUtils.cpp +++ b/lib/ExecutionEngine/Orc/CompileUtils.cpp @@ -42,7 +42,7 @@ SimpleCompiler::CompileResult SimpleCompiler::operator()(Module &M) { PM.run(M); } - auto ObjBuffer = llvm::make_unique( + auto ObjBuffer = std::make_unique( std::move(ObjBufferSV), ""); diff --git a/lib/ExecutionEngine/Orc/ExecutionUtils.cpp b/lib/ExecutionEngine/Orc/ExecutionUtils.cpp index 044e7eede08..990fc1342d5 100644 --- a/lib/ExecutionEngine/Orc/ExecutionUtils.cpp +++ b/lib/ExecutionEngine/Orc/ExecutionUtils.cpp @@ -186,7 +186,7 @@ DynamicLibrarySearchGenerator::Load(const char *FileName, char GlobalPrefix, auto Lib = sys::DynamicLibrary::getPermanentLibrary(FileName, &ErrMsg); if (!Lib.isValid()) return make_error(std::move(ErrMsg), inconvertibleErrorCode()); - return llvm::make_unique( + return std::make_unique( std::move(Lib), GlobalPrefix, std::move(Allow)); } diff --git a/lib/ExecutionEngine/Orc/IndirectionUtils.cpp b/lib/ExecutionEngine/Orc/IndirectionUtils.cpp index cc3656fe5dc..382a6a2951c 100644 --- a/lib/ExecutionEngine/Orc/IndirectionUtils.cpp +++ b/lib/ExecutionEngine/Orc/IndirectionUtils.cpp @@ -66,7 +66,7 @@ JITCompileCallbackManager::getCompileCallback(CompileFunction Compile) { std::lock_guard Lock(CCMgrMutex); AddrToSymbol[*TrampolineAddr] = CallbackName; cantFail(CallbacksJD.define( - llvm::make_unique( + std::make_unique( std::move(CallbackName), std::move(Compile), ES.allocateVModule()))); return *TrampolineAddr; @@ -162,50 +162,50 @@ createLocalIndirectStubsManagerBuilder(const Triple &T) { switch (T.getArch()) { default: return [](){ - return llvm::make_unique< + return std::make_unique< orc::LocalIndirectStubsManager>(); }; case Triple::aarch64: return [](){ - return llvm::make_unique< + return std::make_unique< orc::LocalIndirectStubsManager>(); }; case Triple::x86: return [](){ - return llvm::make_unique< + return std::make_unique< orc::LocalIndirectStubsManager>(); }; case Triple::mips: return [](){ - return llvm::make_unique< + return std::make_unique< orc::LocalIndirectStubsManager>(); }; case Triple::mipsel: return [](){ - return llvm::make_unique< + return std::make_unique< orc::LocalIndirectStubsManager>(); }; case Triple::mips64: case Triple::mips64el: return [](){ - return llvm::make_unique< + return std::make_unique< orc::LocalIndirectStubsManager>(); }; case Triple::x86_64: if (T.getOS() == Triple::OSType::Win32) { return [](){ - return llvm::make_unique< + return std::make_unique< orc::LocalIndirectStubsManager>(); }; } else { return [](){ - return llvm::make_unique< + return std::make_unique< orc::LocalIndirectStubsManager>(); }; } diff --git a/lib/ExecutionEngine/Orc/LLJIT.cpp b/lib/ExecutionEngine/Orc/LLJIT.cpp index 05ebb746985..a80f78afe80 100644 --- a/lib/ExecutionEngine/Orc/LLJIT.cpp +++ b/lib/ExecutionEngine/Orc/LLJIT.cpp @@ -68,9 +68,9 @@ LLJIT::createObjectLinkingLayer(LLJITBuilderState &S, ExecutionSession &ES) { // Otherwise default to creating an RTDyldObjectLinkingLayer that constructs // a new SectionMemoryManager for each object. - auto GetMemMgr = []() { return llvm::make_unique(); }; + auto GetMemMgr = []() { return std::make_unique(); }; auto ObjLinkingLayer = - llvm::make_unique(ES, std::move(GetMemMgr)); + std::make_unique(ES, std::move(GetMemMgr)); if (S.JTMB->getTargetTriple().isOSBinFormatCOFF()) ObjLinkingLayer->setOverrideObjectFlagsWithResponsibilityFlags(true); @@ -102,7 +102,7 @@ LLJIT::createCompileFunction(LLJITBuilderState &S, } LLJIT::LLJIT(LLJITBuilderState &S, Error &Err) - : ES(S.ES ? std::move(S.ES) : llvm::make_unique()), + : ES(S.ES ? std::move(S.ES) : std::make_unique()), Main(this->ES->getMainJITDylib()), DL(""), CtorRunner(Main), DtorRunner(Main) { @@ -123,13 +123,13 @@ LLJIT::LLJIT(LLJITBuilderState &S, Error &Err) Err = CompileFunction.takeError(); return; } - CompileLayer = llvm::make_unique( + CompileLayer = std::make_unique( *ES, *ObjLinkingLayer, std::move(*CompileFunction)); } if (S.NumCompileThreads > 0) { CompileLayer->setCloneToNewContextOnEmit(true); - CompileThreads = llvm::make_unique(S.NumCompileThreads); + CompileThreads = std::make_unique(S.NumCompileThreads); ES->setDispatchMaterialization( [this](JITDylib &JD, std::unique_ptr MU) { // FIXME: Switch to move capture once we have c++14. @@ -226,10 +226,10 @@ LLLazyJIT::LLLazyJIT(LLLazyJITBuilderState &S, Error &Err) : LLJIT(S, Err) { } // Create the transform layer. - TransformLayer = llvm::make_unique(*ES, *CompileLayer); + TransformLayer = std::make_unique(*ES, *CompileLayer); // Create the COD layer. - CODLayer = llvm::make_unique( + CODLayer = std::make_unique( *ES, *TransformLayer, *LCTMgr, std::move(ISMBuilder)); if (S.NumCompileThreads > 0) diff --git a/lib/ExecutionEngine/Orc/Layer.cpp b/lib/ExecutionEngine/Orc/Layer.cpp index 2126ecb0733..ba2ec32da78 100644 --- a/lib/ExecutionEngine/Orc/Layer.cpp +++ b/lib/ExecutionEngine/Orc/Layer.cpp @@ -19,7 +19,7 @@ IRLayer::IRLayer(ExecutionSession &ES) : ES(ES) {} IRLayer::~IRLayer() {} Error IRLayer::add(JITDylib &JD, ThreadSafeModule TSM, VModuleKey K) { - return JD.define(llvm::make_unique( + return JD.define(std::make_unique( *this, std::move(K), std::move(TSM))); } diff --git a/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp b/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp index def0b300eca..ff9b55dbbcb 100644 --- a/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp +++ b/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp @@ -330,7 +330,7 @@ ObjectLinkingLayer::~ObjectLinkingLayer() { void ObjectLinkingLayer::emit(MaterializationResponsibility R, std::unique_ptr O) { assert(O && "Object must not be null"); - jitLink(llvm::make_unique( + jitLink(std::make_unique( *this, std::move(R), std::move(O))); } diff --git a/lib/ExecutionEngine/Orc/OrcCBindingsStack.h b/lib/ExecutionEngine/Orc/OrcCBindingsStack.h index 21b65bdd66d..e0af3df9d01 100644 --- a/lib/ExecutionEngine/Orc/OrcCBindingsStack.h +++ b/lib/ExecutionEngine/Orc/OrcCBindingsStack.h @@ -97,7 +97,7 @@ public: template std::unique_ptr> createGenericLayer(LayerT &Layer) { - return llvm::make_unique>(Layer); + return std::make_unique>(Layer); } } // end namespace detail @@ -327,7 +327,7 @@ public: LLVMOrcSymbolResolverFn ExternalResolver, void *ExternalResolverCtx) { return addIRModule(CompileLayer, std::move(M), - llvm::make_unique(), + std::make_unique(), std::move(ExternalResolver), ExternalResolverCtx); } @@ -341,7 +341,7 @@ public: inconvertibleErrorCode()); return addIRModule(*CODLayer, std::move(M), - llvm::make_unique(), + std::make_unique(), std::move(ExternalResolver), ExternalResolverCtx); } @@ -469,7 +469,7 @@ private: if (!CCMgr) return nullptr; - return llvm::make_unique( + return std::make_unique( AcknowledgeORCv1Deprecation, ES, CompileLayer, [&Resolvers](orc::VModuleKey K) { auto ResolverI = Resolvers.find(K); diff --git a/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp b/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp index 14419b6ca18..1f4e6f13211 100644 --- a/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp +++ b/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp @@ -51,7 +51,7 @@ ThreadSafeModule cloneToNewContext(ThreadSafeModule &TSM, MemoryBufferRef ClonedModuleBufferRef( StringRef(ClonedModuleBuffer.data(), ClonedModuleBuffer.size()), "cloned module buffer"); - ThreadSafeContext NewTSCtx(llvm::make_unique()); + ThreadSafeContext NewTSCtx(std::make_unique()); auto ClonedModule = cantFail( parseBitcodeFile(ClonedModuleBufferRef, *NewTSCtx.getContext())); diff --git a/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp b/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp index 5a898d96d7d..184388dc4d7 100644 --- a/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp +++ b/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp @@ -203,7 +203,7 @@ PerfJITEventListener::PerfJITEventListener() : Pid(::getpid()) { return; } - Dumpstream = make_unique(DumpFd, true); + Dumpstream = std::make_unique(DumpFd, true); LLVMPerfJitHeader Header = {0}; if (!FillMachine(Header)) diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp index d4e3b0ba767..27a7690db34 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp @@ -50,18 +50,18 @@ llvm::RuntimeDyldCOFF::create(Triple::ArchType Arch, switch (Arch) { default: llvm_unreachable("Unsupported target for RuntimeDyldCOFF."); case Triple::x86: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); case Triple::thumb: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); case Triple::x86_64: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); } } std::unique_ptr RuntimeDyldCOFF::loadObject(const object::ObjectFile &O) { if (auto ObjSectionToIDOrErr = loadObjectImpl(O)) { - return llvm::make_unique(*this, *ObjSectionToIDOrErr); + return std::make_unique(*this, *ObjSectionToIDOrErr); } else { HasError = true; raw_string_ostream ErrStream(ErrorStr); diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index ec31ea4e573..b9c5a12e08d 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -851,7 +851,7 @@ RuntimeDyldChecker::RuntimeDyldChecker( GetGOTInfoFunction GetGOTInfo, support::endianness Endianness, MCDisassembler *Disassembler, MCInstPrinter *InstPrinter, raw_ostream &ErrStream) - : Impl(::llvm::make_unique( + : Impl(::std::make_unique( std::move(IsSymbolValid), std::move(GetSymbolInfo), std::move(GetSectionInfo), std::move(GetStubInfo), std::move(GetGOTInfo), Endianness, Disassembler, InstPrinter, diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index e3ace265f9c..8de3f7ef467 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -242,19 +242,19 @@ llvm::RuntimeDyldELF::create(Triple::ArchType Arch, JITSymbolResolver &Resolver) { switch (Arch) { default: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); case Triple::mips: case Triple::mipsel: case Triple::mips64: case Triple::mips64el: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); } } std::unique_ptr RuntimeDyldELF::loadObject(const object::ObjectFile &O) { if (auto ObjSectionToIDOrErr = loadObjectImpl(O)) - return llvm::make_unique(*this, *ObjSectionToIDOrErr); + return std::make_unique(*this, *ObjSectionToIDOrErr); else { HasError = true; raw_string_ostream ErrStream(ErrorStr); diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp index fbdfb8d5c3a..a6a818601c6 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp @@ -354,20 +354,20 @@ RuntimeDyldMachO::create(Triple::ArchType Arch, llvm_unreachable("Unsupported target for RuntimeDyldMachO."); break; case Triple::arm: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); case Triple::aarch64: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); case Triple::x86: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); case Triple::x86_64: - return make_unique(MemMgr, Resolver); + return std::make_unique(MemMgr, Resolver); } } std::unique_ptr RuntimeDyldMachO::loadObject(const object::ObjectFile &O) { if (auto ObjSectionToIDOrErr = loadObjectImpl(O)) - return llvm::make_unique(*this, + return std::make_unique(*this, *ObjSectionToIDOrErr); else { HasError = true; diff --git a/lib/FuzzMutate/FuzzerCLI.cpp b/lib/FuzzMutate/FuzzerCLI.cpp index 63d31c03539..f2368ea7f26 100644 --- a/lib/FuzzMutate/FuzzerCLI.cpp +++ b/lib/FuzzMutate/FuzzerCLI.cpp @@ -171,7 +171,7 @@ std::unique_ptr llvm::parseModule( if (Size <= 1) // We get bogus data given an empty corpus - just create a new module. - return llvm::make_unique("M", Context); + return std::make_unique("M", Context); auto Buffer = MemoryBuffer::getMemBuffer( StringRef(reinterpret_cast(Data), Size), "Fuzzer input", diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 2462e933ba4..3f140ba01d8 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -835,7 +835,7 @@ SlotTracker *ModuleSlotTracker::getMachine() { ShouldCreateStorage = false; MachineStorage = - llvm::make_unique(M, ShouldInitializeAllMetadata); + std::make_unique(M, ShouldInitializeAllMetadata); Machine = MachineStorage.get(); return Machine; } @@ -2312,7 +2312,7 @@ static void WriteAsOperandInternal(raw_ostream &Out, const Metadata *MD, if (const MDNode *N = dyn_cast(MD)) { std::unique_ptr MachineStorage; if (!Machine) { - MachineStorage = make_unique(Context); + MachineStorage = std::make_unique(Context); Machine = MachineStorage.get(); } int Slot = Machine->getMetadataSlot(N); diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp index dc28d22548d..462458d7065 100644 --- a/lib/IR/Function.cpp +++ b/lib/IR/Function.cpp @@ -251,7 +251,7 @@ Function::Function(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, // We only need a symbol table for a function if the context keeps value names if (!getContext().shouldDiscardValueNames()) - SymTab = make_unique(); + SymTab = std::make_unique(); // If the function has arguments, mark them as lazily built. if (Ty->getNumParams()) diff --git a/lib/IR/LLVMContextImpl.cpp b/lib/IR/LLVMContextImpl.cpp index c6ab2c6f213..5f978271417 100644 --- a/lib/IR/LLVMContextImpl.cpp +++ b/lib/IR/LLVMContextImpl.cpp @@ -21,7 +21,7 @@ using namespace llvm; LLVMContextImpl::LLVMContextImpl(LLVMContext &C) - : DiagHandler(llvm::make_unique()), + : DiagHandler(std::make_unique()), VoidTy(C, Type::VoidTyID), LabelTy(C, Type::LabelTyID), HalfTy(C, Type::HalfTyID), diff --git a/lib/IR/RemarkStreamer.cpp b/lib/IR/RemarkStreamer.cpp index a8650c694aa..73387ecbac1 100644 --- a/lib/IR/RemarkStreamer.cpp +++ b/lib/IR/RemarkStreamer.cpp @@ -126,7 +126,7 @@ llvm::setupOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename, std::error_code EC; auto RemarksFile = - llvm::make_unique(RemarksFilename, EC, sys::fs::OF_None); + std::make_unique(RemarksFilename, EC, sys::fs::OF_None); // We don't use llvm::FileError here because some diagnostics want the file // name separately. if (EC) @@ -141,7 +141,7 @@ llvm::setupOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename, if (Error E = RemarkSerializer.takeError()) return make_error(std::move(E)); - Context.setRemarkStreamer(llvm::make_unique( + Context.setRemarkStreamer(std::make_unique( RemarksFilename, std::move(*RemarkSerializer))); if (!RemarksPasses.empty()) diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index 2e109c5f6d9..6fa58741be1 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -5067,7 +5067,7 @@ struct VerifierLegacyPass : public FunctionPass { } bool doInitialization(Module &M) override { - V = llvm::make_unique( + V = std::make_unique( &dbgs(), /*ShouldTreatBrokenDebugInfoAsError=*/false, M); return false; } diff --git a/lib/LTO/Caching.cpp b/lib/LTO/Caching.cpp index 000ab91dba7..12dcd182de2 100644 --- a/lib/LTO/Caching.cpp +++ b/lib/LTO/Caching.cpp @@ -142,8 +142,8 @@ Expected lto::localCache(StringRef CacheDirectoryPath, } // This CacheStream will move the temporary file into the cache when done. - return llvm::make_unique( - llvm::make_unique(Temp->FD, /* ShouldClose */ false), + return std::make_unique( + std::make_unique(Temp->FD, /* ShouldClose */ false), AddBuffer, std::move(*Temp), EntryPath.str(), Task); }; }; diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp index a67fa941696..0ada5015c0a 100644 --- a/lib/LTO/LTO.cpp +++ b/lib/LTO/LTO.cpp @@ -460,8 +460,8 @@ BitcodeModule &InputFile::getSingleBitcodeModule() { LTO::RegularLTOState::RegularLTOState(unsigned ParallelCodeGenParallelismLevel, Config &Conf) : ParallelCodeGenParallelismLevel(ParallelCodeGenParallelismLevel), - Ctx(Conf), CombinedModule(llvm::make_unique("ld-temp.o", Ctx)), - Mover(llvm::make_unique(*CombinedModule)) {} + Ctx(Conf), CombinedModule(std::make_unique("ld-temp.o", Ctx)), + Mover(std::make_unique(*CombinedModule)) {} LTO::ThinLTOState::ThinLTOState(ThinBackend Backend) : Backend(Backend), CombinedIndex(/*HaveGVs*/ false) { @@ -1142,7 +1142,7 @@ ThinBackend lto::createInProcessThinBackend(unsigned ParallelismLevel) { return [=](Config &Conf, ModuleSummaryIndex &CombinedIndex, const StringMap &ModuleToDefinedGVSummaries, AddStreamFn AddStream, NativeObjectCache Cache) { - return llvm::make_unique( + return std::make_unique( Conf, CombinedIndex, ParallelismLevel, ModuleToDefinedGVSummaries, AddStream, Cache); }; @@ -1232,7 +1232,7 @@ ThinBackend lto::createWriteIndexesThinBackend( return [=](Config &Conf, ModuleSummaryIndex &CombinedIndex, const StringMap &ModuleToDefinedGVSummaries, AddStreamFn AddStream, NativeObjectCache Cache) { - return llvm::make_unique( + return std::make_unique( Conf, CombinedIndex, ModuleToDefinedGVSummaries, OldPrefix, NewPrefix, ShouldEmitImportsFiles, LinkedObjectsFile, OnWrite); }; @@ -1382,7 +1382,7 @@ lto::setupStatsFile(StringRef StatsFilename) { llvm::EnableStatistics(false); std::error_code EC; auto StatsFile = - llvm::make_unique(StatsFilename, EC, sys::fs::OF_None); + std::make_unique(StatsFilename, EC, sys::fs::OF_None); if (EC) return errorCodeToError(EC); diff --git a/lib/LTO/LTOBackend.cpp b/lib/LTO/LTOBackend.cpp index 1879b40808a..1f4ecf0fe61 100644 --- a/lib/LTO/LTOBackend.cpp +++ b/lib/LTO/LTOBackend.cpp @@ -57,7 +57,7 @@ Error Config::addSaveTemps(std::string OutputFileName, ShouldDiscardValueNames = false; std::error_code EC; - ResolutionFile = llvm::make_unique( + ResolutionFile = std::make_unique( OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::OF_Text); if (EC) return errorCodeToError(EC); @@ -329,7 +329,7 @@ void codegen(Config &Conf, TargetMachine *TM, AddStreamFn AddStream, if (!DwoFile.empty()) { std::error_code EC; - DwoOut = llvm::make_unique(DwoFile, EC, sys::fs::OF_None); + DwoOut = std::make_unique(DwoFile, EC, sys::fs::OF_None); if (EC) report_fatal_error("Failed to open " + DwoFile + ": " + EC.message()); } diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp index c1a19fae90f..bd03184b03c 100644 --- a/lib/LTO/LTOCodeGenerator.cpp +++ b/lib/LTO/LTOCodeGenerator.cpp @@ -174,7 +174,7 @@ void LTOCodeGenerator::setModule(std::unique_ptr Mod) { AsmUndefinedRefs.clear(); MergedModule = Mod->takeModule(); - TheLinker = make_unique(*MergedModule); + TheLinker = std::make_unique(*MergedModule); setAsmUndefinedRefs(&*Mod); // We've just changed the input, so let's make sure we verify it. @@ -690,7 +690,7 @@ LTOCodeGenerator::setDiagnosticHandler(lto_diagnostic_handler_t DiagHandler, return Context.setDiagnosticHandler(nullptr); // Register the LTOCodeGenerator stub in the LLVMContext to forward the // diagnostic to the external DiagHandler. - Context.setDiagnosticHandler(llvm::make_unique(this), + Context.setDiagnosticHandler(std::make_unique(this), true); } diff --git a/lib/LTO/ThinLTOCodeGenerator.cpp b/lib/LTO/ThinLTOCodeGenerator.cpp index 70d61c97c72..eada2529e82 100644 --- a/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/lib/LTO/ThinLTOCodeGenerator.cpp @@ -295,7 +295,7 @@ std::unique_ptr codegenModule(Module &TheModule, // Run codegen now. resulting binary is in OutputBuffer. PM.run(TheModule); } - return make_unique(std::move(OutputBuffer)); + return std::make_unique(std::move(OutputBuffer)); } /// Manage caching for a single Module. @@ -442,7 +442,7 @@ ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); WriteBitcodeToFile(TheModule, OS, true, &Index); } - return make_unique(std::move(OutputBuffer)); + return std::make_unique(std::move(OutputBuffer)); } return codegenModule(TheModule, TM); @@ -557,7 +557,7 @@ std::unique_ptr TargetMachineBuilder::create() const { */ std::unique_ptr ThinLTOCodeGenerator::linkCombinedIndex() { std::unique_ptr CombinedIndex = - llvm::make_unique(/*HaveGVs=*/false); + std::make_unique(/*HaveGVs=*/false); uint64_t NextModuleId = 0; for (auto &Mod : Modules) { auto &M = Mod->getSingleBitcodeModule(); diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 2c68723a12f..10a9fe87aa2 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -1551,7 +1551,7 @@ bool ELFObjectWriter::isSymbolRefDifferenceFullyResolvedImpl( std::unique_ptr llvm::createELFObjectWriter(std::unique_ptr MOTW, raw_pwrite_stream &OS, bool IsLittleEndian) { - return llvm::make_unique(std::move(MOTW), OS, + return std::make_unique(std::move(MOTW), OS, IsLittleEndian); } @@ -1559,6 +1559,6 @@ std::unique_ptr llvm::createELFDwoObjectWriter(std::unique_ptr MOTW, raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS, bool IsLittleEndian) { - return llvm::make_unique(std::move(MOTW), OS, DwoOS, + return std::make_unique(std::move(MOTW), OS, DwoOS, IsLittleEndian); } diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 81a57c67d37..e20ba2f96e3 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -66,7 +66,7 @@ public: std::unique_ptr asmbackend, bool showInst) : MCStreamer(Context), OSOwner(std::move(os)), OS(*OSOwner), MAI(Context.getAsmInfo()), InstPrinter(printer), - Assembler(llvm::make_unique( + Assembler(std::make_unique( Context, std::move(asmbackend), std::move(emitter), (asmbackend) ? asmbackend->createObjectWriter(NullStream) : nullptr)), diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 1587d849866..b418c2d33d9 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -27,7 +27,7 @@ MCObjectStreamer::MCObjectStreamer(MCContext &Context, std::unique_ptr OW, std::unique_ptr Emitter) : MCStreamer(Context), - Assembler(llvm::make_unique( + Assembler(std::make_unique( Context, std::move(TAB), std::move(Emitter), std::move(OW))), EmitEHFrame(true), EmitDebugFrame(false) {} diff --git a/lib/MC/MCParser/DarwinAsmParser.cpp b/lib/MC/MCParser/DarwinAsmParser.cpp index 9c064207c7c..bd66e5f39c0 100644 --- a/lib/MC/MCParser/DarwinAsmParser.cpp +++ b/lib/MC/MCParser/DarwinAsmParser.cpp @@ -778,7 +778,7 @@ bool DarwinAsmParser::parseDirectiveSecureLogUnique(StringRef, SMLoc IDLoc) { raw_fd_ostream *OS = getContext().getSecureLog(); if (!OS) { std::error_code EC; - auto NewOS = llvm::make_unique( + auto NewOS = std::make_unique( StringRef(SecureLogFile), EC, sys::fs::OF_Append | sys::fs::OF_Text); if (EC) return Error(IDLoc, Twine("can't open secure log file: ") + diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 2e36fe77b59..3a52cd9e18a 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -677,7 +677,7 @@ void MCStreamer::EmitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc) { MCSymbol *StartProc = EmitCFILabel(); WinFrameInfos.emplace_back( - llvm::make_unique(Symbol, StartProc)); + std::make_unique(Symbol, StartProc)); CurrentWinFrameInfo = WinFrameInfos.back().get(); CurrentWinFrameInfo->TextSection = getCurrentSectionOnly(); } @@ -711,7 +711,7 @@ void MCStreamer::EmitWinCFIStartChained(SMLoc Loc) { MCSymbol *StartProc = EmitCFILabel(); - WinFrameInfos.emplace_back(llvm::make_unique( + WinFrameInfos.emplace_back(std::make_unique( CurFrame->Function, StartProc, CurFrame)); CurrentWinFrameInfo = WinFrameInfos.back().get(); CurrentWinFrameInfo->TextSection = getCurrentSectionOnly(); diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp index f0ceb86b25a..251fe5abbcf 100644 --- a/lib/MC/MachObjectWriter.cpp +++ b/lib/MC/MachObjectWriter.cpp @@ -1043,6 +1043,6 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm, std::unique_ptr llvm::createMachObjectWriter(std::unique_ptr MOTW, raw_pwrite_stream &OS, bool IsLittleEndian) { - return llvm::make_unique(std::move(MOTW), OS, + return std::make_unique(std::move(MOTW), OS, IsLittleEndian); } diff --git a/lib/MC/WasmObjectWriter.cpp b/lib/MC/WasmObjectWriter.cpp index 098343cd010..a3863303838 100644 --- a/lib/MC/WasmObjectWriter.cpp +++ b/lib/MC/WasmObjectWriter.cpp @@ -1296,12 +1296,12 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm, // Separate out the producers and target features sections if (Name == "producers") { - ProducersSection = llvm::make_unique(Name, &Section); + ProducersSection = std::make_unique(Name, &Section); continue; } if (Name == "target_features") { TargetFeaturesSection = - llvm::make_unique(Name, &Section); + std::make_unique(Name, &Section); continue; } @@ -1618,5 +1618,5 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm, std::unique_ptr llvm::createWasmObjectWriter(std::unique_ptr MOTW, raw_pwrite_stream &OS) { - return llvm::make_unique(std::move(MOTW), OS); + return std::make_unique(std::move(MOTW), OS); } diff --git a/lib/MC/WinCOFFObjectWriter.cpp b/lib/MC/WinCOFFObjectWriter.cpp index 0e6c05bc726..fa972276818 100644 --- a/lib/MC/WinCOFFObjectWriter.cpp +++ b/lib/MC/WinCOFFObjectWriter.cpp @@ -239,7 +239,7 @@ WinCOFFObjectWriter::WinCOFFObjectWriter( } COFFSymbol *WinCOFFObjectWriter::createSymbol(StringRef Name) { - Symbols.push_back(make_unique(Name)); + Symbols.push_back(std::make_unique(Name)); return Symbols.back().get(); } @@ -251,7 +251,7 @@ COFFSymbol *WinCOFFObjectWriter::GetOrCreateCOFFSymbol(const MCSymbol *Symbol) { } COFFSection *WinCOFFObjectWriter::createSection(StringRef Name) { - Sections.emplace_back(make_unique(Name)); + Sections.emplace_back(std::make_unique(Name)); return Sections.back().get(); } @@ -1098,5 +1098,5 @@ void MCWinCOFFObjectTargetWriter::anchor() {} std::unique_ptr llvm::createWinCOFFObjectWriter( std::unique_ptr MOTW, raw_pwrite_stream &OS) { - return llvm::make_unique(std::move(MOTW), OS); + return std::make_unique(std::move(MOTW), OS); } diff --git a/lib/MC/XCOFFObjectWriter.cpp b/lib/MC/XCOFFObjectWriter.cpp index 9b9a7b6c118..8f67c927f81 100644 --- a/lib/MC/XCOFFObjectWriter.cpp +++ b/lib/MC/XCOFFObjectWriter.cpp @@ -90,5 +90,5 @@ uint64_t XCOFFObjectWriter::writeObject(MCAssembler &Asm, const MCAsmLayout &) { std::unique_ptr llvm::createXCOFFObjectWriter(std::unique_ptr MOTW, raw_pwrite_stream &OS) { - return llvm::make_unique(std::move(MOTW), OS); + return std::make_unique(std::move(MOTW), OS); } diff --git a/lib/MCA/Context.cpp b/lib/MCA/Context.cpp index 3bcabb6a235..546c82c6dd9 100644 --- a/lib/MCA/Context.cpp +++ b/lib/MCA/Context.cpp @@ -32,19 +32,19 @@ Context::createDefaultPipeline(const PipelineOptions &Opts, SourceMgr &SrcMgr) { const MCSchedModel &SM = STI.getSchedModel(); // Create the hardware units defining the backend. - auto RCU = llvm::make_unique(SM); - auto PRF = llvm::make_unique(SM, MRI, Opts.RegisterFileSize); - auto LSU = llvm::make_unique(SM, Opts.LoadQueueSize, + auto RCU = std::make_unique(SM); + auto PRF = std::make_unique(SM, MRI, Opts.RegisterFileSize); + auto LSU = std::make_unique(SM, Opts.LoadQueueSize, Opts.StoreQueueSize, Opts.AssumeNoAlias); - auto HWS = llvm::make_unique(SM, *LSU); + auto HWS = std::make_unique(SM, *LSU); // Create the pipeline stages. - auto Fetch = llvm::make_unique(SrcMgr); - auto Dispatch = llvm::make_unique(STI, MRI, Opts.DispatchWidth, + auto Fetch = std::make_unique(SrcMgr); + auto Dispatch = std::make_unique(STI, MRI, Opts.DispatchWidth, *RCU, *PRF); auto Execute = - llvm::make_unique(*HWS, Opts.EnableBottleneckAnalysis); - auto Retire = llvm::make_unique(*RCU, *PRF); + std::make_unique(*HWS, Opts.EnableBottleneckAnalysis); + auto Retire = std::make_unique(*RCU, *PRF); // Pass the ownership of all the hardware units to this Context. addHardwareUnit(std::move(RCU)); @@ -53,10 +53,10 @@ Context::createDefaultPipeline(const PipelineOptions &Opts, SourceMgr &SrcMgr) { addHardwareUnit(std::move(HWS)); // Build the pipeline. - auto StagePipeline = llvm::make_unique(); + auto StagePipeline = std::make_unique(); StagePipeline->appendStage(std::move(Fetch)); if (Opts.MicroOpQueueSize) - StagePipeline->appendStage(llvm::make_unique( + StagePipeline->appendStage(std::make_unique( Opts.MicroOpQueueSize, Opts.DecodersThroughput)); StagePipeline->appendStage(std::move(Dispatch)); StagePipeline->appendStage(std::move(Execute)); diff --git a/lib/MCA/HardwareUnits/ResourceManager.cpp b/lib/MCA/HardwareUnits/ResourceManager.cpp index 5c91198362a..088aea3e23c 100644 --- a/lib/MCA/HardwareUnits/ResourceManager.cpp +++ b/lib/MCA/HardwareUnits/ResourceManager.cpp @@ -104,7 +104,7 @@ void ResourceState::dump() const { static std::unique_ptr getStrategyFor(const ResourceState &RS) { if (RS.isAResourceGroup() || RS.getNumUnits() > 1) - return llvm::make_unique(RS.getReadyMask()); + return std::make_unique(RS.getReadyMask()); return std::unique_ptr(nullptr); } @@ -128,7 +128,7 @@ ResourceManager::ResourceManager(const MCSchedModel &SM) uint64_t Mask = ProcResID2Mask[I]; unsigned Index = getResourceStateIndex(Mask); Resources[Index] = - llvm::make_unique(*SM.getProcResource(I), I, Mask); + std::make_unique(*SM.getProcResource(I), I, Mask); Strategies[Index] = getStrategyFor(*Resources[Index]); } diff --git a/lib/MCA/HardwareUnits/Scheduler.cpp b/lib/MCA/HardwareUnits/Scheduler.cpp index c793130af2a..8730336c666 100644 --- a/lib/MCA/HardwareUnits/Scheduler.cpp +++ b/lib/MCA/HardwareUnits/Scheduler.cpp @@ -21,7 +21,7 @@ namespace mca { void Scheduler::initializeStrategy(std::unique_ptr S) { // Ensure we have a valid (non-null) strategy object. - Strategy = S ? std::move(S) : llvm::make_unique(); + Strategy = S ? std::move(S) : std::make_unique(); } // Anchor the vtable of SchedulerStrategy and DefaultSchedulerStrategy. diff --git a/lib/MCA/InstrBuilder.cpp b/lib/MCA/InstrBuilder.cpp index ee9e2bcda18..2a177f6314e 100644 --- a/lib/MCA/InstrBuilder.cpp +++ b/lib/MCA/InstrBuilder.cpp @@ -544,7 +544,7 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI) { LLVM_DEBUG(dbgs() << "\t\tSchedClassID=" << SchedClassID << '\n'); // Create a new empty descriptor. - std::unique_ptr ID = llvm::make_unique(); + std::unique_ptr ID = std::make_unique(); ID->NumMicroOps = SCDesc.NumMicroOps; ID->SchedClassID = SchedClassID; @@ -613,7 +613,7 @@ InstrBuilder::createInstruction(const MCInst &MCI) { if (!DescOrErr) return DescOrErr.takeError(); const InstrDesc &D = *DescOrErr; - std::unique_ptr NewIS = llvm::make_unique(D); + std::unique_ptr NewIS = std::make_unique(D); // Check if this is a dependency breaking instruction. APInt Mask; diff --git a/lib/MCA/Stages/EntryStage.cpp b/lib/MCA/Stages/EntryStage.cpp index d2f5613a0fb..66135790a4c 100644 --- a/lib/MCA/Stages/EntryStage.cpp +++ b/lib/MCA/Stages/EntryStage.cpp @@ -33,7 +33,7 @@ void EntryStage::getNextInstruction() { if (!SM.hasNext()) return; SourceRef SR = SM.peekNext(); - std::unique_ptr Inst = llvm::make_unique(SR.second); + std::unique_ptr Inst = std::make_unique(SR.second); CurrentInstruction = InstRef(SR.first, Inst.get()); Instructions.emplace_back(std::move(Inst)); SM.updateNext(); diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index f3b0347088a..82e9b89f13e 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/lib/Object/ELFObjectFile.cpp @@ -63,7 +63,7 @@ createPtr(MemoryBufferRef Object) { auto Ret = ELFObjectFile::create(Object); if (Error E = Ret.takeError()) return std::move(E); - return make_unique>(std::move(*Ret)); + return std::make_unique>(std::move(*Ret)); } Expected> diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index 179166ddbd3..be1950e08ed 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -3428,7 +3428,7 @@ iterator_range MachOObjectFile::rebaseTable(Error &Err, MachOObjectFile *O, ArrayRef Opcodes, bool is64) { if (O->BindRebaseSectionTable == nullptr) - O->BindRebaseSectionTable = llvm::make_unique(O); + O->BindRebaseSectionTable = std::make_unique(O); MachORebaseEntry Start(&Err, O, Opcodes, is64); Start.moveToFirst(); @@ -4099,7 +4099,7 @@ MachOObjectFile::bindTable(Error &Err, MachOObjectFile *O, ArrayRef Opcodes, bool is64, MachOBindEntry::Kind BKind) { if (O->BindRebaseSectionTable == nullptr) - O->BindRebaseSectionTable = llvm::make_unique(O); + O->BindRebaseSectionTable = std::make_unique(O); MachOBindEntry Start(&Err, O, Opcodes, is64, BKind); Start.moveToFirst(); diff --git a/lib/Object/WasmObjectFile.cpp b/lib/Object/WasmObjectFile.cpp index cdcb1799280..470283efb29 100644 --- a/lib/Object/WasmObjectFile.cpp +++ b/lib/Object/WasmObjectFile.cpp @@ -56,7 +56,7 @@ LLVM_DUMP_METHOD void WasmSymbol::dump() const { print(dbgs()); } Expected> ObjectFile::createWasmObjectFile(MemoryBufferRef Buffer) { Error Err = Error::success(); - auto ObjectFile = llvm::make_unique(Buffer, Err); + auto ObjectFile = std::make_unique(Buffer, Err); if (Err) return std::move(Err); diff --git a/lib/Object/XCOFFObjectFile.cpp b/lib/Object/XCOFFObjectFile.cpp index 65ccee1ff29..7e3e8f96a41 100644 --- a/lib/Object/XCOFFObjectFile.cpp +++ b/lib/Object/XCOFFObjectFile.cpp @@ -502,7 +502,7 @@ XCOFFObjectFile::parseStringTable(const XCOFFObjectFile *Obj, uint64_t Offset) { Expected> XCOFFObjectFile::create(unsigned Type, MemoryBufferRef MBR) { - // Can't use make_unique because of the private constructor. + // Can't use std::make_unique because of the private constructor. std::unique_ptr Obj; Obj.reset(new XCOFFObjectFile(Type, MBR)); diff --git a/lib/ObjectYAML/ELFEmitter.cpp b/lib/ObjectYAML/ELFEmitter.cpp index d2ceb40e2c1..5e53baf5fa4 100644 --- a/lib/ObjectYAML/ELFEmitter.cpp +++ b/lib/ObjectYAML/ELFEmitter.cpp @@ -188,7 +188,7 @@ template ELFState::ELFState(ELFYAML::Object &D) : Doc(D) { if (Doc.Sections.empty() || Doc.Sections.front()->Type != ELF::SHT_NULL) Doc.Sections.insert( Doc.Sections.begin(), - llvm::make_unique( + std::make_unique( ELFYAML::Section::SectionKind::RawContent, /*IsImplicit=*/true)); std::vector ImplicitSections = {".symtab", ".strtab", ".shstrtab"}; @@ -201,7 +201,7 @@ template ELFState::ELFState(ELFYAML::Object &D) : Doc(D) { if (DocSections.count(SecName)) continue; - std::unique_ptr Sec = llvm::make_unique( + std::unique_ptr Sec = std::make_unique( ELFYAML::Section::SectionKind::RawContent, true /*IsImplicit*/); Sec->Name = SecName; Doc.Sections.push_back(std::move(Sec)); diff --git a/lib/ObjectYAML/MinidumpYAML.cpp b/lib/ObjectYAML/MinidumpYAML.cpp index f5f2acd0cc4..62995de5da2 100644 --- a/lib/ObjectYAML/MinidumpYAML.cpp +++ b/lib/ObjectYAML/MinidumpYAML.cpp @@ -193,17 +193,17 @@ std::unique_ptr Stream::create(StreamType Type) { StreamKind Kind = getKind(Type); switch (Kind) { case StreamKind::MemoryList: - return llvm::make_unique(); + return std::make_unique(); case StreamKind::ModuleList: - return llvm::make_unique(); + return std::make_unique(); case StreamKind::RawContent: - return llvm::make_unique(Type); + return std::make_unique(Type); case StreamKind::SystemInfo: - return llvm::make_unique(); + return std::make_unique(); case StreamKind::TextContent: - return llvm::make_unique(Type); + return std::make_unique(Type); case StreamKind::ThreadList: - return llvm::make_unique(); + return std::make_unique(); } llvm_unreachable("Unhandled stream kind!"); } @@ -602,7 +602,7 @@ Stream::create(const Directory &StreamDesc, const object::MinidumpFile &File) { return ExpectedContent.takeError(); Ranges.push_back({MD, *ExpectedContent}); } - return llvm::make_unique(std::move(Ranges)); + return std::make_unique(std::move(Ranges)); } case StreamKind::ModuleList: { auto ExpectedList = File.getModuleList(); @@ -622,10 +622,10 @@ Stream::create(const Directory &StreamDesc, const object::MinidumpFile &File) { Modules.push_back( {M, std::move(*ExpectedName), *ExpectedCv, *ExpectedMisc}); } - return llvm::make_unique(std::move(Modules)); + return std::make_unique(std::move(Modules)); } case StreamKind::RawContent: - return llvm::make_unique(StreamDesc.Type, + return std::make_unique(StreamDesc.Type, File.getRawStream(StreamDesc)); case StreamKind::SystemInfo: { auto ExpectedInfo = File.getSystemInfo(); @@ -634,11 +634,11 @@ Stream::create(const Directory &StreamDesc, const object::MinidumpFile &File) { auto ExpectedCSDVersion = File.getString(ExpectedInfo->CSDVersionRVA); if (!ExpectedCSDVersion) return ExpectedInfo.takeError(); - return llvm::make_unique(*ExpectedInfo, + return std::make_unique(*ExpectedInfo, std::move(*ExpectedCSDVersion)); } case StreamKind::TextContent: - return llvm::make_unique( + return std::make_unique( StreamDesc.Type, toStringRef(File.getRawStream(StreamDesc))); case StreamKind::ThreadList: { auto ExpectedList = File.getThreadList(); @@ -654,7 +654,7 @@ Stream::create(const Directory &StreamDesc, const object::MinidumpFile &File) { return ExpectedContext.takeError(); Threads.push_back({T, *ExpectedStack, *ExpectedContext}); } - return llvm::make_unique(std::move(Threads)); + return std::make_unique(std::move(Threads)); } } llvm_unreachable("Unhandled stream kind!"); diff --git a/lib/Option/ArgList.cpp b/lib/Option/ArgList.cpp index f37c142da69..09e921502eb 100644 --- a/lib/Option/ArgList.cpp +++ b/lib/Option/ArgList.cpp @@ -241,7 +241,7 @@ void DerivedArgList::AddSynthesizedArg(Arg *A) { Arg *DerivedArgList::MakeFlagArg(const Arg *BaseArg, const Option Opt) const { SynthesizedArgs.push_back( - make_unique(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()), + std::make_unique(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()), BaseArgs.MakeIndex(Opt.getName()), BaseArg)); return SynthesizedArgs.back().get(); } @@ -250,7 +250,7 @@ Arg *DerivedArgList::MakePositionalArg(const Arg *BaseArg, const Option Opt, StringRef Value) const { unsigned Index = BaseArgs.MakeIndex(Value); SynthesizedArgs.push_back( - make_unique(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()), + std::make_unique(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()), Index, BaseArgs.getArgString(Index), BaseArg)); return SynthesizedArgs.back().get(); } @@ -259,7 +259,7 @@ Arg *DerivedArgList::MakeSeparateArg(const Arg *BaseArg, const Option Opt, StringRef Value) const { unsigned Index = BaseArgs.MakeIndex(Opt.getName(), Value); SynthesizedArgs.push_back( - make_unique(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()), + std::make_unique(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()), Index, BaseArgs.getArgString(Index + 1), BaseArg)); return SynthesizedArgs.back().get(); } @@ -267,7 +267,7 @@ Arg *DerivedArgList::MakeSeparateArg(const Arg *BaseArg, const Option Opt, Arg *DerivedArgList::MakeJoinedArg(const Arg *BaseArg, const Option Opt, StringRef Value) const { unsigned Index = BaseArgs.MakeIndex((Opt.getName() + Value).str()); - SynthesizedArgs.push_back(make_unique( + SynthesizedArgs.push_back(std::make_unique( Opt, MakeArgString(Opt.getPrefix() + Opt.getName()), Index, BaseArgs.getArgString(Index) + Opt.getName().size(), BaseArg)); return SynthesizedArgs.back().get(); diff --git a/lib/ProfileData/Coverage/CoverageMappingReader.cpp b/lib/ProfileData/Coverage/CoverageMappingReader.cpp index e70bc318b84..4e0b911c142 100644 --- a/lib/ProfileData/Coverage/CoverageMappingReader.cpp +++ b/lib/ProfileData/Coverage/CoverageMappingReader.cpp @@ -539,7 +539,7 @@ Expected> CovMapFuncRecordReader::get( switch (Version) { case CovMapVersion::Version1: - return llvm::make_unique>(P, R, F); case CovMapVersion::Version2: case CovMapVersion::Version3: @@ -547,10 +547,10 @@ Expected> CovMapFuncRecordReader::get( if (Error E = P.create(P.getNameData())) return std::move(E); if (Version == CovMapVersion::Version2) - return llvm::make_unique>(P, R, F); else - return llvm::make_unique>(P, R, F); } llvm_unreachable("Unsupported version"); diff --git a/lib/ProfileData/GCOV.cpp b/lib/ProfileData/GCOV.cpp index 47c8cfbbf4d..00e6294c57a 100644 --- a/lib/ProfileData/GCOV.cpp +++ b/lib/ProfileData/GCOV.cpp @@ -40,7 +40,7 @@ bool GCOVFile::readGCNO(GCOVBuffer &Buffer) { while (true) { if (!Buffer.readFunctionTag()) break; - auto GFun = make_unique(*this); + auto GFun = std::make_unique(*this); if (!GFun->readGCNO(Buffer, Version)) return false; Functions.push_back(std::move(GFun)); @@ -164,7 +164,7 @@ bool GCOVFunction::readGCNO(GCOVBuffer &Buff, GCOV::GCOVVersion Version) { for (uint32_t i = 0, e = BlockCount; i != e; ++i) { if (!Buff.readInt(Dummy)) return false; // Block flags; - Blocks.push_back(make_unique(*this, i)); + Blocks.push_back(std::make_unique(*this, i)); } // read edges. @@ -185,7 +185,7 @@ bool GCOVFunction::readGCNO(GCOVBuffer &Buff, GCOV::GCOVVersion Version) { uint32_t Dst; if (!Buff.readInt(Dst)) return false; - Edges.push_back(make_unique(*Blocks[BlockNo], *Blocks[Dst])); + Edges.push_back(std::make_unique(*Blocks[BlockNo], *Blocks[Dst])); GCOVEdge *Edge = Edges.back().get(); Blocks[BlockNo]->addDstEdge(Edge); Blocks[Dst]->addSrcEdge(Edge); @@ -702,14 +702,14 @@ std::string FileInfo::getCoveragePath(StringRef Filename, std::unique_ptr FileInfo::openCoveragePath(StringRef CoveragePath) { if (Options.NoOutput) - return llvm::make_unique(); + return std::make_unique(); std::error_code EC; auto OS = - llvm::make_unique(CoveragePath, EC, sys::fs::OF_Text); + std::make_unique(CoveragePath, EC, sys::fs::OF_Text); if (EC) { errs() << EC.message() << "\n"; - return llvm::make_unique(); + return std::make_unique(); } return std::move(OS); } diff --git a/lib/ProfileData/InstrProfReader.cpp b/lib/ProfileData/InstrProfReader.cpp index fec1c152991..b97601ce172 100644 --- a/lib/ProfileData/InstrProfReader.cpp +++ b/lib/ProfileData/InstrProfReader.cpp @@ -119,7 +119,7 @@ IndexedInstrProfReader::create(std::unique_ptr Buffer, // Create the reader. if (!IndexedInstrProfReader::hasFormat(*Buffer)) return make_error(instrprof_error::bad_magic); - auto Result = llvm::make_unique( + auto Result = std::make_unique( std::move(Buffer), std::move(RemappingBuffer)); // Initialize the reader and return the result. @@ -385,7 +385,7 @@ Error RawInstrProfReader::readHeader( NamesStart = Start + NamesOffset; ValueDataStart = reinterpret_cast(Start + ValueDataOffset); - std::unique_ptr NewSymtab = make_unique(); + std::unique_ptr NewSymtab = std::make_unique(); if (Error E = createSymtab(*NewSymtab.get())) return E; @@ -767,7 +767,7 @@ IndexedInstrProfReader::readSummary(IndexedInstrProf::ProfVersion Version, UseCS ? this->CS_Summary : this->Summary; // initialize InstrProfSummary using the SummaryData from disk. - Summary = llvm::make_unique( + Summary = std::make_unique( UseCS ? ProfileSummary::PSK_CSInstr : ProfileSummary::PSK_Instr, DetailedSummary, SummaryData->get(Summary::TotalBlockCount), SummaryData->get(Summary::MaxBlockCount), @@ -827,18 +827,18 @@ Error IndexedInstrProfReader::readHeader() { // The rest of the file is an on disk hash table. auto IndexPtr = - llvm::make_unique>( + std::make_unique>( Start + HashOffset, Cur, Start, HashType, FormatVersion); // Load the remapping table now if requested. if (RemappingBuffer) { - Remapper = llvm::make_unique< + Remapper = std::make_unique< InstrProfReaderItaniumRemapper>( std::move(RemappingBuffer), *IndexPtr); if (Error E = Remapper->populateRemappings()) return E; } else { - Remapper = llvm::make_unique(*IndexPtr); + Remapper = std::make_unique(*IndexPtr); } Index = std::move(IndexPtr); @@ -849,7 +849,7 @@ InstrProfSymtab &IndexedInstrProfReader::getSymtab() { if (Symtab.get()) return *Symtab.get(); - std::unique_ptr NewSymtab = make_unique(); + std::unique_ptr NewSymtab = std::make_unique(); if (Error E = Index->populateSymtab(*NewSymtab.get())) { consumeError(error(InstrProfError::take(std::move(E)))); } diff --git a/lib/ProfileData/ProfileSummaryBuilder.cpp b/lib/ProfileData/ProfileSummaryBuilder.cpp index 4d5b0093574..3299b5f9206 100644 --- a/lib/ProfileData/ProfileSummaryBuilder.cpp +++ b/lib/ProfileData/ProfileSummaryBuilder.cpp @@ -93,14 +93,14 @@ void ProfileSummaryBuilder::computeDetailedSummary() { std::unique_ptr SampleProfileSummaryBuilder::getSummary() { computeDetailedSummary(); - return llvm::make_unique( + return std::make_unique( ProfileSummary::PSK_Sample, DetailedSummary, TotalCount, MaxCount, 0, MaxFunctionCount, NumCounts, NumFunctions); } std::unique_ptr InstrProfSummaryBuilder::getSummary() { computeDetailedSummary(); - return llvm::make_unique( + return std::make_unique( ProfileSummary::PSK_Instr, DetailedSummary, TotalCount, MaxCount, MaxInternalBlockCount, MaxFunctionCount, NumCounts, NumFunctions); } diff --git a/lib/ProfileData/SampleProfReader.cpp b/lib/ProfileData/SampleProfReader.cpp index 659d6db6c6f..2bac3e92cb0 100644 --- a/lib/ProfileData/SampleProfReader.cpp +++ b/lib/ProfileData/SampleProfReader.cpp @@ -660,7 +660,7 @@ std::error_code SampleProfileReaderBinary::readSummary() { if (EC != sampleprof_error::success) return EC; } - Summary = llvm::make_unique( + Summary = std::make_unique( ProfileSummary::PSK_Sample, Entries, *TotalCount, *MaxBlockCount, 0, *MaxFunctionCount, *NumBlocks, *NumFunctions); @@ -1007,7 +1007,7 @@ SampleProfileReaderItaniumRemapper::create( auto BufferOrError = setupMemoryBuffer(Filename); if (std::error_code EC = BufferOrError.getError()) return EC; - return llvm::make_unique( + return std::make_unique( std::move(BufferOrError.get()), C, std::move(Underlying)); } diff --git a/lib/Remarks/BitstreamRemarkSerializer.cpp b/lib/Remarks/BitstreamRemarkSerializer.cpp index b374a7be1e5..03c5697109e 100644 --- a/lib/Remarks/BitstreamRemarkSerializer.cpp +++ b/lib/Remarks/BitstreamRemarkSerializer.cpp @@ -371,7 +371,7 @@ std::unique_ptr BitstreamRemarkSerializer::metaSerializer( BitstreamRemarkContainerType::SeparateRemarksMeta); bool IsStandalone = Helper.ContainerType == BitstreamRemarkContainerType::Standalone; - return llvm::make_unique( + return std::make_unique( OS, IsStandalone ? BitstreamRemarkContainerType::Standalone : BitstreamRemarkContainerType::SeparateRemarksMeta, diff --git a/lib/Remarks/RemarkParser.cpp b/lib/Remarks/RemarkParser.cpp index 5cfca96fd9d..5c441ca343f 100644 --- a/lib/Remarks/RemarkParser.cpp +++ b/lib/Remarks/RemarkParser.cpp @@ -51,7 +51,7 @@ Expected> llvm::remarks::createRemarkParser(Format ParserFormat, StringRef Buf) { switch (ParserFormat) { case Format::YAML: - return llvm::make_unique(Buf); + return std::make_unique(Buf); case Format::YAMLStrTab: return createStringError( std::make_error_code(std::errc::invalid_argument), @@ -75,7 +75,7 @@ llvm::remarks::createRemarkParser(Format ParserFormat, StringRef Buf, "The YAML format can't be used with a string " "table. Use yaml-strtab instead."); case Format::YAMLStrTab: - return llvm::make_unique(Buf, std::move(StrTab)); + return std::make_unique(Buf, std::move(StrTab)); case Format::Bitstream: return createStringError(std::make_error_code(std::errc::invalid_argument), "Parsing bitstream remarks is not supported."); diff --git a/lib/Remarks/RemarkSerializer.cpp b/lib/Remarks/RemarkSerializer.cpp index 0d5acbe3ca7..caba7bbdc0e 100644 --- a/lib/Remarks/RemarkSerializer.cpp +++ b/lib/Remarks/RemarkSerializer.cpp @@ -25,11 +25,11 @@ remarks::createRemarkSerializer(Format RemarksFormat, SerializerMode Mode, return createStringError(std::errc::invalid_argument, "Unknown remark serializer format."); case Format::YAML: - return llvm::make_unique(OS, Mode); + return std::make_unique(OS, Mode); case Format::YAMLStrTab: - return llvm::make_unique(OS, Mode); + return std::make_unique(OS, Mode); case Format::Bitstream: - return llvm::make_unique(OS, Mode); + return std::make_unique(OS, Mode); } llvm_unreachable("Unknown remarks::Format enum"); } @@ -46,10 +46,10 @@ remarks::createRemarkSerializer(Format RemarksFormat, SerializerMode Mode, "Unable to use a string table with the yaml " "format. Use 'yaml-strtab' instead."); case Format::YAMLStrTab: - return llvm::make_unique(OS, Mode, + return std::make_unique(OS, Mode, std::move(StrTab)); case Format::Bitstream: - return llvm::make_unique(OS, Mode, + return std::make_unique(OS, Mode, std::move(StrTab)); } llvm_unreachable("Unknown remarks::Format enum"); diff --git a/lib/Remarks/YAMLRemarkParser.cpp b/lib/Remarks/YAMLRemarkParser.cpp index 7b1e4d72ddd..69e8a0dfd76 100644 --- a/lib/Remarks/YAMLRemarkParser.cpp +++ b/lib/Remarks/YAMLRemarkParser.cpp @@ -152,8 +152,8 @@ remarks::createYAMLParserFromMeta(StringRef Buf, std::unique_ptr Result = StrTab - ? llvm::make_unique(Buf, std::move(*StrTab)) - : llvm::make_unique(Buf); + ? std::make_unique(Buf, std::move(*StrTab)) + : std::make_unique(Buf); if (SeparateBuf) Result->SeparateBuf = std::move(SeparateBuf); return std::move(Result); @@ -194,7 +194,7 @@ YAMLRemarkParser::parseRemark(yaml::Document &RemarkEntry) { if (!Root) return error("document root is not of mapping type.", *YAMLRoot); - std::unique_ptr Result = llvm::make_unique(); + std::unique_ptr Result = std::make_unique(); Remark &TheRemark = *Result; // First, the type. It needs special handling since is not part of the diff --git a/lib/Remarks/YAMLRemarkSerializer.cpp b/lib/Remarks/YAMLRemarkSerializer.cpp index c4a5bccda5b..28f9150cb9f 100644 --- a/lib/Remarks/YAMLRemarkSerializer.cpp +++ b/lib/Remarks/YAMLRemarkSerializer.cpp @@ -171,13 +171,13 @@ void YAMLRemarkSerializer::emit(const Remark &Remark) { std::unique_ptr YAMLRemarkSerializer::metaSerializer(raw_ostream &OS, Optional ExternalFilename) { - return llvm::make_unique(OS, ExternalFilename); + return std::make_unique(OS, ExternalFilename); } std::unique_ptr YAMLStrTabRemarkSerializer::metaSerializer( raw_ostream &OS, Optional ExternalFilename) { assert(StrTab); - return llvm::make_unique(OS, ExternalFilename, + return std::make_unique(OS, ExternalFilename, std::move(*StrTab)); } diff --git a/lib/Support/CodeGenCoverage.cpp b/lib/Support/CodeGenCoverage.cpp index 902736c13d4..2db4193ce38 100644 --- a/lib/Support/CodeGenCoverage.cpp +++ b/lib/Support/CodeGenCoverage.cpp @@ -103,7 +103,7 @@ bool CodeGenCoverage::emit(StringRef CoveragePrefix, std::error_code EC; sys::fs::OpenFlags OpenFlags = sys::fs::OF_Append; std::unique_ptr CoverageFile = - llvm::make_unique(CoverageFilename, EC, OpenFlags); + std::make_unique(CoverageFilename, EC, OpenFlags); if (EC) return false; diff --git a/lib/Support/Error.cpp b/lib/Support/Error.cpp index 72bc08af2dd..ae0e4b0c044 100644 --- a/lib/Support/Error.cpp +++ b/lib/Support/Error.cpp @@ -87,7 +87,7 @@ std::error_code FileError::convertToErrorCode() const { Error errorCodeToError(std::error_code EC) { if (!EC) return Error::success(); - return Error(llvm::make_unique(ECError(EC))); + return Error(std::make_unique(ECError(EC))); } std::error_code errorToErrorCode(Error Err) { diff --git a/lib/Support/FileCheck.cpp b/lib/Support/FileCheck.cpp index 16a04bc627d..143f7a46f84 100644 --- a/lib/Support/FileCheck.cpp +++ b/lib/Support/FileCheck.cpp @@ -209,7 +209,7 @@ FileCheckPattern::parseNumericVariableUse(StringRef Name, bool IsPseudo, "numeric variable '" + Name + "' defined from input on the same line as used"); - return llvm::make_unique(Name, NumericVariable); + return std::make_unique(Name, NumericVariable); } Expected> @@ -234,7 +234,7 @@ FileCheckPattern::parseNumericOperand(StringRef &Expr, AllowedOperand AO, // Otherwise, parse it as a literal. uint64_t LiteralValue; if (!Expr.consumeInteger(/*Radix=*/10, LiteralValue)) - return llvm::make_unique(LiteralValue); + return std::make_unique(LiteralValue); return FileCheckErrorDiagnostic::get(SM, Expr, "invalid operand format '" + Expr + "'"); @@ -287,7 +287,7 @@ Expected> FileCheckPattern::parseBinop( return RightOpResult; Expr = Expr.ltrim(SpaceChars); - return llvm::make_unique(EvalBinop, std::move(LeftOp), + return std::make_unique(EvalBinop, std::move(LeftOp), std::move(*RightOpResult)); } @@ -862,7 +862,7 @@ template FileCheckNumericVariable * FileCheckPatternContext::makeNumericVariable(Types... args) { NumericVariables.push_back( - llvm::make_unique(args...)); + std::make_unique(args...)); return NumericVariables.back().get(); } @@ -870,14 +870,14 @@ FileCheckSubstitution * FileCheckPatternContext::makeStringSubstitution(StringRef VarName, size_t InsertIdx) { Substitutions.push_back( - llvm::make_unique(this, VarName, InsertIdx)); + std::make_unique(this, VarName, InsertIdx)); return Substitutions.back().get(); } FileCheckSubstitution *FileCheckPatternContext::makeNumericSubstitution( StringRef ExpressionStr, std::unique_ptr ExpressionAST, size_t InsertIdx) { - Substitutions.push_back(llvm::make_unique( + Substitutions.push_back(std::make_unique( this, ExpressionStr, std::move(ExpressionAST), InsertIdx)); return Substitutions.back().get(); } diff --git a/lib/Support/FileOutputBuffer.cpp b/lib/Support/FileOutputBuffer.cpp index 3d6b569f299..024dd3e57a4 100644 --- a/lib/Support/FileOutputBuffer.cpp +++ b/lib/Support/FileOutputBuffer.cpp @@ -121,7 +121,7 @@ createInMemoryBuffer(StringRef Path, size_t Size, unsigned Mode) { Size, nullptr, sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC); if (EC) return errorCodeToError(EC); - return llvm::make_unique(Path, MB, Size, Mode); + return std::make_unique(Path, MB, Size, Mode); } static Expected> @@ -146,7 +146,7 @@ createOnDiskBuffer(StringRef Path, size_t Size, unsigned Mode) { // Mmap it. std::error_code EC; - auto MappedFile = llvm::make_unique( + auto MappedFile = std::make_unique( fs::convertFDToNativeFile(File.FD), fs::mapped_file_region::readwrite, Size, 0, EC); @@ -157,7 +157,7 @@ createOnDiskBuffer(StringRef Path, size_t Size, unsigned Mode) { return createInMemoryBuffer(Path, Size, Mode); } - return llvm::make_unique(Path, std::move(File), + return std::make_unique(Path, std::move(File), std::move(MappedFile)); } diff --git a/lib/Support/JSON.cpp b/lib/Support/JSON.cpp index 95e5ed65427..16b1d11efd0 100644 --- a/lib/Support/JSON.cpp +++ b/lib/Support/JSON.cpp @@ -502,7 +502,7 @@ bool Parser::parseError(const char *Msg) { } } Err.emplace( - llvm::make_unique(Msg, Line, P - StartOfLine, P - Start)); + std::make_unique(Msg, Line, P - StartOfLine, P - Start)); return false; } } // namespace diff --git a/lib/Support/SpecialCaseList.cpp b/lib/Support/SpecialCaseList.cpp index 96e09f9552b..9bd1f18a4ee 100644 --- a/lib/Support/SpecialCaseList.cpp +++ b/lib/Support/SpecialCaseList.cpp @@ -53,7 +53,7 @@ bool SpecialCaseList::Matcher::insert(std::string Regexp, return false; RegExes.emplace_back( - std::make_pair(make_unique(std::move(CheckRE)), LineNumber)); + std::make_pair(std::make_unique(std::move(CheckRE)), LineNumber)); return true; } @@ -175,7 +175,7 @@ bool SpecialCaseList::parse(const MemoryBuffer *MB, // Create this section if it has not been seen before. if (SectionsMap.find(Section) == SectionsMap.end()) { - std::unique_ptr M = make_unique(); + std::unique_ptr M = std::make_unique(); std::string REError; if (!M->insert(Section, LineNo, REError)) { Error = (Twine("malformed section ") + Section + ": '" + REError).str(); diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index 17de654a1de..10c9b8e0b32 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -58,23 +58,23 @@ namespace { std::unique_ptr llvm::CreateInfoOutputFile() { const std::string &OutputFilename = getLibSupportInfoOutputFilename(); if (OutputFilename.empty()) - return llvm::make_unique(2, false); // stderr. + return std::make_unique(2, false); // stderr. if (OutputFilename == "-") - return llvm::make_unique(1, false); // stdout. + return std::make_unique(1, false); // stdout. // Append mode is used because the info output file is opened and closed // each time -stats or -time-passes wants to print output to it. To // compensate for this, the test-suite Makefiles have code to delete the // info output file before running commands which write to it. std::error_code EC; - auto Result = llvm::make_unique( + auto Result = std::make_unique( OutputFilename, EC, sys::fs::OF_Append | sys::fs::OF_Text); if (!EC) return Result; errs() << "Error opening info-output-file '" << OutputFilename << " for appending!\n"; - return llvm::make_unique(2, false); // stderr. + return std::make_unique(2, false); // stderr. } namespace { diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index bf277aa3069..cbc03821940 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -443,7 +443,7 @@ static bool is_local_impl(struct STATVFS &Vfs) { std::unique_ptr Buf; int Tries = 3; while (Tries--) { - Buf = llvm::make_unique(BufSize); + Buf = std::make_unique(BufSize); Ret = mntctl(MCTL_QUERY, BufSize, Buf.get()); if (Ret != 0) break; diff --git a/lib/Support/VirtualFileSystem.cpp b/lib/Support/VirtualFileSystem.cpp index 5d3480e9714..e4197c18cc9 100644 --- a/lib/Support/VirtualFileSystem.cpp +++ b/lib/Support/VirtualFileSystem.cpp @@ -349,7 +349,7 @@ IntrusiveRefCntPtr vfs::getRealFileSystem() { } std::unique_ptr vfs::createPhysicalFileSystem() { - return llvm::make_unique(false); + return std::make_unique(false); } namespace { @@ -754,7 +754,7 @@ bool InMemoryFileSystem::addFile(const Twine &P, time_t ModificationTime, ResolvedUser, ResolvedGroup, 0, sys::fs::file_type::directory_file, NewDirectoryPerms); Dir = cast(Dir->addChild( - Name, llvm::make_unique(std::move(Stat)))); + Name, std::make_unique(std::move(Stat)))); continue; } @@ -1209,7 +1209,7 @@ class llvm::vfs::RedirectingFileSystemParser { // ... or create a new one std::unique_ptr E = - llvm::make_unique( + std::make_unique( Name, Status("", getNextVirtualUniqueID(), std::chrono::system_clock::now(), 0, 0, 0, file_type::directory_file, sys::fs::all_all)); @@ -1252,7 +1252,7 @@ class llvm::vfs::RedirectingFileSystemParser { auto *DE = dyn_cast( NewParentE); DE->addContent( - llvm::make_unique( + std::make_unique( Name, FE->getExternalContentsPath(), FE->getUseName())); break; } @@ -1423,12 +1423,12 @@ class llvm::vfs::RedirectingFileSystemParser { std::unique_ptr Result; switch (Kind) { case RedirectingFileSystem::EK_File: - Result = llvm::make_unique( + Result = std::make_unique( LastComponent, std::move(ExternalContentsPath), UseExternalName); break; case RedirectingFileSystem::EK_Directory: Result = - llvm::make_unique( + std::make_unique( LastComponent, std::move(EntryArrayContents), Status("", getNextVirtualUniqueID(), std::chrono::system_clock::now(), 0, 0, 0, @@ -1447,7 +1447,7 @@ class llvm::vfs::RedirectingFileSystemParser { std::vector> Entries; Entries.push_back(std::move(Result)); Result = - llvm::make_unique( + std::make_unique( *I, std::move(Entries), Status("", getNextVirtualUniqueID(), std::chrono::system_clock::now(), 0, 0, 0, @@ -1763,7 +1763,7 @@ RedirectingFileSystem::openFileForRead(const Twine &Path) { Status S = getRedirectedFileStatus(Path, F->useExternalName(UseExternalNames), *ExternalStatus); return std::unique_ptr( - llvm::make_unique(std::move(*Result), S)); + std::make_unique(std::move(*Result), S)); } std::error_code diff --git a/lib/Support/YAMLTraits.cpp b/lib/Support/YAMLTraits.cpp index 09eb36943de..7706fc3c1f2 100644 --- a/lib/Support/YAMLTraits.cpp +++ b/lib/Support/YAMLTraits.cpp @@ -377,12 +377,12 @@ std::unique_ptr Input::createHNodes(Node *N) { // Copy string to permanent storage KeyStr = StringStorage.str().copy(StringAllocator); } - return llvm::make_unique(N, KeyStr); + return std::make_unique(N, KeyStr); } else if (BlockScalarNode *BSN = dyn_cast(N)) { StringRef ValueCopy = BSN->getValue().copy(StringAllocator); - return llvm::make_unique(N, ValueCopy); + return std::make_unique(N, ValueCopy); } else if (SequenceNode *SQ = dyn_cast(N)) { - auto SQHNode = llvm::make_unique(N); + auto SQHNode = std::make_unique(N); for (Node &SN : *SQ) { auto Entry = createHNodes(&SN); if (EC) @@ -391,7 +391,7 @@ std::unique_ptr Input::createHNodes(Node *N) { } return std::move(SQHNode); } else if (MappingNode *Map = dyn_cast(N)) { - auto mapHNode = llvm::make_unique(N); + auto mapHNode = std::make_unique(N); for (KeyValueNode &KVN : *Map) { Node *KeyNode = KVN.getKey(); ScalarNode *Key = dyn_cast(KeyNode); @@ -416,7 +416,7 @@ std::unique_ptr Input::createHNodes(Node *N) { } return std::move(mapHNode); } else if (isa(N)) { - return llvm::make_unique(N); + return std::make_unique(N); } else { setError(N, "unknown node kind"); return nullptr; diff --git a/lib/Support/Z3Solver.cpp b/lib/Support/Z3Solver.cpp index f1a6fdf87cf..a83d0f441a4 100644 --- a/lib/Support/Z3Solver.cpp +++ b/lib/Support/Z3Solver.cpp @@ -886,7 +886,7 @@ public: llvm::SMTSolverRef llvm::CreateZ3Solver() { #if LLVM_WITH_Z3 - return llvm::make_unique(); + return std::make_unique(); #else llvm::report_fatal_error("LLVM was not compiled with Z3 support, rebuild " "with -DLLVM_ENABLE_Z3_SOLVER=ON", diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 27d1bdc7f4c..e4ab39df087 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -1616,7 +1616,7 @@ void VarDefInit::Profile(FoldingSetNodeID &ID) const { DefInit *VarDefInit::instantiate() { if (!Def) { RecordKeeper &Records = Class->getRecords(); - auto NewRecOwner = make_unique(Records.getNewAnonymousName(), + auto NewRecOwner = std::make_unique(Records.getNewAnonymousName(), Class->getLoc(), Records, /*IsAnonymous=*/true); Record *NewRec = NewRecOwner.get(); diff --git a/lib/TableGen/SetTheory.cpp b/lib/TableGen/SetTheory.cpp index a870e41d58f..5a30ee98cce 100644 --- a/lib/TableGen/SetTheory.cpp +++ b/lib/TableGen/SetTheory.cpp @@ -255,16 +255,16 @@ void SetTheory::Operator::anchor() {} void SetTheory::Expander::anchor() {} SetTheory::SetTheory() { - addOperator("add", llvm::make_unique()); - addOperator("sub", llvm::make_unique()); - addOperator("and", llvm::make_unique()); - addOperator("shl", llvm::make_unique()); - addOperator("trunc", llvm::make_unique()); - addOperator("rotl", llvm::make_unique(false)); - addOperator("rotr", llvm::make_unique(true)); - addOperator("decimate", llvm::make_unique()); - addOperator("interleave", llvm::make_unique()); - addOperator("sequence", llvm::make_unique()); + addOperator("add", std::make_unique()); + addOperator("sub", std::make_unique()); + addOperator("and", std::make_unique()); + addOperator("shl", std::make_unique()); + addOperator("trunc", std::make_unique()); + addOperator("rotl", std::make_unique(false)); + addOperator("rotr", std::make_unique(true)); + addOperator("decimate", std::make_unique()); + addOperator("interleave", std::make_unique()); + addOperator("sequence", std::make_unique()); } void SetTheory::addOperator(StringRef Name, std::unique_ptr Op) { @@ -276,7 +276,7 @@ void SetTheory::addExpander(StringRef ClassName, std::unique_ptr E) { } void SetTheory::addFieldExpander(StringRef ClassName, StringRef FieldName) { - addExpander(ClassName, llvm::make_unique(FieldName)); + addExpander(ClassName, std::make_unique(FieldName)); } void SetTheory::evaluate(Init *Expr, RecSet &Elts, ArrayRef Loc) { diff --git a/lib/TableGen/TGLexer.cpp b/lib/TableGen/TGLexer.cpp index d28c62b3133..da2286e41fe 100644 --- a/lib/TableGen/TGLexer.cpp +++ b/lib/TableGen/TGLexer.cpp @@ -51,7 +51,7 @@ TGLexer::TGLexer(SourceMgr &SM, ArrayRef Macros) : SrcMgr(SM) { // Pretend that we enter the "top-level" include file. PrepIncludeStack.push_back( - make_unique>()); + std::make_unique>()); // Put all macros defined in the command line into the DefinedMacros set. std::for_each(Macros.begin(), Macros.end(), @@ -393,7 +393,7 @@ bool TGLexer::LexInclude() { CurPtr = CurBuf.begin(); PrepIncludeStack.push_back( - make_unique>()); + std::make_unique>()); return false; } diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index a9ace152d59..a076966aff0 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -378,7 +378,7 @@ bool TGParser::resolve(const ForeachLoop &Loop, SubstStack &Substs, auto LI = dyn_cast(List); if (!LI) { if (!Final) { - Dest->emplace_back(make_unique(Loop.Loc, Loop.IterVar, + Dest->emplace_back(std::make_unique(Loop.Loc, Loop.IterVar, List)); return resolve(Loop.Entries, Substs, Final, &Dest->back().Loop->Entries, Loc); @@ -413,7 +413,7 @@ bool TGParser::resolve(const std::vector &Source, if (E.Loop) { Error = resolve(*E.Loop, Substs, Final, Dest); } else { - auto Rec = make_unique(*E.Rec); + auto Rec = std::make_unique(*E.Rec); if (Loc) Rec->appendLoc(*Loc); @@ -1330,7 +1330,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { std::unique_ptr ParseRecTmp; Record *ParseRec = CurRec; if (!ParseRec) { - ParseRecTmp = make_unique(".parse", ArrayRef{}, Records); + ParseRecTmp = std::make_unique(".parse", ArrayRef{}, Records); ParseRec = ParseRecTmp.get(); } @@ -1597,7 +1597,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { std::unique_ptr ParseRecTmp; Record *ParseRec = CurRec; if (!ParseRec) { - ParseRecTmp = make_unique(".parse", ArrayRef{}, Records); + ParseRecTmp = std::make_unique(".parse", ArrayRef{}, Records); ParseRec = ParseRecTmp.get(); } @@ -2702,10 +2702,10 @@ bool TGParser::ParseDef(MultiClass *CurMultiClass) { return true; if (isa(Name)) - CurRec = make_unique(Records.getNewAnonymousName(), DefLoc, Records, + CurRec = std::make_unique(Records.getNewAnonymousName(), DefLoc, Records, /*Anonymous=*/true); else - CurRec = make_unique(Name, DefLoc, Records); + CurRec = std::make_unique(Name, DefLoc, Records); if (ParseObjectBody(CurRec.get())) return true; @@ -2783,7 +2783,7 @@ bool TGParser::ParseForeach(MultiClass *CurMultiClass) { Lex.Lex(); // Eat the in // Create a loop object and remember it. - Loops.push_back(llvm::make_unique(Loc, IterName, ListValue)); + Loops.push_back(std::make_unique(Loc, IterName, ListValue)); if (Lex.getCode() != tgtok::l_brace) { // FOREACH Declaration IN Object @@ -2834,7 +2834,7 @@ bool TGParser::ParseClass() { } else { // If this is the first reference to this class, create and add it. auto NewRec = - llvm::make_unique(Lex.getCurStrVal(), Lex.getLoc(), Records, + std::make_unique(Lex.getCurStrVal(), Lex.getLoc(), Records, /*Class=*/true); CurRec = NewRec.get(); Records.addClass(std::move(NewRec)); @@ -2963,7 +2963,7 @@ bool TGParser::ParseMultiClass() { auto Result = MultiClasses.insert(std::make_pair(Name, - llvm::make_unique(Name, Lex.getLoc(),Records))); + std::make_unique(Name, Lex.getLoc(),Records))); if (!Result.second) return TokError("multiclass '" + Name + "' already defined"); diff --git a/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp b/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp index 9b28a0b69a7..13d389cec7a 100644 --- a/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp +++ b/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp @@ -616,7 +616,7 @@ void AArch64A57FPLoadBalancing::scanInstruction( LLVM_DEBUG(dbgs() << "New chain started for register " << printReg(DestReg, TRI) << " at " << *MI); - auto G = llvm::make_unique(MI, Idx, getColor(DestReg)); + auto G = std::make_unique(MI, Idx, getColor(DestReg)); ActiveChains[DestReg] = G.get(); AllChains.push_back(std::move(G)); @@ -661,7 +661,7 @@ void AArch64A57FPLoadBalancing::scanInstruction( LLVM_DEBUG(dbgs() << "Creating new chain for dest register " << printReg(DestReg, TRI) << "\n"); - auto G = llvm::make_unique(MI, Idx, getColor(DestReg)); + auto G = std::make_unique(MI, Idx, getColor(DestReg)); ActiveChains[DestReg] = G.get(); AllChains.push_back(std::move(G)); diff --git a/lib/Target/AArch64/AArch64Subtarget.cpp b/lib/Target/AArch64/AArch64Subtarget.cpp index f368a570ad2..05112afb417 100644 --- a/lib/Target/AArch64/AArch64Subtarget.cpp +++ b/lib/Target/AArch64/AArch64Subtarget.cpp @@ -291,7 +291,7 @@ bool AArch64Subtarget::supportsAddressTopByteIgnored() const { std::unique_ptr AArch64Subtarget::getCustomPBQPConstraints() const { - return balanceFPOps() ? llvm::make_unique() : nullptr; + return balanceFPOps() ? std::make_unique() : nullptr; } void AArch64Subtarget::mirFileLoaded(MachineFunction &MF) const { diff --git a/lib/Target/AArch64/AArch64TargetMachine.cpp b/lib/Target/AArch64/AArch64TargetMachine.cpp index 86546148049..f7a90759a20 100644 --- a/lib/Target/AArch64/AArch64TargetMachine.cpp +++ b/lib/Target/AArch64/AArch64TargetMachine.cpp @@ -187,11 +187,11 @@ extern "C" void LLVMInitializeAArch64Target() { //===----------------------------------------------------------------------===// static std::unique_ptr createTLOF(const Triple &TT) { if (TT.isOSBinFormatMachO()) - return llvm::make_unique(); + return std::make_unique(); if (TT.isOSBinFormatCOFF()) - return llvm::make_unique(); + return std::make_unique(); - return llvm::make_unique(); + return std::make_unique(); } // Helper function to build a DataLayout string @@ -310,7 +310,7 @@ AArch64TargetMachine::getSubtargetImpl(const Function &F) const { // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique(TargetTriple, CPU, FS, *this, + I = std::make_unique(TargetTriple, CPU, FS, *this, isLittle); } return I.get(); diff --git a/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp index d4af242512a..94ce04c6e34 100644 --- a/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ b/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -1800,7 +1800,7 @@ public: static std::unique_ptr CreateToken(StringRef Str, bool IsSuffix, SMLoc S, MCContext &Ctx) { - auto Op = make_unique(k_Token, Ctx); + auto Op = std::make_unique(k_Token, Ctx); Op->Tok.Data = Str.data(); Op->Tok.Length = Str.size(); Op->Tok.IsSuffix = IsSuffix; @@ -1815,7 +1815,7 @@ public: AArch64_AM::ShiftExtendType ExtTy = AArch64_AM::LSL, unsigned ShiftAmount = 0, unsigned HasExplicitAmount = false) { - auto Op = make_unique(k_Register, Ctx); + auto Op = std::make_unique(k_Register, Ctx); Op->Reg.RegNum = RegNum; Op->Reg.Kind = Kind; Op->Reg.ElementWidth = 0; @@ -1847,7 +1847,7 @@ public: CreateVectorList(unsigned RegNum, unsigned Count, unsigned NumElements, unsigned ElementWidth, RegKind RegisterKind, SMLoc S, SMLoc E, MCContext &Ctx) { - auto Op = make_unique(k_VectorList, Ctx); + auto Op = std::make_unique(k_VectorList, Ctx); Op->VectorList.RegNum = RegNum; Op->VectorList.Count = Count; Op->VectorList.NumElements = NumElements; @@ -1860,7 +1860,7 @@ public: static std::unique_ptr CreateVectorIndex(unsigned Idx, SMLoc S, SMLoc E, MCContext &Ctx) { - auto Op = make_unique(k_VectorIndex, Ctx); + auto Op = std::make_unique(k_VectorIndex, Ctx); Op->VectorIndex.Val = Idx; Op->StartLoc = S; Op->EndLoc = E; @@ -1869,7 +1869,7 @@ public: static std::unique_ptr CreateImm(const MCExpr *Val, SMLoc S, SMLoc E, MCContext &Ctx) { - auto Op = make_unique(k_Immediate, Ctx); + auto Op = std::make_unique(k_Immediate, Ctx); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -1880,7 +1880,7 @@ public: unsigned ShiftAmount, SMLoc S, SMLoc E, MCContext &Ctx) { - auto Op = make_unique(k_ShiftedImm, Ctx); + auto Op = std::make_unique(k_ShiftedImm, Ctx); Op->ShiftedImm .Val = Val; Op->ShiftedImm.ShiftAmount = ShiftAmount; Op->StartLoc = S; @@ -1890,7 +1890,7 @@ public: static std::unique_ptr CreateCondCode(AArch64CC::CondCode Code, SMLoc S, SMLoc E, MCContext &Ctx) { - auto Op = make_unique(k_CondCode, Ctx); + auto Op = std::make_unique(k_CondCode, Ctx); Op->CondCode.Code = Code; Op->StartLoc = S; Op->EndLoc = E; @@ -1899,7 +1899,7 @@ public: static std::unique_ptr CreateFPImm(APFloat Val, bool IsExact, SMLoc S, MCContext &Ctx) { - auto Op = make_unique(k_FPImm, Ctx); + auto Op = std::make_unique(k_FPImm, Ctx); Op->FPImm.Val = Val.bitcastToAPInt().getSExtValue(); Op->FPImm.IsExact = IsExact; Op->StartLoc = S; @@ -1911,7 +1911,7 @@ public: StringRef Str, SMLoc S, MCContext &Ctx) { - auto Op = make_unique(k_Barrier, Ctx); + auto Op = std::make_unique(k_Barrier, Ctx); Op->Barrier.Val = Val; Op->Barrier.Data = Str.data(); Op->Barrier.Length = Str.size(); @@ -1925,7 +1925,7 @@ public: uint32_t MSRReg, uint32_t PStateField, MCContext &Ctx) { - auto Op = make_unique(k_SysReg, Ctx); + auto Op = std::make_unique(k_SysReg, Ctx); Op->SysReg.Data = Str.data(); Op->SysReg.Length = Str.size(); Op->SysReg.MRSReg = MRSReg; @@ -1938,7 +1938,7 @@ public: static std::unique_ptr CreateSysCR(unsigned Val, SMLoc S, SMLoc E, MCContext &Ctx) { - auto Op = make_unique(k_SysCR, Ctx); + auto Op = std::make_unique(k_SysCR, Ctx); Op->SysCRImm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -1949,7 +1949,7 @@ public: StringRef Str, SMLoc S, MCContext &Ctx) { - auto Op = make_unique(k_Prefetch, Ctx); + auto Op = std::make_unique(k_Prefetch, Ctx); Op->Prefetch.Val = Val; Op->Barrier.Data = Str.data(); Op->Barrier.Length = Str.size(); @@ -1962,7 +1962,7 @@ public: StringRef Str, SMLoc S, MCContext &Ctx) { - auto Op = make_unique(k_PSBHint, Ctx); + auto Op = std::make_unique(k_PSBHint, Ctx); Op->PSBHint.Val = Val; Op->PSBHint.Data = Str.data(); Op->PSBHint.Length = Str.size(); @@ -1975,7 +1975,7 @@ public: StringRef Str, SMLoc S, MCContext &Ctx) { - auto Op = make_unique(k_BTIHint, Ctx); + auto Op = std::make_unique(k_BTIHint, Ctx); Op->BTIHint.Val = Val << 1 | 32; Op->BTIHint.Data = Str.data(); Op->BTIHint.Length = Str.size(); @@ -1987,7 +1987,7 @@ public: static std::unique_ptr CreateShiftExtend(AArch64_AM::ShiftExtendType ShOp, unsigned Val, bool HasExplicitAmount, SMLoc S, SMLoc E, MCContext &Ctx) { - auto Op = make_unique(k_ShiftExtend, Ctx); + auto Op = std::make_unique(k_ShiftExtend, Ctx); Op->ShiftExtend.Type = ShOp; Op->ShiftExtend.Amount = Val; Op->ShiftExtend.HasExplicitAmount = HasExplicitAmount; diff --git a/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp b/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp index d951683153e..81d1448a02c 100644 --- a/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp +++ b/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp @@ -448,5 +448,5 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx, std::unique_ptr llvm::createAArch64ELFObjectWriter(uint8_t OSABI, bool IsILP32) { - return llvm::make_unique(OSABI, IsILP32); + return std::make_unique(OSABI, IsILP32); } diff --git a/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp b/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp index b3ce5ef22ee..cb6eaeceeed 100644 --- a/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp +++ b/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp @@ -406,6 +406,6 @@ void AArch64MachObjectWriter::recordRelocation( std::unique_ptr llvm::createAArch64MachObjectWriter(uint32_t CPUType, uint32_t CPUSubtype, bool IsILP32) { - return llvm::make_unique(CPUType, CPUSubtype, + return std::make_unique(CPUType, CPUSubtype, IsILP32); } diff --git a/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp b/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp index a45880a0742..aa50bd05cb7 100644 --- a/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp +++ b/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp @@ -120,7 +120,7 @@ bool AArch64WinCOFFObjectWriter::recordRelocation(const MCFixup &Fixup) const { namespace llvm { std::unique_ptr createAArch64WinCOFFObjectWriter() { - return llvm::make_unique(); + return std::make_unique(); } } // end namespace llvm diff --git a/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h b/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h index 2eecddbd7b0..80ac8ca67bc 100644 --- a/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h +++ b/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h @@ -52,7 +52,7 @@ public: class MetadataStreamerV3 final : public MetadataStreamer { private: std::unique_ptr HSAMetadataDoc = - llvm::make_unique(); + std::make_unique(); void dump(StringRef HSAMetadataString) const; diff --git a/lib/Target/AMDGPU/AMDGPULibFunc.cpp b/lib/Target/AMDGPU/AMDGPULibFunc.cpp index a5bac25701a..ec2257f32f3 100644 --- a/lib/Target/AMDGPU/AMDGPULibFunc.cpp +++ b/lib/Target/AMDGPU/AMDGPULibFunc.cpp @@ -682,9 +682,9 @@ bool AMDGPULibFunc::parse(StringRef FuncName, AMDGPULibFunc &F) { } if (eatTerm(FuncName, "_Z")) - F.Impl = make_unique(); + F.Impl = std::make_unique(); else - F.Impl = make_unique(); + F.Impl = std::make_unique(); if (F.Impl->parseFuncName(FuncName)) return true; diff --git a/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/lib/Target/AMDGPU/AMDGPUSubtarget.cpp index f9a9679ac68..e2cdb659a23 100644 --- a/lib/Target/AMDGPU/AMDGPUSubtarget.cpp +++ b/lib/Target/AMDGPU/AMDGPUSubtarget.cpp @@ -881,8 +881,8 @@ struct FillMFMAShadowMutation : ScheduleDAGMutation { void GCNSubtarget::getPostRAMutations( std::vector> &Mutations) const { - Mutations.push_back(llvm::make_unique(&InstrInfo)); - Mutations.push_back(llvm::make_unique(&InstrInfo)); + Mutations.push_back(std::make_unique(&InstrInfo)); + Mutations.push_back(std::make_unique(&InstrInfo)); } const AMDGPUSubtarget &AMDGPUSubtarget::get(const MachineFunction &MF) { diff --git a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp index 8a64ee47765..ed947d0d38b 100644 --- a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -244,11 +244,11 @@ extern "C" void LLVMInitializeAMDGPUTarget() { } static std::unique_ptr createTLOF(const Triple &TT) { - return llvm::make_unique(); + return std::make_unique(); } static ScheduleDAGInstrs *createR600MachineScheduler(MachineSchedContext *C) { - return new ScheduleDAGMILive(C, llvm::make_unique()); + return new ScheduleDAGMILive(C, std::make_unique()); } static ScheduleDAGInstrs *createSIMachineScheduler(MachineSchedContext *C) { @@ -258,7 +258,7 @@ static ScheduleDAGInstrs *createSIMachineScheduler(MachineSchedContext *C) { static ScheduleDAGInstrs * createGCNMaxOccupancyMachineScheduler(MachineSchedContext *C) { ScheduleDAGMILive *DAG = - new GCNScheduleDAGMILive(C, make_unique(C)); + new GCNScheduleDAGMILive(C, std::make_unique(C)); DAG->addMutation(createLoadClusterDAGMutation(DAG->TII, DAG->TRI)); DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI)); DAG->addMutation(createAMDGPUMacroFusionDAGMutation()); @@ -484,7 +484,7 @@ const R600Subtarget *R600TargetMachine::getSubtargetImpl( // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique(TargetTriple, GPU, FS, *this); + I = std::make_unique(TargetTriple, GPU, FS, *this); } return I.get(); @@ -520,7 +520,7 @@ const GCNSubtarget *GCNTargetMachine::getSubtargetImpl(const Function &F) const // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique(TargetTriple, GPU, FS, *this); + I = std::make_unique(TargetTriple, GPU, FS, *this); } I->setScalarizeGlobalBehavior(ScalarizeGlobal); diff --git a/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp index 43d71425a3d..2ec44bdb910 100644 --- a/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ b/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -889,7 +889,7 @@ public: int64_t Val, SMLoc Loc, ImmTy Type = ImmTyNone, bool IsFPImm = false) { - auto Op = llvm::make_unique(Immediate, AsmParser); + auto Op = std::make_unique(Immediate, AsmParser); Op->Imm.Val = Val; Op->Imm.IsFPImm = IsFPImm; Op->Imm.Type = Type; @@ -902,7 +902,7 @@ public: static AMDGPUOperand::Ptr CreateToken(const AMDGPUAsmParser *AsmParser, StringRef Str, SMLoc Loc, bool HasExplicitEncodingSize = true) { - auto Res = llvm::make_unique(Token, AsmParser); + auto Res = std::make_unique(Token, AsmParser); Res->Tok.Data = Str.data(); Res->Tok.Length = Str.size(); Res->StartLoc = Loc; @@ -913,7 +913,7 @@ public: static AMDGPUOperand::Ptr CreateReg(const AMDGPUAsmParser *AsmParser, unsigned RegNo, SMLoc S, SMLoc E) { - auto Op = llvm::make_unique(Register, AsmParser); + auto Op = std::make_unique(Register, AsmParser); Op->Reg.RegNo = RegNo; Op->Reg.Mods = Modifiers(); Op->StartLoc = S; @@ -923,7 +923,7 @@ public: static AMDGPUOperand::Ptr CreateExpr(const AMDGPUAsmParser *AsmParser, const class MCExpr *Expr, SMLoc S) { - auto Op = llvm::make_unique(Expression, AsmParser); + auto Op = std::make_unique(Expression, AsmParser); Op->Expr = Expr; Op->StartLoc = S; Op->EndLoc = S; diff --git a/lib/Target/AMDGPU/GCNIterativeScheduler.cpp b/lib/Target/AMDGPU/GCNIterativeScheduler.cpp index 3525174223b..90ab6a14ce2 100644 --- a/lib/Target/AMDGPU/GCNIterativeScheduler.cpp +++ b/lib/Target/AMDGPU/GCNIterativeScheduler.cpp @@ -237,7 +237,7 @@ public: GCNIterativeScheduler::GCNIterativeScheduler(MachineSchedContext *C, StrategyKind S) - : BaseClass(C, llvm::make_unique()) + : BaseClass(C, std::make_unique()) , Context(C) , Strategy(S) , UPTracker(*LIS) { diff --git a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp index 6549a8d7d59..d352219a7a9 100644 --- a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp +++ b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp @@ -87,7 +87,7 @@ std::unique_ptr llvm::createAMDGPUELFObjectWriter(bool Is64Bit, uint8_t OSABI, bool HasRelocationAddend, uint8_t ABIVersion) { - return llvm::make_unique(Is64Bit, OSABI, + return std::make_unique(Is64Bit, OSABI, HasRelocationAddend, ABIVersion); } diff --git a/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/lib/Target/AMDGPU/SIInsertWaitcnts.cpp index c89d5b71ec5..dcb04e42658 100644 --- a/lib/Target/AMDGPU/SIInsertWaitcnts.cpp +++ b/lib/Target/AMDGPU/SIInsertWaitcnts.cpp @@ -1483,12 +1483,12 @@ bool SIInsertWaitcnts::runOnMachineFunction(MachineFunction &MF) { if (BI.Incoming) { if (!Brackets) - Brackets = llvm::make_unique(*BI.Incoming); + Brackets = std::make_unique(*BI.Incoming); else *Brackets = *BI.Incoming; } else { if (!Brackets) - Brackets = llvm::make_unique(ST); + Brackets = std::make_unique(ST); else Brackets->clear(); } @@ -1508,7 +1508,7 @@ bool SIInsertWaitcnts::runOnMachineFunction(MachineFunction &MF) { if (!MoveBracketsToSucc) { MoveBracketsToSucc = &SuccBI; } else { - SuccBI.Incoming = llvm::make_unique(*Brackets); + SuccBI.Incoming = std::make_unique(*Brackets); } } else if (SuccBI.Incoming->merge(*Brackets)) { SuccBI.Dirty = true; diff --git a/lib/Target/AMDGPU/SIMachineFunctionInfo.h b/lib/Target/AMDGPU/SIMachineFunctionInfo.h index f19b20ceb5d..6e4111eca1a 100644 --- a/lib/Target/AMDGPU/SIMachineFunctionInfo.h +++ b/lib/Target/AMDGPU/SIMachineFunctionInfo.h @@ -873,7 +873,7 @@ public: assert(BufferRsrc); auto PSV = BufferPSVs.try_emplace( BufferRsrc, - llvm::make_unique(TII)); + std::make_unique(TII)); return PSV.first->second.get(); } @@ -882,14 +882,14 @@ public: assert(ImgRsrc); auto PSV = ImagePSVs.try_emplace( ImgRsrc, - llvm::make_unique(TII)); + std::make_unique(TII)); return PSV.first->second.get(); } const AMDGPUGWSResourcePseudoSourceValue *getGWSPSV(const SIInstrInfo &TII) { if (!GWSResourcePSV) { GWSResourcePSV = - llvm::make_unique(TII); + std::make_unique(TII); } return GWSResourcePSV.get(); diff --git a/lib/Target/AMDGPU/SIMachineScheduler.cpp b/lib/Target/AMDGPU/SIMachineScheduler.cpp index 6372f2df399..c072ba6b2d1 100644 --- a/lib/Target/AMDGPU/SIMachineScheduler.cpp +++ b/lib/Target/AMDGPU/SIMachineScheduler.cpp @@ -1228,7 +1228,7 @@ void SIScheduleBlockCreator::createBlocksForVariant(SISchedulerBlockCreatorVaria unsigned Color = CurrentColoring[SU->NodeNum]; if (RealID.find(Color) == RealID.end()) { int ID = CurrentBlocks.size(); - BlockPtrs.push_back(llvm::make_unique(DAG, this, ID)); + BlockPtrs.push_back(std::make_unique(DAG, this, ID)); CurrentBlocks.push_back(BlockPtrs.rbegin()->get()); RealID[Color] = ID; } @@ -1801,7 +1801,7 @@ SIScheduler::scheduleVariant(SISchedulerBlockCreatorVariant BlockVariant, // SIScheduleDAGMI // SIScheduleDAGMI::SIScheduleDAGMI(MachineSchedContext *C) : - ScheduleDAGMILive(C, llvm::make_unique(C)) { + ScheduleDAGMILive(C, std::make_unique(C)) { SITII = static_cast(TII); SITRI = static_cast(TRI); diff --git a/lib/Target/AMDGPU/SIMemoryLegalizer.cpp b/lib/Target/AMDGPU/SIMemoryLegalizer.cpp index 4320e6c957a..e914573306a 100644 --- a/lib/Target/AMDGPU/SIMemoryLegalizer.cpp +++ b/lib/Target/AMDGPU/SIMemoryLegalizer.cpp @@ -656,10 +656,10 @@ SICacheControl::SICacheControl(const GCNSubtarget &ST) { std::unique_ptr SICacheControl::create(const GCNSubtarget &ST) { GCNSubtarget::Generation Generation = ST.getGeneration(); if (Generation <= AMDGPUSubtarget::SOUTHERN_ISLANDS) - return make_unique(ST); + return std::make_unique(ST); if (Generation < AMDGPUSubtarget::GFX10) - return make_unique(ST); - return make_unique(ST, ST.isCuModeEnabled()); + return std::make_unique(ST); + return std::make_unique(ST, ST.isCuModeEnabled()); } bool SIGfx6CacheControl::enableLoadCacheBypass( diff --git a/lib/Target/AMDGPU/SIModeRegister.cpp b/lib/Target/AMDGPU/SIModeRegister.cpp index a5edd7b3554..52989a280e8 100644 --- a/lib/Target/AMDGPU/SIModeRegister.cpp +++ b/lib/Target/AMDGPU/SIModeRegister.cpp @@ -226,7 +226,7 @@ void SIModeRegister::insertSetreg(MachineBasicBlock &MBB, MachineInstr *MI, // - on exit we have set the Require, Change, and initial Exit modes. void SIModeRegister::processBlockPhase1(MachineBasicBlock &MBB, const SIInstrInfo *TII) { - auto NewInfo = llvm::make_unique(); + auto NewInfo = std::make_unique(); MachineInstr *InsertionPoint = nullptr; // RequirePending is used to indicate whether we are collecting the initial // requirements for the block, and need to defer the first InsertionPoint to diff --git a/lib/Target/AMDGPU/SIPeepholeSDWA.cpp b/lib/Target/AMDGPU/SIPeepholeSDWA.cpp index 7888086085f..afb047c24df 100644 --- a/lib/Target/AMDGPU/SIPeepholeSDWA.cpp +++ b/lib/Target/AMDGPU/SIPeepholeSDWA.cpp @@ -580,10 +580,10 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) { if (Opcode == AMDGPU::V_LSHLREV_B32_e32 || Opcode == AMDGPU::V_LSHLREV_B32_e64) { - return make_unique( + return std::make_unique( Dst, Src1, *Imm == 16 ? WORD_1 : BYTE_3, UNUSED_PAD); } else { - return make_unique( + return std::make_unique( Src1, Dst, *Imm == 16 ? WORD_1 : BYTE_3, false, false, Opcode != AMDGPU::V_LSHRREV_B32_e32 && Opcode != AMDGPU::V_LSHRREV_B32_e64); @@ -619,9 +619,9 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) { if (Opcode == AMDGPU::V_LSHLREV_B16_e32 || Opcode == AMDGPU::V_LSHLREV_B16_e64) { - return make_unique(Dst, Src1, BYTE_1, UNUSED_PAD); + return std::make_unique(Dst, Src1, BYTE_1, UNUSED_PAD); } else { - return make_unique( + return std::make_unique( Src1, Dst, BYTE_1, false, false, Opcode != AMDGPU::V_LSHRREV_B16_e32 && Opcode != AMDGPU::V_LSHRREV_B16_e64); @@ -681,7 +681,7 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) { Register::isPhysicalRegister(Dst->getReg())) break; - return make_unique( + return std::make_unique( Src0, Dst, SrcSel, false, false, Opcode != AMDGPU::V_BFE_U32); } @@ -710,7 +710,7 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) { Register::isPhysicalRegister(Dst->getReg())) break; - return make_unique( + return std::make_unique( ValSrc, Dst, *Imm == 0x0000ffff ? WORD_0 : BYTE_0); } @@ -840,7 +840,7 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) { MachineOperand *OrDst = TII->getNamedOperand(MI, AMDGPU::OpName::vdst); assert(OrDst && OrDst->isReg()); - return make_unique( + return std::make_unique( OrDst, OrSDWADef, OrOtherDef, DstSel); } diff --git a/lib/Target/ARC/ARCTargetMachine.cpp b/lib/Target/ARC/ARCTargetMachine.cpp index 9fb45d686c2..34700dc22c5 100644 --- a/lib/Target/ARC/ARCTargetMachine.cpp +++ b/lib/Target/ARC/ARCTargetMachine.cpp @@ -38,7 +38,7 @@ ARCTargetMachine::ARCTargetMachine(const Target &T, const Triple &TT, "f32:32:32-i64:32-f64:32-a:0:32-n32", TT, CPU, FS, Options, getRelocModel(RM), getEffectiveCodeModel(CM, CodeModel::Small), OL), - TLOF(make_unique()), + TLOF(std::make_unique()), Subtarget(TT, CPU, FS, *this) { initAsmInfo(); } diff --git a/lib/Target/ARM/ARMParallelDSP.cpp b/lib/Target/ARM/ARMParallelDSP.cpp index 6ef03c644d1..1f15ddb85d4 100644 --- a/lib/Target/ARM/ARMParallelDSP.cpp +++ b/lib/Target/ARM/ARMParallelDSP.cpp @@ -92,7 +92,7 @@ namespace { /// Record a MulCandidate, rooted at a Mul instruction, that is a part of /// this reduction. void InsertMul(Instruction *I, Value *LHS, Value *RHS) { - Muls.push_back(make_unique(I, LHS, RHS)); + Muls.push_back(std::make_unique(I, LHS, RHS)); } /// Add the incoming accumulator value, returns true if a value had not @@ -707,7 +707,7 @@ LoadInst* ARMParallelDSP::CreateWideLoad(MemInstList &Loads, OffsetSExt->replaceAllUsesWith(NewOffsetSExt); WideLoads.emplace(std::make_pair(Base, - make_unique(Loads, WideLoad))); + std::make_unique(Loads, WideLoad))); return WideLoad; } diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index 7f0aae1739b..a8b324cd083 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -101,10 +101,10 @@ extern "C" void LLVMInitializeARMTarget() { static std::unique_ptr createTLOF(const Triple &TT) { if (TT.isOSBinFormatMachO()) - return llvm::make_unique(); + return std::make_unique(); if (TT.isOSWindows()) - return llvm::make_unique(); - return llvm::make_unique(); + return std::make_unique(); + return std::make_unique(); } static ARMBaseTargetMachine::ARMABI @@ -282,7 +282,7 @@ ARMBaseTargetMachine::getSubtargetImpl(const Function &F) const { // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique(TargetTriple, CPU, FS, *this, isLittle, + I = std::make_unique(TargetTriple, CPU, FS, *this, isLittle, F.hasMinSize()); if (!I->isThumb() && !I->hasARMOps()) diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 6b571add7f7..93b5254084a 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -3389,7 +3389,7 @@ public: void print(raw_ostream &OS) const override; static std::unique_ptr CreateITMask(unsigned Mask, SMLoc S) { - auto Op = make_unique(k_ITCondMask); + auto Op = std::make_unique(k_ITCondMask); Op->ITMask.Mask = Mask; Op->StartLoc = S; Op->EndLoc = S; @@ -3398,7 +3398,7 @@ public: static std::unique_ptr CreateCondCode(ARMCC::CondCodes CC, SMLoc S) { - auto Op = make_unique(k_CondCode); + auto Op = std::make_unique(k_CondCode); Op->CC.Val = CC; Op->StartLoc = S; Op->EndLoc = S; @@ -3407,7 +3407,7 @@ public: static std::unique_ptr CreateVPTPred(ARMVCC::VPTCodes CC, SMLoc S) { - auto Op = make_unique(k_VPTPred); + auto Op = std::make_unique(k_VPTPred); Op->VCC.Val = CC; Op->StartLoc = S; Op->EndLoc = S; @@ -3415,7 +3415,7 @@ public: } static std::unique_ptr CreateCoprocNum(unsigned CopVal, SMLoc S) { - auto Op = make_unique(k_CoprocNum); + auto Op = std::make_unique(k_CoprocNum); Op->Cop.Val = CopVal; Op->StartLoc = S; Op->EndLoc = S; @@ -3423,7 +3423,7 @@ public: } static std::unique_ptr CreateCoprocReg(unsigned CopVal, SMLoc S) { - auto Op = make_unique(k_CoprocReg); + auto Op = std::make_unique(k_CoprocReg); Op->Cop.Val = CopVal; Op->StartLoc = S; Op->EndLoc = S; @@ -3432,7 +3432,7 @@ public: static std::unique_ptr CreateCoprocOption(unsigned Val, SMLoc S, SMLoc E) { - auto Op = make_unique(k_CoprocOption); + auto Op = std::make_unique(k_CoprocOption); Op->Cop.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -3440,7 +3440,7 @@ public: } static std::unique_ptr CreateCCOut(unsigned RegNum, SMLoc S) { - auto Op = make_unique(k_CCOut); + auto Op = std::make_unique(k_CCOut); Op->Reg.RegNum = RegNum; Op->StartLoc = S; Op->EndLoc = S; @@ -3448,7 +3448,7 @@ public: } static std::unique_ptr CreateToken(StringRef Str, SMLoc S) { - auto Op = make_unique(k_Token); + auto Op = std::make_unique(k_Token); Op->Tok.Data = Str.data(); Op->Tok.Length = Str.size(); Op->StartLoc = S; @@ -3458,7 +3458,7 @@ public: static std::unique_ptr CreateReg(unsigned RegNum, SMLoc S, SMLoc E) { - auto Op = make_unique(k_Register); + auto Op = std::make_unique(k_Register); Op->Reg.RegNum = RegNum; Op->StartLoc = S; Op->EndLoc = E; @@ -3469,7 +3469,7 @@ public: CreateShiftedRegister(ARM_AM::ShiftOpc ShTy, unsigned SrcReg, unsigned ShiftReg, unsigned ShiftImm, SMLoc S, SMLoc E) { - auto Op = make_unique(k_ShiftedRegister); + auto Op = std::make_unique(k_ShiftedRegister); Op->RegShiftedReg.ShiftTy = ShTy; Op->RegShiftedReg.SrcReg = SrcReg; Op->RegShiftedReg.ShiftReg = ShiftReg; @@ -3482,7 +3482,7 @@ public: static std::unique_ptr CreateShiftedImmediate(ARM_AM::ShiftOpc ShTy, unsigned SrcReg, unsigned ShiftImm, SMLoc S, SMLoc E) { - auto Op = make_unique(k_ShiftedImmediate); + auto Op = std::make_unique(k_ShiftedImmediate); Op->RegShiftedImm.ShiftTy = ShTy; Op->RegShiftedImm.SrcReg = SrcReg; Op->RegShiftedImm.ShiftImm = ShiftImm; @@ -3493,7 +3493,7 @@ public: static std::unique_ptr CreateShifterImm(bool isASR, unsigned Imm, SMLoc S, SMLoc E) { - auto Op = make_unique(k_ShifterImmediate); + auto Op = std::make_unique(k_ShifterImmediate); Op->ShifterImm.isASR = isASR; Op->ShifterImm.Imm = Imm; Op->StartLoc = S; @@ -3503,7 +3503,7 @@ public: static std::unique_ptr CreateRotImm(unsigned Imm, SMLoc S, SMLoc E) { - auto Op = make_unique(k_RotateImmediate); + auto Op = std::make_unique(k_RotateImmediate); Op->RotImm.Imm = Imm; Op->StartLoc = S; Op->EndLoc = E; @@ -3512,7 +3512,7 @@ public: static std::unique_ptr CreateModImm(unsigned Bits, unsigned Rot, SMLoc S, SMLoc E) { - auto Op = make_unique(k_ModifiedImmediate); + auto Op = std::make_unique(k_ModifiedImmediate); Op->ModImm.Bits = Bits; Op->ModImm.Rot = Rot; Op->StartLoc = S; @@ -3522,7 +3522,7 @@ public: static std::unique_ptr CreateConstantPoolImm(const MCExpr *Val, SMLoc S, SMLoc E) { - auto Op = make_unique(k_ConstantPoolImmediate); + auto Op = std::make_unique(k_ConstantPoolImmediate); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -3531,7 +3531,7 @@ public: static std::unique_ptr CreateBitfield(unsigned LSB, unsigned Width, SMLoc S, SMLoc E) { - auto Op = make_unique(k_BitfieldDescriptor); + auto Op = std::make_unique(k_BitfieldDescriptor); Op->Bitfield.LSB = LSB; Op->Bitfield.Width = Width; Op->StartLoc = S; @@ -3565,7 +3565,7 @@ public: assert(std::is_sorted(Regs.begin(), Regs.end()) && "Register list must be sorted by encoding"); - auto Op = make_unique(Kind); + auto Op = std::make_unique(Kind); for (const auto &P : Regs) Op->Registers.push_back(P.second); @@ -3578,7 +3578,7 @@ public: unsigned Count, bool isDoubleSpaced, SMLoc S, SMLoc E) { - auto Op = make_unique(k_VectorList); + auto Op = std::make_unique(k_VectorList); Op->VectorList.RegNum = RegNum; Op->VectorList.Count = Count; Op->VectorList.isDoubleSpaced = isDoubleSpaced; @@ -3590,7 +3590,7 @@ public: static std::unique_ptr CreateVectorListAllLanes(unsigned RegNum, unsigned Count, bool isDoubleSpaced, SMLoc S, SMLoc E) { - auto Op = make_unique(k_VectorListAllLanes); + auto Op = std::make_unique(k_VectorListAllLanes); Op->VectorList.RegNum = RegNum; Op->VectorList.Count = Count; Op->VectorList.isDoubleSpaced = isDoubleSpaced; @@ -3602,7 +3602,7 @@ public: static std::unique_ptr CreateVectorListIndexed(unsigned RegNum, unsigned Count, unsigned Index, bool isDoubleSpaced, SMLoc S, SMLoc E) { - auto Op = make_unique(k_VectorListIndexed); + auto Op = std::make_unique(k_VectorListIndexed); Op->VectorList.RegNum = RegNum; Op->VectorList.Count = Count; Op->VectorList.LaneIndex = Index; @@ -3614,7 +3614,7 @@ public: static std::unique_ptr CreateVectorIndex(unsigned Idx, SMLoc S, SMLoc E, MCContext &Ctx) { - auto Op = make_unique(k_VectorIndex); + auto Op = std::make_unique(k_VectorIndex); Op->VectorIndex.Val = Idx; Op->StartLoc = S; Op->EndLoc = E; @@ -3623,7 +3623,7 @@ public: static std::unique_ptr CreateImm(const MCExpr *Val, SMLoc S, SMLoc E) { - auto Op = make_unique(k_Immediate); + auto Op = std::make_unique(k_Immediate); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -3635,7 +3635,7 @@ public: unsigned OffsetRegNum, ARM_AM::ShiftOpc ShiftType, unsigned ShiftImm, unsigned Alignment, bool isNegative, SMLoc S, SMLoc E, SMLoc AlignmentLoc = SMLoc()) { - auto Op = make_unique(k_Memory); + auto Op = std::make_unique(k_Memory); Op->Memory.BaseRegNum = BaseRegNum; Op->Memory.OffsetImm = OffsetImm; Op->Memory.OffsetRegNum = OffsetRegNum; @@ -3652,7 +3652,7 @@ public: static std::unique_ptr CreatePostIdxReg(unsigned RegNum, bool isAdd, ARM_AM::ShiftOpc ShiftTy, unsigned ShiftImm, SMLoc S, SMLoc E) { - auto Op = make_unique(k_PostIndexRegister); + auto Op = std::make_unique(k_PostIndexRegister); Op->PostIdxReg.RegNum = RegNum; Op->PostIdxReg.isAdd = isAdd; Op->PostIdxReg.ShiftTy = ShiftTy; @@ -3664,7 +3664,7 @@ public: static std::unique_ptr CreateMemBarrierOpt(ARM_MB::MemBOpt Opt, SMLoc S) { - auto Op = make_unique(k_MemBarrierOpt); + auto Op = std::make_unique(k_MemBarrierOpt); Op->MBOpt.Val = Opt; Op->StartLoc = S; Op->EndLoc = S; @@ -3673,7 +3673,7 @@ public: static std::unique_ptr CreateInstSyncBarrierOpt(ARM_ISB::InstSyncBOpt Opt, SMLoc S) { - auto Op = make_unique(k_InstSyncBarrierOpt); + auto Op = std::make_unique(k_InstSyncBarrierOpt); Op->ISBOpt.Val = Opt; Op->StartLoc = S; Op->EndLoc = S; @@ -3682,7 +3682,7 @@ public: static std::unique_ptr CreateTraceSyncBarrierOpt(ARM_TSB::TraceSyncBOpt Opt, SMLoc S) { - auto Op = make_unique(k_TraceSyncBarrierOpt); + auto Op = std::make_unique(k_TraceSyncBarrierOpt); Op->TSBOpt.Val = Opt; Op->StartLoc = S; Op->EndLoc = S; @@ -3691,7 +3691,7 @@ public: static std::unique_ptr CreateProcIFlags(ARM_PROC::IFlags IFlags, SMLoc S) { - auto Op = make_unique(k_ProcIFlags); + auto Op = std::make_unique(k_ProcIFlags); Op->IFlags.Val = IFlags; Op->StartLoc = S; Op->EndLoc = S; @@ -3699,7 +3699,7 @@ public: } static std::unique_ptr CreateMSRMask(unsigned MMask, SMLoc S) { - auto Op = make_unique(k_MSRMask); + auto Op = std::make_unique(k_MSRMask); Op->MMask.Val = MMask; Op->StartLoc = S; Op->EndLoc = S; @@ -3707,7 +3707,7 @@ public: } static std::unique_ptr CreateBankedReg(unsigned Reg, SMLoc S) { - auto Op = make_unique(k_BankedReg); + auto Op = std::make_unique(k_BankedReg); Op->BankedReg.Val = Reg; Op->StartLoc = S; Op->EndLoc = S; diff --git a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp b/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp index fda19eea1de..3f5b5b81138 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp @@ -263,5 +263,5 @@ void ARMELFObjectWriter::addTargetSectionFlags(MCContext &Ctx, std::unique_ptr llvm::createARMELFObjectWriter(uint8_t OSABI) { - return llvm::make_unique(OSABI); + return std::make_unique(OSABI); } diff --git a/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp b/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp index c49885023cb..756b0b909c3 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp @@ -506,5 +506,5 @@ void ARMMachObjectWriter::recordRelocation(MachObjectWriter *Writer, std::unique_ptr llvm::createARMMachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype) { - return llvm::make_unique(Is64Bit, CPUType, CPUSubtype); + return std::make_unique(Is64Bit, CPUType, CPUSubtype); } diff --git a/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp b/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp index 054a95dd1e1..900c5fe3036 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp @@ -92,7 +92,7 @@ namespace llvm { std::unique_ptr createARMWinCOFFObjectWriter(bool Is64Bit) { - return llvm::make_unique(Is64Bit); + return std::make_unique(Is64Bit); } } // end namespace llvm diff --git a/lib/Target/AVR/AVRTargetMachine.cpp b/lib/Target/AVR/AVRTargetMachine.cpp index a36c8b0f964..25304280d00 100644 --- a/lib/Target/AVR/AVRTargetMachine.cpp +++ b/lib/Target/AVR/AVRTargetMachine.cpp @@ -50,7 +50,7 @@ AVRTargetMachine::AVRTargetMachine(const Target &T, const Triple &TT, getEffectiveRelocModel(RM), getEffectiveCodeModel(CM, CodeModel::Small), OL), SubTarget(TT, getCPU(CPU), FS, *this) { - this->TLOF = make_unique(); + this->TLOF = std::make_unique(); initAsmInfo(); } diff --git a/lib/Target/AVR/AsmParser/AVRAsmParser.cpp b/lib/Target/AVR/AsmParser/AVRAsmParser.cpp index aac5644711e..af60bc4fdc9 100644 --- a/lib/Target/AVR/AsmParser/AVRAsmParser.cpp +++ b/lib/Target/AVR/AsmParser/AVRAsmParser.cpp @@ -199,22 +199,22 @@ public: } static std::unique_ptr CreateToken(StringRef Str, SMLoc S) { - return make_unique(Str, S); + return std::make_unique(Str, S); } static std::unique_ptr CreateReg(unsigned RegNum, SMLoc S, SMLoc E) { - return make_unique(RegNum, S, E); + return std::make_unique(RegNum, S, E); } static std::unique_ptr CreateImm(const MCExpr *Val, SMLoc S, SMLoc E) { - return make_unique(Val, S, E); + return std::make_unique(Val, S, E); } static std::unique_ptr CreateMemri(unsigned RegNum, const MCExpr *Val, SMLoc S, SMLoc E) { - return make_unique(RegNum, Val, S, E); + return std::make_unique(RegNum, Val, S, E); } void makeToken(StringRef Token) { diff --git a/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp b/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp index 6025e4b2437..1c69fea5962 100644 --- a/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp +++ b/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp @@ -152,7 +152,7 @@ unsigned AVRELFObjectWriter::getRelocType(MCContext &Ctx, } std::unique_ptr createAVRELFObjectWriter(uint8_t OSABI) { - return make_unique(OSABI); + return std::make_unique(OSABI); } } // end of namespace llvm diff --git a/lib/Target/BPF/AsmParser/BPFAsmParser.cpp b/lib/Target/BPF/AsmParser/BPFAsmParser.cpp index 75885fd058a..ce1d2ecd9d2 100644 --- a/lib/Target/BPF/AsmParser/BPFAsmParser.cpp +++ b/lib/Target/BPF/AsmParser/BPFAsmParser.cpp @@ -194,7 +194,7 @@ public: } static std::unique_ptr createToken(StringRef Str, SMLoc S) { - auto Op = make_unique(Token); + auto Op = std::make_unique(Token); Op->Tok = Str; Op->StartLoc = S; Op->EndLoc = S; @@ -203,7 +203,7 @@ public: static std::unique_ptr createReg(unsigned RegNo, SMLoc S, SMLoc E) { - auto Op = make_unique(Register); + auto Op = std::make_unique(Register); Op->Reg.RegNum = RegNo; Op->StartLoc = S; Op->EndLoc = E; @@ -212,7 +212,7 @@ public: static std::unique_ptr createImm(const MCExpr *Val, SMLoc S, SMLoc E) { - auto Op = make_unique(Immediate); + auto Op = std::make_unique(Immediate); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; diff --git a/lib/Target/BPF/BPFTargetMachine.cpp b/lib/Target/BPF/BPFTargetMachine.cpp index 24c0ff0f7f1..a69a8067753 100644 --- a/lib/Target/BPF/BPFTargetMachine.cpp +++ b/lib/Target/BPF/BPFTargetMachine.cpp @@ -61,7 +61,7 @@ BPFTargetMachine::BPFTargetMachine(const Target &T, const Triple &TT, : LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options, getEffectiveRelocModel(RM), getEffectiveCodeModel(CM, CodeModel::Small), OL), - TLOF(make_unique()), + TLOF(std::make_unique()), Subtarget(TT, CPU, FS, *this) { initAsmInfo(); diff --git a/lib/Target/BPF/BTFDebug.cpp b/lib/Target/BPF/BTFDebug.cpp index 9b966ebe73b..3d08ca63a4b 100644 --- a/lib/Target/BPF/BTFDebug.cpp +++ b/lib/Target/BPF/BTFDebug.cpp @@ -412,7 +412,7 @@ void BTFDebug::visitBasicType(const DIBasicType *BTy, uint32_t &TypeId) { // Create a BTF type instance for this DIBasicType and put it into // DIToIdMap for cross-type reference check. - auto TypeEntry = llvm::make_unique( + auto TypeEntry = std::make_unique( Encoding, BTy->getSizeInBits(), BTy->getOffsetInBits(), BTy->getName()); TypeId = addType(std::move(TypeEntry), BTy); } @@ -431,7 +431,7 @@ void BTFDebug::visitSubroutineType( // a function pointer has an empty name. The subprogram type will // not be added to DIToIdMap as it should not be referenced by // any other types. - auto TypeEntry = llvm::make_unique(STy, VLen, FuncArgNames); + auto TypeEntry = std::make_unique(STy, VLen, FuncArgNames); if (ForSubprog) TypeId = addType(std::move(TypeEntry)); // For subprogram else @@ -462,7 +462,7 @@ void BTFDebug::visitStructType(const DICompositeType *CTy, bool IsStruct, } auto TypeEntry = - llvm::make_unique(CTy, IsStruct, HasBitField, VLen); + std::make_unique(CTy, IsStruct, HasBitField, VLen); StructTypes.push_back(TypeEntry.get()); TypeId = addType(std::move(TypeEntry), CTy); @@ -481,7 +481,7 @@ void BTFDebug::visitArrayType(const DICompositeType *CTy, uint32_t &TypeId) { ElemSize = ElemType->getSizeInBits() >> 3; if (!CTy->getSizeInBits()) { - auto TypeEntry = llvm::make_unique(ElemTypeId, 0); + auto TypeEntry = std::make_unique(ElemTypeId, 0); ElemTypeId = addType(std::move(TypeEntry), CTy); } else { // Visit array dimensions. @@ -494,7 +494,7 @@ void BTFDebug::visitArrayType(const DICompositeType *CTy, uint32_t &TypeId) { int64_t Count = CI->getSExtValue(); auto TypeEntry = - llvm::make_unique(ElemTypeId, Count); + std::make_unique(ElemTypeId, Count); if (I == 0) ElemTypeId = addType(std::move(TypeEntry), CTy); else @@ -510,7 +510,7 @@ void BTFDebug::visitArrayType(const DICompositeType *CTy, uint32_t &TypeId) { // The IR does not have a type for array index while BTF wants one. // So create an array index type if there is none. if (!ArrayIndexTypeId) { - auto TypeEntry = llvm::make_unique(dwarf::DW_ATE_unsigned, 32, + auto TypeEntry = std::make_unique(dwarf::DW_ATE_unsigned, 32, 0, "__ARRAY_SIZE_TYPE__"); ArrayIndexTypeId = addType(std::move(TypeEntry)); } @@ -522,7 +522,7 @@ void BTFDebug::visitEnumType(const DICompositeType *CTy, uint32_t &TypeId) { if (VLen > BTF::MAX_VLEN) return; - auto TypeEntry = llvm::make_unique(CTy, VLen); + auto TypeEntry = std::make_unique(CTy, VLen); TypeId = addType(std::move(TypeEntry), CTy); // No need to visit base type as BTF does not encode it. } @@ -530,7 +530,7 @@ void BTFDebug::visitEnumType(const DICompositeType *CTy, uint32_t &TypeId) { /// Handle structure/union forward declarations. void BTFDebug::visitFwdDeclType(const DICompositeType *CTy, bool IsUnion, uint32_t &TypeId) { - auto TypeEntry = llvm::make_unique(CTy->getName(), IsUnion); + auto TypeEntry = std::make_unique(CTy->getName(), IsUnion); TypeId = addType(std::move(TypeEntry), CTy); } @@ -572,7 +572,7 @@ void BTFDebug::visitDerivedType(const DIDerivedType *DTy, uint32_t &TypeId, /// Find a candidate, generate a fixup. Later on the struct/union /// pointee type will be replaced with either a real type or /// a forward declaration. - auto TypeEntry = llvm::make_unique(DTy, Tag, true); + auto TypeEntry = std::make_unique(DTy, Tag, true); auto &Fixup = FixupDerivedTypes[CTy->getName()]; Fixup.first = CTag == dwarf::DW_TAG_union_type; Fixup.second.push_back(TypeEntry.get()); @@ -586,7 +586,7 @@ void BTFDebug::visitDerivedType(const DIDerivedType *DTy, uint32_t &TypeId, if (Tag == dwarf::DW_TAG_pointer_type || Tag == dwarf::DW_TAG_typedef || Tag == dwarf::DW_TAG_const_type || Tag == dwarf::DW_TAG_volatile_type || Tag == dwarf::DW_TAG_restrict_type) { - auto TypeEntry = llvm::make_unique(DTy, Tag, false); + auto TypeEntry = std::make_unique(DTy, Tag, false); TypeId = addType(std::move(TypeEntry), DTy); } else if (Tag != dwarf::DW_TAG_member) { return; @@ -653,7 +653,7 @@ void BTFDebug::visitMapDefType(const DIType *Ty, uint32_t &TypeId) { } auto TypeEntry = - llvm::make_unique(CTy, true, HasBitField, Elements.size()); + std::make_unique(CTy, true, HasBitField, Elements.size()); StructTypes.push_back(TypeEntry.get()); TypeId = addType(std::move(TypeEntry), CTy); @@ -926,7 +926,7 @@ void BTFDebug::beginFunctionImpl(const MachineFunction *MF) { // Construct subprogram func type auto FuncTypeEntry = - llvm::make_unique(SP->getName(), ProtoTypeId); + std::make_unique(SP->getName(), ProtoTypeId); uint32_t FuncTypeId = addType(std::move(FuncTypeEntry)); for (const auto &TypeEntry : TypeEntries) @@ -1136,12 +1136,12 @@ void BTFDebug::processGlobals(bool ProcessingMapDef) { ? BTF::VAR_GLOBAL_ALLOCATED : BTF::VAR_STATIC; auto VarEntry = - llvm::make_unique(Global.getName(), GVTypeId, GVarInfo); + std::make_unique(Global.getName(), GVTypeId, GVarInfo); uint32_t VarId = addType(std::move(VarEntry)); // Find or create a DataSec if (DataSecEntries.find(SecName) == DataSecEntries.end()) { - DataSecEntries[SecName] = llvm::make_unique(Asm, SecName); + DataSecEntries[SecName] = std::make_unique(Asm, SecName); } // Calculate symbol size @@ -1217,7 +1217,7 @@ void BTFDebug::endModule() { } if (StructTypeId == 0) { - auto FwdTypeEntry = llvm::make_unique(TypeName, IsUnion); + auto FwdTypeEntry = std::make_unique(TypeName, IsUnion); StructTypeId = addType(std::move(FwdTypeEntry)); } diff --git a/lib/Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp b/lib/Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp index 057bbf5c3b0..6ebf9511412 100644 --- a/lib/Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp +++ b/lib/Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp @@ -85,5 +85,5 @@ unsigned BPFELFObjectWriter::getRelocType(MCContext &Ctx, const MCValue &Target, std::unique_ptr llvm::createBPFELFObjectWriter(uint8_t OSABI) { - return llvm::make_unique(OSABI); + return std::make_unique(OSABI); } diff --git a/lib/Target/Hexagon/HexagonSubtarget.cpp b/lib/Target/Hexagon/HexagonSubtarget.cpp index 31dac55db2d..ee943a0d2c5 100644 --- a/lib/Target/Hexagon/HexagonSubtarget.cpp +++ b/lib/Target/Hexagon/HexagonSubtarget.cpp @@ -374,15 +374,15 @@ void HexagonSubtarget::adjustSchedDependency(SUnit *Src, SUnit *Dst, void HexagonSubtarget::getPostRAMutations( std::vector> &Mutations) const { - Mutations.push_back(llvm::make_unique()); - Mutations.push_back(llvm::make_unique()); - Mutations.push_back(llvm::make_unique()); + Mutations.push_back(std::make_unique()); + Mutations.push_back(std::make_unique()); + Mutations.push_back(std::make_unique()); } void HexagonSubtarget::getSMSMutations( std::vector> &Mutations) const { - Mutations.push_back(llvm::make_unique()); - Mutations.push_back(llvm::make_unique()); + Mutations.push_back(std::make_unique()); + Mutations.push_back(std::make_unique()); } // Pin the vtable to this file. diff --git a/lib/Target/Hexagon/HexagonTargetMachine.cpp b/lib/Target/Hexagon/HexagonTargetMachine.cpp index 80b8480448f..d709a82be66 100644 --- a/lib/Target/Hexagon/HexagonTargetMachine.cpp +++ b/lib/Target/Hexagon/HexagonTargetMachine.cpp @@ -111,10 +111,10 @@ int HexagonTargetMachineModule = 0; static ScheduleDAGInstrs *createVLIWMachineSched(MachineSchedContext *C) { ScheduleDAGMILive *DAG = - new VLIWMachineScheduler(C, make_unique()); - DAG->addMutation(make_unique()); - DAG->addMutation(make_unique()); - DAG->addMutation(make_unique()); + new VLIWMachineScheduler(C, std::make_unique()); + DAG->addMutation(std::make_unique()); + DAG->addMutation(std::make_unique()); + DAG->addMutation(std::make_unique()); DAG->addMutation(createCopyConstrainDAGMutation(DAG->TII, DAG->TRI)); return DAG; } @@ -218,7 +218,7 @@ HexagonTargetMachine::HexagonTargetMachine(const Target &T, const Triple &TT, TT, CPU, FS, Options, getEffectiveRelocModel(RM), getEffectiveCodeModel(CM, CodeModel::Small), (HexagonNoOpt ? CodeGenOpt::None : OL)), - TLOF(make_unique()) { + TLOF(std::make_unique()) { initializeHexagonExpandCondsetsPass(*PassRegistry::getPassRegistry()); initAsmInfo(); } @@ -244,7 +244,7 @@ HexagonTargetMachine::getSubtargetImpl(const Function &F) const { // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique(TargetTriple, CPU, FS, *this); + I = std::make_unique(TargetTriple, CPU, FS, *this); } return I.get(); } diff --git a/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp b/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp index 3619e4c239d..cc1f714573d 100644 --- a/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp +++ b/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp @@ -136,9 +136,9 @@ HexagonPacketizerList::HexagonPacketizerList(MachineFunction &MF, HII = MF.getSubtarget().getInstrInfo(); HRI = MF.getSubtarget().getRegisterInfo(); - addMutation(llvm::make_unique()); - addMutation(llvm::make_unique()); - addMutation(llvm::make_unique()); + addMutation(std::make_unique()); + addMutation(std::make_unique()); + addMutation(std::make_unique()); } // Check if FirstI modifies a register that SecondI reads. diff --git a/lib/Target/Hexagon/MCTargetDesc/HexagonELFObjectWriter.cpp b/lib/Target/Hexagon/MCTargetDesc/HexagonELFObjectWriter.cpp index f678bf49322..d955e11b914 100644 --- a/lib/Target/Hexagon/MCTargetDesc/HexagonELFObjectWriter.cpp +++ b/lib/Target/Hexagon/MCTargetDesc/HexagonELFObjectWriter.cpp @@ -299,5 +299,5 @@ unsigned HexagonELFObjectWriter::getRelocType(MCContext &Ctx, std::unique_ptr llvm::createHexagonELFObjectWriter(uint8_t OSABI, StringRef CPU) { - return llvm::make_unique(OSABI, CPU); + return std::make_unique(OSABI, CPU); } diff --git a/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp b/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp index 9af8a0b35b2..b629a24a99f 100644 --- a/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp +++ b/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp @@ -580,7 +580,7 @@ public: } static std::unique_ptr CreateToken(StringRef Str, SMLoc Start) { - auto Op = make_unique(TOKEN); + auto Op = std::make_unique(TOKEN); Op->Tok.Data = Str.data(); Op->Tok.Length = Str.size(); Op->StartLoc = Start; @@ -590,7 +590,7 @@ public: static std::unique_ptr createReg(unsigned RegNum, SMLoc Start, SMLoc End) { - auto Op = make_unique(REGISTER); + auto Op = std::make_unique(REGISTER); Op->Reg.RegNum = RegNum; Op->StartLoc = Start; Op->EndLoc = End; @@ -599,7 +599,7 @@ public: static std::unique_ptr createImm(const MCExpr *Value, SMLoc Start, SMLoc End) { - auto Op = make_unique(IMMEDIATE); + auto Op = std::make_unique(IMMEDIATE); Op->Imm.Value = Value; Op->StartLoc = Start; Op->EndLoc = End; diff --git a/lib/Target/Lanai/MCTargetDesc/LanaiELFObjectWriter.cpp b/lib/Target/Lanai/MCTargetDesc/LanaiELFObjectWriter.cpp index 4313fa5a82b..919d43ad9b9 100644 --- a/lib/Target/Lanai/MCTargetDesc/LanaiELFObjectWriter.cpp +++ b/lib/Target/Lanai/MCTargetDesc/LanaiELFObjectWriter.cpp @@ -88,5 +88,5 @@ bool LanaiELFObjectWriter::needsRelocateWithSymbol(const MCSymbol & /*SD*/, std::unique_ptr llvm::createLanaiELFObjectWriter(uint8_t OSABI) { - return llvm::make_unique(OSABI); + return std::make_unique(OSABI); } diff --git a/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp b/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp index a0ec14ae238..85dcc0f152f 100644 --- a/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp +++ b/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp @@ -191,33 +191,33 @@ public: } static std::unique_ptr CreateToken(StringRef Str, SMLoc S) { - return make_unique(Str, S); + return std::make_unique(Str, S); } static std::unique_ptr CreateReg(unsigned RegNum, SMLoc S, SMLoc E) { - return make_unique(k_Reg, RegNum, S, E); + return std::make_unique(k_Reg, RegNum, S, E); } static std::unique_ptr CreateImm(const MCExpr *Val, SMLoc S, SMLoc E) { - return make_unique(Val, S, E); + return std::make_unique(Val, S, E); } static std::unique_ptr CreateMem(unsigned RegNum, const MCExpr *Val, SMLoc S, SMLoc E) { - return make_unique(RegNum, Val, S, E); + return std::make_unique(RegNum, Val, S, E); } static std::unique_ptr CreateIndReg(unsigned RegNum, SMLoc S, SMLoc E) { - return make_unique(k_IndReg, RegNum, S, E); + return std::make_unique(k_IndReg, RegNum, S, E); } static std::unique_ptr CreatePostIndReg(unsigned RegNum, SMLoc S, SMLoc E) { - return make_unique(k_PostIndReg, RegNum, S, E); + return std::make_unique(k_PostIndReg, RegNum, S, E); } SMLoc getStartLoc() const { return Start; } diff --git a/lib/Target/MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp b/lib/Target/MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp index 38b7da32c24..6c21aa66db6 100644 --- a/lib/Target/MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp +++ b/lib/Target/MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp @@ -54,5 +54,5 @@ protected: std::unique_ptr llvm::createMSP430ELFObjectWriter(uint8_t OSABI) { - return llvm::make_unique(OSABI); + return std::make_unique(OSABI); } diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp index 8c4ca982c96..e9aeba76de8 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -46,7 +46,7 @@ MSP430TargetMachine::MSP430TargetMachine(const Target &T, const Triple &TT, : LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options), TT, CPU, FS, Options, getEffectiveRelocModel(RM), getEffectiveCodeModel(CM, CodeModel::Small), OL), - TLOF(make_unique()), + TLOF(std::make_unique()), Subtarget(TT, CPU, FS, *this) { initAsmInfo(); } diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index d7396b66048..8e6abd5b8e6 100644 --- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -512,11 +512,11 @@ public: // Remember the initial assembler options. The user can not modify these. AssemblerOptions.push_back( - llvm::make_unique(getSTI().getFeatureBits())); + std::make_unique(getSTI().getFeatureBits())); // Create an assembler options environment for the user to modify. AssemblerOptions.push_back( - llvm::make_unique(getSTI().getFeatureBits())); + std::make_unique(getSTI().getFeatureBits())); getTargetStreamer().updateABIInfo(*this); @@ -844,7 +844,7 @@ private: const MCRegisterInfo *RegInfo, SMLoc S, SMLoc E, MipsAsmParser &Parser) { - auto Op = llvm::make_unique(k_RegisterIndex, Parser); + auto Op = std::make_unique(k_RegisterIndex, Parser); Op->RegIdx.Index = Index; Op->RegIdx.RegInfo = RegInfo; Op->RegIdx.Kind = RegKind; @@ -1446,7 +1446,7 @@ public: static std::unique_ptr CreateToken(StringRef Str, SMLoc S, MipsAsmParser &Parser) { - auto Op = llvm::make_unique(k_Token, Parser); + auto Op = std::make_unique(k_Token, Parser); Op->Tok.Data = Str.data(); Op->Tok.Length = Str.size(); Op->StartLoc = S; @@ -1521,7 +1521,7 @@ public: static std::unique_ptr CreateImm(const MCExpr *Val, SMLoc S, SMLoc E, MipsAsmParser &Parser) { - auto Op = llvm::make_unique(k_Immediate, Parser); + auto Op = std::make_unique(k_Immediate, Parser); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -1531,7 +1531,7 @@ public: static std::unique_ptr CreateMem(std::unique_ptr Base, const MCExpr *Off, SMLoc S, SMLoc E, MipsAsmParser &Parser) { - auto Op = llvm::make_unique(k_Memory, Parser); + auto Op = std::make_unique(k_Memory, Parser); Op->Mem.Base = Base.release(); Op->Mem.Off = Off; Op->StartLoc = S; @@ -1544,7 +1544,7 @@ public: MipsAsmParser &Parser) { assert(Regs.size() > 0 && "Empty list not allowed"); - auto Op = llvm::make_unique(k_RegList, Parser); + auto Op = std::make_unique(k_RegList, Parser); Op->RegList.List = new SmallVector(Regs.begin(), Regs.end()); Op->StartLoc = StartLoc; Op->EndLoc = EndLoc; @@ -7016,7 +7016,7 @@ bool MipsAsmParser::parseSetPushDirective() { // Create a copy of the current assembler options environment and push it. AssemblerOptions.push_back( - llvm::make_unique(AssemblerOptions.back().get())); + std::make_unique(AssemblerOptions.back().get())); getTargetStreamer().emitDirectiveSetPush(); return false; diff --git a/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp index cf7bae98a27..c0c61a29a60 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp @@ -690,6 +690,6 @@ llvm::createMipsELFObjectWriter(const Triple &TT, bool IsN32) { uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TT.getOS()); bool IsN64 = TT.isArch64Bit() && !IsN32; bool HasRelocationAddend = TT.isArch64Bit(); - return llvm::make_unique(OSABI, HasRelocationAddend, + return std::make_unique(OSABI, HasRelocationAddend, IsN64); } diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index c878abb042e..d0a4c4d0f49 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -117,7 +117,7 @@ MipsTargetMachine::MipsTargetMachine(const Target &T, const Triple &TT, : LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options, isLittle), TT, CPU, FS, Options, getEffectiveRelocModel(JIT, RM), getEffectiveCodeModel(CM, CodeModel::Small), OL), - isLittle(isLittle), TLOF(llvm::make_unique()), + isLittle(isLittle), TLOF(std::make_unique()), ABI(MipsABIInfo::computeTargetABI(TT, CPU, Options.MCOptions)), Subtarget(nullptr), DefaultSubtarget(TT, CPU, FS, isLittle, *this, Options.StackAlignmentOverride), @@ -196,7 +196,7 @@ MipsTargetMachine::getSubtargetImpl(const Function &F) const { // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique(TargetTriple, CPU, FS, isLittle, *this, + I = std::make_unique(TargetTriple, CPU, FS, isLittle, *this, Options.StackAlignmentOverride); } return I.get(); diff --git a/lib/Target/NVPTX/NVPTXTargetMachine.cpp b/lib/Target/NVPTX/NVPTXTargetMachine.cpp index 11b3fe2fa3d..f58fb571777 100644 --- a/lib/Target/NVPTX/NVPTXTargetMachine.cpp +++ b/lib/Target/NVPTX/NVPTXTargetMachine.cpp @@ -116,7 +116,7 @@ NVPTXTargetMachine::NVPTXTargetMachine(const Target &T, const Triple &TT, CPU, FS, Options, Reloc::PIC_, getEffectiveCodeModel(CM, CodeModel::Small), OL), is64bit(is64bit), UseShortPointers(UseShortPointersOpt), - TLOF(llvm::make_unique()), + TLOF(std::make_unique()), Subtarget(TT, CPU, FS, *this) { if (TT.getOS() == Triple::NVCL) drvInterface = NVPTX::NVCL; diff --git a/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp b/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp index c9524da93ac..aedf5b713c3 100644 --- a/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp +++ b/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp @@ -579,7 +579,7 @@ public: static std::unique_ptr CreateToken(StringRef Str, SMLoc S, bool IsPPC64) { - auto Op = make_unique(Token); + auto Op = std::make_unique(Token); Op->Tok.Data = Str.data(); Op->Tok.Length = Str.size(); Op->StartLoc = S; @@ -608,7 +608,7 @@ public: static std::unique_ptr CreateImm(int64_t Val, SMLoc S, SMLoc E, bool IsPPC64) { - auto Op = make_unique(Immediate); + auto Op = std::make_unique(Immediate); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -618,7 +618,7 @@ public: static std::unique_ptr CreateExpr(const MCExpr *Val, SMLoc S, SMLoc E, bool IsPPC64) { - auto Op = make_unique(Expression); + auto Op = std::make_unique(Expression); Op->Expr.Val = Val; Op->Expr.CRVal = EvaluateCRExpr(Val); Op->StartLoc = S; @@ -629,7 +629,7 @@ public: static std::unique_ptr CreateTLSReg(const MCSymbolRefExpr *Sym, SMLoc S, SMLoc E, bool IsPPC64) { - auto Op = make_unique(TLSRegister); + auto Op = std::make_unique(TLSRegister); Op->TLSReg.Sym = Sym; Op->StartLoc = S; Op->EndLoc = E; @@ -639,7 +639,7 @@ public: static std::unique_ptr CreateContextImm(int64_t Val, SMLoc S, SMLoc E, bool IsPPC64) { - auto Op = make_unique(ContextImmediate); + auto Op = std::make_unique(ContextImmediate); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp index 042ddf48d5d..79f08c682bb 100644 --- a/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp +++ b/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp @@ -443,5 +443,5 @@ bool PPCELFObjectWriter::needsRelocateWithSymbol(const MCSymbol &Sym, std::unique_ptr llvm::createPPCELFObjectWriter(bool Is64Bit, uint8_t OSABI) { - return llvm::make_unique(Is64Bit, OSABI); + return std::make_unique(Is64Bit, OSABI); } diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp index 4cf7fd15fa7..f272eee9c91 100644 --- a/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp +++ b/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp @@ -376,5 +376,5 @@ void PPCMachObjectWriter::RecordPPCRelocation( std::unique_ptr llvm::createPPCMachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype) { - return llvm::make_unique(Is64Bit, CPUType, CPUSubtype); + return std::make_unique(Is64Bit, CPUType, CPUSubtype); } diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp index 9c661286d45..7fdbb8990b5 100644 --- a/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp +++ b/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp @@ -25,5 +25,5 @@ PPCXCOFFObjectWriter::PPCXCOFFObjectWriter(bool Is64Bit) std::unique_ptr llvm::createPPCXCOFFObjectWriter(bool Is64Bit) { - return llvm::make_unique(Is64Bit); + return std::make_unique(Is64Bit); } diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index aa7a2c0c04a..01579065984 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -186,12 +186,12 @@ static std::string computeFSAdditions(StringRef FS, CodeGenOpt::Level OL, static std::unique_ptr createTLOF(const Triple &TT) { if (TT.isOSDarwin()) - return llvm::make_unique(); + return std::make_unique(); if (TT.isOSAIX()) - return llvm::make_unique(); + return std::make_unique(); - return llvm::make_unique(); + return std::make_unique(); } static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT, @@ -269,8 +269,8 @@ static ScheduleDAGInstrs *createPPCMachineScheduler(MachineSchedContext *C) { const PPCSubtarget &ST = C->MF->getSubtarget(); ScheduleDAGMILive *DAG = new ScheduleDAGMILive(C, ST.usePPCPreRASchedStrategy() ? - llvm::make_unique(C) : - llvm::make_unique(C)); + std::make_unique(C) : + std::make_unique(C)); // add DAG Mutations here. DAG->addMutation(createCopyConstrainDAGMutation(DAG->TII, DAG->TRI)); return DAG; @@ -281,8 +281,8 @@ static ScheduleDAGInstrs *createPPCPostMachineScheduler( const PPCSubtarget &ST = C->MF->getSubtarget(); ScheduleDAGMI *DAG = new ScheduleDAGMI(C, ST.usePPCPostRASchedStrategy() ? - llvm::make_unique(C) : - llvm::make_unique(C), true); + std::make_unique(C) : + std::make_unique(C), true); // add DAG Mutations here. return DAG; } @@ -338,7 +338,7 @@ PPCTargetMachine::getSubtargetImpl(const Function &F) const { // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique( + I = std::make_unique( TargetTriple, CPU, // FIXME: It would be good to have the subtarget additions here // not necessary. Anything that turns them on/off (overrides) ends diff --git a/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp index 93a2dd38afc..efa56fc5811 100644 --- a/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp +++ b/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp @@ -632,7 +632,7 @@ public: static std::unique_ptr createToken(StringRef Str, SMLoc S, bool IsRV64) { - auto Op = make_unique(Token); + auto Op = std::make_unique(Token); Op->Tok = Str; Op->StartLoc = S; Op->EndLoc = S; @@ -642,7 +642,7 @@ public: static std::unique_ptr createReg(unsigned RegNo, SMLoc S, SMLoc E, bool IsRV64) { - auto Op = make_unique(Register); + auto Op = std::make_unique(Register); Op->Reg.RegNum = RegNo; Op->StartLoc = S; Op->EndLoc = E; @@ -652,7 +652,7 @@ public: static std::unique_ptr createImm(const MCExpr *Val, SMLoc S, SMLoc E, bool IsRV64) { - auto Op = make_unique(Immediate); + auto Op = std::make_unique(Immediate); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -662,7 +662,7 @@ public: static std::unique_ptr createSysReg(StringRef Str, SMLoc S, unsigned Encoding, bool IsRV64) { - auto Op = make_unique(SystemRegister); + auto Op = std::make_unique(SystemRegister); Op->SysReg.Data = Str.data(); Op->SysReg.Length = Str.size(); Op->SysReg.Encoding = Encoding; diff --git a/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp b/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp index c5d4b1f8ac1..9c180a51d45 100644 --- a/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp +++ b/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp @@ -133,5 +133,5 @@ unsigned RISCVELFObjectWriter::getRelocType(MCContext &Ctx, std::unique_ptr llvm::createRISCVELFObjectWriter(uint8_t OSABI, bool Is64Bit) { - return llvm::make_unique(OSABI, Is64Bit); + return std::make_unique(OSABI, Is64Bit); } diff --git a/lib/Target/RISCV/RISCVTargetMachine.cpp b/lib/Target/RISCV/RISCVTargetMachine.cpp index f4e6ed9f628..c9614cca636 100644 --- a/lib/Target/RISCV/RISCVTargetMachine.cpp +++ b/lib/Target/RISCV/RISCVTargetMachine.cpp @@ -58,7 +58,7 @@ RISCVTargetMachine::RISCVTargetMachine(const Target &T, const Triple &TT, : LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options, getEffectiveRelocModel(TT, RM), getEffectiveCodeModel(CM, CodeModel::Small), OL), - TLOF(make_unique()), + TLOF(std::make_unique()), Subtarget(TT, CPU, FS, Options.MCOptions.getABIName(), *this) { initAsmInfo(); } diff --git a/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp b/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp index 15453ae59a4..f6be9dd0124 100644 --- a/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp +++ b/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp @@ -376,7 +376,7 @@ public: } static std::unique_ptr CreateToken(StringRef Str, SMLoc S) { - auto Op = make_unique(k_Token); + auto Op = std::make_unique(k_Token); Op->Tok.Data = Str.data(); Op->Tok.Length = Str.size(); Op->StartLoc = S; @@ -386,7 +386,7 @@ public: static std::unique_ptr CreateReg(unsigned RegNum, unsigned Kind, SMLoc S, SMLoc E) { - auto Op = make_unique(k_Register); + auto Op = std::make_unique(k_Register); Op->Reg.RegNum = RegNum; Op->Reg.Kind = (SparcOperand::RegisterKind)Kind; Op->StartLoc = S; @@ -396,7 +396,7 @@ public: static std::unique_ptr CreateImm(const MCExpr *Val, SMLoc S, SMLoc E) { - auto Op = make_unique(k_Immediate); + auto Op = std::make_unique(k_Immediate); Op->Imm.Val = Val; Op->StartLoc = S; Op->EndLoc = E; @@ -481,7 +481,7 @@ public: static std::unique_ptr CreateMEMr(unsigned Base, SMLoc S, SMLoc E) { - auto Op = make_unique(k_MemoryReg); + auto Op = std::make_unique(k_MemoryReg); Op->Mem.Base = Base; Op->Mem.OffsetReg = Sparc::G0; // always 0 Op->Mem.Off = nullptr; diff --git a/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp b/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp index 88547075c5a..dbb6d251230 100644 --- a/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp +++ b/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp @@ -135,5 +135,5 @@ bool SparcELFObjectWriter::needsRelocateWithSymbol(const MCSymbol &Sym, std::unique_ptr llvm::createSparcELFObjectWriter(bool Is64Bit, uint8_t OSABI) { - return llvm::make_unique(Is64Bit, OSABI); + return std::make_unique(Is64Bit, OSABI); } diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp index 195cff79de0..c1e3f8c3698 100644 --- a/lib/Target/Sparc/SparcTargetMachine.cpp +++ b/lib/Target/Sparc/SparcTargetMachine.cpp @@ -98,7 +98,7 @@ SparcTargetMachine::SparcTargetMachine( getEffectiveSparcCodeModel( CM, getEffectiveRelocModel(RM), is64bit, JIT), OL), - TLOF(make_unique()), + TLOF(std::make_unique()), Subtarget(TT, CPU, FS, *this, is64bit), is64Bit(is64bit) { initAsmInfo(); } @@ -133,7 +133,7 @@ SparcTargetMachine::getSubtargetImpl(const Function &F) const { // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique(TargetTriple, CPU, FS, *this, + I = std::make_unique(TargetTriple, CPU, FS, *this, this->is64Bit); } return I.get(); diff --git a/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp b/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp index a259ba3433d..93c4ce4b5cc 100644 --- a/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp +++ b/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp @@ -155,11 +155,11 @@ public: // Create particular kinds of operand. static std::unique_ptr createInvalid(SMLoc StartLoc, SMLoc EndLoc) { - return make_unique(KindInvalid, StartLoc, EndLoc); + return std::make_unique(KindInvalid, StartLoc, EndLoc); } static std::unique_ptr createToken(StringRef Str, SMLoc Loc) { - auto Op = make_unique(KindToken, Loc, Loc); + auto Op = std::make_unique(KindToken, Loc, Loc); Op->Token.Data = Str.data(); Op->Token.Length = Str.size(); return Op; @@ -167,7 +167,7 @@ public: static std::unique_ptr createReg(RegisterKind Kind, unsigned Num, SMLoc StartLoc, SMLoc EndLoc) { - auto Op = make_unique(KindReg, StartLoc, EndLoc); + auto Op = std::make_unique(KindReg, StartLoc, EndLoc); Op->Reg.Kind = Kind; Op->Reg.Num = Num; return Op; @@ -175,7 +175,7 @@ public: static std::unique_ptr createImm(const MCExpr *Expr, SMLoc StartLoc, SMLoc EndLoc) { - auto Op = make_unique(KindImm, StartLoc, EndLoc); + auto Op = std::make_unique(KindImm, StartLoc, EndLoc); Op->Imm = Expr; return Op; } @@ -184,7 +184,7 @@ public: createMem(MemoryKind MemKind, RegisterKind RegKind, unsigned Base, const MCExpr *Disp, unsigned Index, const MCExpr *LengthImm, unsigned LengthReg, SMLoc StartLoc, SMLoc EndLoc) { - auto Op = make_unique(KindMem, StartLoc, EndLoc); + auto Op = std::make_unique(KindMem, StartLoc, EndLoc); Op->Mem.MemKind = MemKind; Op->Mem.RegKind = RegKind; Op->Mem.Base = Base; @@ -200,7 +200,7 @@ public: static std::unique_ptr createImmTLS(const MCExpr *Imm, const MCExpr *Sym, SMLoc StartLoc, SMLoc EndLoc) { - auto Op = make_unique(KindImmTLS, StartLoc, EndLoc); + auto Op = std::make_unique(KindImmTLS, StartLoc, EndLoc); Op->ImmTLS.Imm = Imm; Op->ImmTLS.Sym = Sym; return Op; diff --git a/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp b/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp index 8d8ba5644e1..49b6fc49033 100644 --- a/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp +++ b/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp @@ -162,5 +162,5 @@ unsigned SystemZObjectWriter::getRelocType(MCContext &Ctx, std::unique_ptr llvm::createSystemZObjectWriter(uint8_t OSABI) { - return llvm::make_unique(OSABI); + return std::make_unique(OSABI); } diff --git a/lib/Target/SystemZ/SystemZTargetMachine.cpp b/lib/Target/SystemZ/SystemZTargetMachine.cpp index 5c49e6eff0b..4604fcae881 100644 --- a/lib/Target/SystemZ/SystemZTargetMachine.cpp +++ b/lib/Target/SystemZ/SystemZTargetMachine.cpp @@ -154,7 +154,7 @@ SystemZTargetMachine::SystemZTargetMachine(const Target &T, const Triple &TT, getEffectiveRelocModel(RM), getEffectiveSystemZCodeModel(CM, getEffectiveRelocModel(RM), JIT), OL), - TLOF(llvm::make_unique()), + TLOF(std::make_unique()), Subtarget(TT, CPU, FS, *this) { initAsmInfo(); } @@ -176,7 +176,7 @@ public: ScheduleDAGInstrs * createPostMachineScheduler(MachineSchedContext *C) const override { return new ScheduleDAGMI(C, - llvm::make_unique(C), + std::make_unique(C), /*RemoveKillFlags=*/true); } diff --git a/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp b/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp index 5bebd392276..da868e59c5f 100644 --- a/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp +++ b/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp @@ -343,7 +343,7 @@ public: int64_t Val = Int.getIntVal(); if (IsNegative) Val = -Val; - Operands.push_back(make_unique( + Operands.push_back(std::make_unique( WebAssemblyOperand::Integer, Int.getLoc(), Int.getEndLoc(), WebAssemblyOperand::IntOp{Val})); Parser.Lex(); @@ -356,7 +356,7 @@ public: return error("Cannot parse real: ", Flt); if (IsNegative) Val = -Val; - Operands.push_back(make_unique( + Operands.push_back(std::make_unique( WebAssemblyOperand::Float, Flt.getLoc(), Flt.getEndLoc(), WebAssemblyOperand::FltOp{Val})); Parser.Lex(); @@ -378,7 +378,7 @@ public: } if (IsNegative) Val = -Val; - Operands.push_back(make_unique( + Operands.push_back(std::make_unique( WebAssemblyOperand::Float, Flt.getLoc(), Flt.getEndLoc(), WebAssemblyOperand::FltOp{Val})); Parser.Lex(); @@ -407,7 +407,7 @@ public: // an opcode until after the assembly matcher, so set a default to fix // up later. auto Tok = Lexer.getTok(); - Operands.push_back(make_unique( + Operands.push_back(std::make_unique( WebAssemblyOperand::Integer, Tok.getLoc(), Tok.getEndLoc(), WebAssemblyOperand::IntOp{-1})); } @@ -417,7 +417,7 @@ public: void addBlockTypeOperand(OperandVector &Operands, SMLoc NameLoc, WebAssembly::ExprType BT) { - Operands.push_back(make_unique( + Operands.push_back(std::make_unique( WebAssemblyOperand::Integer, NameLoc, NameLoc, WebAssemblyOperand::IntOp{static_cast(BT)})); } @@ -449,7 +449,7 @@ public: } // Now construct the name as first operand. - Operands.push_back(make_unique( + Operands.push_back(std::make_unique( WebAssemblyOperand::Token, NameLoc, SMLoc::getFromPointer(Name.end()), WebAssemblyOperand::TokOp{Name})); @@ -498,7 +498,7 @@ public: // attach it to an anonymous symbol, which is what WasmObjectWriter // expects to be able to recreate the actual unique-ified type indices. auto Loc = Parser.getTok(); - auto Signature = make_unique(); + auto Signature = std::make_unique(); if (parseSignature(Signature.get())) return true; auto &Ctx = getStreamer().getContext(); @@ -510,7 +510,7 @@ public: WasmSym->setType(wasm::WASM_SYMBOL_TYPE_FUNCTION); const MCExpr *Expr = MCSymbolRefExpr::create( WasmSym, MCSymbolRefExpr::VK_WASM_TYPEINDEX, Ctx); - Operands.push_back(make_unique( + Operands.push_back(std::make_unique( WebAssemblyOperand::Symbol, Loc.getLoc(), Loc.getEndLoc(), WebAssemblyOperand::SymOp{Expr})); } @@ -535,7 +535,7 @@ public: SMLoc End; if (Parser.parseExpression(Val, End)) return error("Cannot parse symbol: ", Lexer.getTok()); - Operands.push_back(make_unique( + Operands.push_back(std::make_unique( WebAssemblyOperand::Symbol, Id.getLoc(), Id.getEndLoc(), WebAssemblyOperand::SymOp{Val})); if (checkForP2AlignIfLoadStore(Operands, Name)) @@ -570,7 +570,7 @@ public: } case AsmToken::LCurly: { Parser.Lex(); - auto Op = make_unique( + auto Op = std::make_unique( WebAssemblyOperand::BrList, Tok.getLoc(), Tok.getEndLoc()); if (!Lexer.is(AsmToken::RCurly)) for (;;) { @@ -692,7 +692,7 @@ public: LastFunctionLabel = LastLabel; push(Function); } - auto Signature = make_unique(); + auto Signature = std::make_unique(); if (parseSignature(Signature.get())) return true; WasmSym->setSignature(Signature.get()); @@ -708,7 +708,7 @@ public: if (SymName.empty()) return true; auto WasmSym = cast(Ctx.getOrCreateSymbol(SymName)); - auto Signature = make_unique(); + auto Signature = std::make_unique(); if (parseRegTypeList(Signature->Params)) return true; WasmSym->setSignature(Signature.get()); diff --git a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp index a1cc3e268e8..f424b722b83 100644 --- a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp +++ b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp @@ -117,5 +117,5 @@ unsigned WebAssemblyWasmObjectWriter::getRelocType(const MCValue &Target, std::unique_ptr llvm::createWebAssemblyWasmObjectWriter(bool Is64Bit) { - return llvm::make_unique(Is64Bit); + return std::make_unique(Is64Bit); } diff --git a/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp b/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp index 4c5d0192fc2..9f94866c089 100644 --- a/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp +++ b/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp @@ -97,14 +97,14 @@ public: // If the smallest region containing MBB is a loop if (LoopMap.count(ML)) return LoopMap[ML].get(); - LoopMap[ML] = llvm::make_unique>(ML); + LoopMap[ML] = std::make_unique>(ML); return LoopMap[ML].get(); } else { // If the smallest region containing MBB is an exception if (ExceptionMap.count(WE)) return ExceptionMap[WE].get(); ExceptionMap[WE] = - llvm::make_unique>(WE); + std::make_unique>(WE); return ExceptionMap[WE].get(); } } diff --git a/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp b/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp index 26baac32708..647e987309f 100644 --- a/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp +++ b/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp @@ -115,7 +115,7 @@ MCSymbol *WebAssemblyMCInstLower::GetExternalSymbolSymbol( getLibcallSignature(Subtarget, Name, Returns, Params); } auto Signature = - make_unique(std::move(Returns), std::move(Params)); + std::make_unique(std::move(Returns), std::move(Params)); WasmSym->setSignature(Signature.get()); Printer.addSignature(std::move(Signature)); @@ -238,7 +238,7 @@ void WebAssemblyMCInstLower::lower(const MachineInstr *MI, } auto *WasmSym = cast(Sym); - auto Signature = make_unique(std::move(Returns), + auto Signature = std::make_unique(std::move(Returns), std::move(Params)); WasmSym->setSignature(Signature.get()); Printer.addSignature(std::move(Signature)); diff --git a/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.cpp b/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.cpp index d31c1226bfd..94b2bac7e64 100644 --- a/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.cpp +++ b/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.cpp @@ -72,7 +72,7 @@ void llvm::valTypesFromMVTs(const ArrayRef &In, std::unique_ptr llvm::signatureFromMVTs(const SmallVectorImpl &Results, const SmallVectorImpl &Params) { - auto Sig = make_unique(); + auto Sig = std::make_unique(); valTypesFromMVTs(Results, Sig->Returns); valTypesFromMVTs(Params, Sig->Params); return Sig; diff --git a/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 7e65368e671..bdf5fe2620a 100644 --- a/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -140,7 +140,7 @@ WebAssemblyTargetMachine::getSubtargetImpl(std::string CPU, std::string FS) const { auto &I = SubtargetMap[CPU + FS]; if (!I) { - I = llvm::make_unique(TargetTriple, CPU, FS, *this); + I = std::make_unique(TargetTriple, CPU, FS, *this); } return I.get(); } diff --git a/lib/Target/X86/AsmParser/X86Operand.h b/lib/Target/X86/AsmParser/X86Operand.h index 37479954a70..77c8ca43082 100644 --- a/lib/Target/X86/AsmParser/X86Operand.h +++ b/lib/Target/X86/AsmParser/X86Operand.h @@ -581,7 +581,7 @@ struct X86Operand final : public MCParsedAsmOperand { static std::unique_ptr CreateToken(StringRef Str, SMLoc Loc) { SMLoc EndLoc = SMLoc::getFromPointer(Loc.getPointer() + Str.size()); - auto Res = llvm::make_unique(Token, Loc, EndLoc); + auto Res = std::make_unique(Token, Loc, EndLoc); Res->Tok.Data = Str.data(); Res->Tok.Length = Str.size(); return Res; @@ -591,7 +591,7 @@ struct X86Operand final : public MCParsedAsmOperand { CreateReg(unsigned RegNo, SMLoc StartLoc, SMLoc EndLoc, bool AddressOf = false, SMLoc OffsetOfLoc = SMLoc(), StringRef SymName = StringRef(), void *OpDecl = nullptr) { - auto Res = llvm::make_unique(Register, StartLoc, EndLoc); + auto Res = std::make_unique(Register, StartLoc, EndLoc); Res->Reg.RegNo = RegNo; Res->AddressOf = AddressOf; Res->OffsetOfLoc = OffsetOfLoc; @@ -602,19 +602,19 @@ struct X86Operand final : public MCParsedAsmOperand { static std::unique_ptr CreateDXReg(SMLoc StartLoc, SMLoc EndLoc) { - return llvm::make_unique(DXRegister, StartLoc, EndLoc); + return std::make_unique(DXRegister, StartLoc, EndLoc); } static std::unique_ptr CreatePrefix(unsigned Prefixes, SMLoc StartLoc, SMLoc EndLoc) { - auto Res = llvm::make_unique(Prefix, StartLoc, EndLoc); + auto Res = std::make_unique(Prefix, StartLoc, EndLoc); Res->Pref.Prefixes = Prefixes; return Res; } static std::unique_ptr CreateImm(const MCExpr *Val, SMLoc StartLoc, SMLoc EndLoc) { - auto Res = llvm::make_unique(Immediate, StartLoc, EndLoc); + auto Res = std::make_unique(Immediate, StartLoc, EndLoc); Res->Imm.Val = Val; return Res; } @@ -624,7 +624,7 @@ struct X86Operand final : public MCParsedAsmOperand { CreateMem(unsigned ModeSize, const MCExpr *Disp, SMLoc StartLoc, SMLoc EndLoc, unsigned Size = 0, StringRef SymName = StringRef(), void *OpDecl = nullptr, unsigned FrontendSize = 0) { - auto Res = llvm::make_unique(Memory, StartLoc, EndLoc); + auto Res = std::make_unique(Memory, StartLoc, EndLoc); Res->Mem.SegReg = 0; Res->Mem.Disp = Disp; Res->Mem.BaseReg = 0; @@ -652,7 +652,7 @@ struct X86Operand final : public MCParsedAsmOperand { // The scale should always be one of {1,2,4,8}. assert(((Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8)) && "Invalid scale!"); - auto Res = llvm::make_unique(Memory, StartLoc, EndLoc); + auto Res = std::make_unique(Memory, StartLoc, EndLoc); Res->Mem.SegReg = SegReg; Res->Mem.Disp = Disp; Res->Mem.BaseReg = BaseReg; diff --git a/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp b/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp index 232a0659323..b6d809ab60b 100644 --- a/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp +++ b/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp @@ -329,5 +329,5 @@ unsigned X86ELFObjectWriter::getRelocType(MCContext &Ctx, const MCValue &Target, std::unique_ptr llvm::createX86ELFObjectWriter(bool IsELF64, uint8_t OSABI, uint16_t EMachine) { - return llvm::make_unique(IsELF64, OSABI, EMachine); + return std::make_unique(IsELF64, OSABI, EMachine); } diff --git a/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp b/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp index fc7e99f61e5..6c52ba2b5f2 100644 --- a/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp +++ b/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp @@ -600,5 +600,5 @@ void X86MachObjectWriter::RecordX86Relocation(MachObjectWriter *Writer, std::unique_ptr llvm::createX86MachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype) { - return llvm::make_unique(Is64Bit, CPUType, CPUSubtype); + return std::make_unique(Is64Bit, CPUType, CPUSubtype); } diff --git a/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp b/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp index 3baab9da1c4..760239f7650 100644 --- a/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp +++ b/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp @@ -109,5 +109,5 @@ unsigned X86WinCOFFObjectWriter::getRelocType(MCContext &Ctx, std::unique_ptr llvm::createX86WinCOFFObjectWriter(bool Is64Bit) { - return llvm::make_unique(Is64Bit); + return std::make_unique(Is64Bit); } diff --git a/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp b/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp index e9987d1f62b..d5494ef1237 100644 --- a/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp +++ b/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp @@ -170,7 +170,7 @@ bool X86WinCOFFTargetStreamer::emitFPOProc(const MCSymbol *ProcSym, L, "opening new .cv_fpo_proc before closing previous frame"); return true; } - CurFPOData = llvm::make_unique(); + CurFPOData = std::make_unique(); CurFPOData->Function = ProcSym; CurFPOData->Begin = emitFPOLabel(); CurFPOData->ParamsSize = ParamsSize; diff --git a/lib/Target/X86/X86CondBrFolding.cpp b/lib/Target/X86/X86CondBrFolding.cpp index 9dea94f1368..1bf2d5ba7b8 100644 --- a/lib/Target/X86/X86CondBrFolding.cpp +++ b/lib/Target/X86/X86CondBrFolding.cpp @@ -564,7 +564,7 @@ X86CondBrFolding::analyzeMBB(MachineBasicBlock &MBB) { Modified = false; break; } - return llvm::make_unique(TargetMBBInfo{ + return std::make_unique(TargetMBBInfo{ TBB, FBB, BrInstr, CmpInstr, CC, SrcReg, CmpValue, Modified, CmpBrOnly}); } diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 0cbf13899a2..c42acae311e 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -86,22 +86,22 @@ extern "C" void LLVMInitializeX86Target() { static std::unique_ptr createTLOF(const Triple &TT) { if (TT.isOSBinFormatMachO()) { if (TT.getArch() == Triple::x86_64) - return llvm::make_unique(); - return llvm::make_unique(); + return std::make_unique(); + return std::make_unique(); } if (TT.isOSFreeBSD()) - return llvm::make_unique(); + return std::make_unique(); if (TT.isOSLinux() || TT.isOSNaCl() || TT.isOSIAMCU()) - return llvm::make_unique(); + return std::make_unique(); if (TT.isOSSolaris()) - return llvm::make_unique(); + return std::make_unique(); if (TT.isOSFuchsia()) - return llvm::make_unique(); + return std::make_unique(); if (TT.isOSBinFormatELF()) - return llvm::make_unique(); + return std::make_unique(); if (TT.isOSBinFormatCOFF()) - return llvm::make_unique(); + return std::make_unique(); llvm_unreachable("unknown subtarget type"); } @@ -311,7 +311,7 @@ X86TargetMachine::getSubtargetImpl(const Function &F) const { // creation will depend on the TM and the code generation flags on the // function that reside in TargetOptions. resetTargetOptions(F); - I = llvm::make_unique(TargetTriple, CPU, FS, *this, + I = std::make_unique(TargetTriple, CPU, FS, *this, Options.StackAlignmentOverride, PreferVectorWidthOverride, RequiredVectorWidth); diff --git a/lib/Target/XCore/XCoreTargetMachine.cpp b/lib/Target/XCore/XCoreTargetMachine.cpp index 2a8cd6b657b..b5b7445265b 100644 --- a/lib/Target/XCore/XCoreTargetMachine.cpp +++ b/lib/Target/XCore/XCoreTargetMachine.cpp @@ -53,7 +53,7 @@ XCoreTargetMachine::XCoreTargetMachine(const Target &T, const Triple &TT, T, "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32-f64:32-a:0:32-n32", TT, CPU, FS, Options, getEffectiveRelocModel(RM), getEffectiveXCoreCodeModel(CM), OL), - TLOF(llvm::make_unique()), + TLOF(std::make_unique()), Subtarget(TT, CPU, FS, *this) { initAsmInfo(); } diff --git a/lib/Transforms/Coroutines/CoroCleanup.cpp b/lib/Transforms/Coroutines/CoroCleanup.cpp index 9d678e74376..c3e05577f04 100644 --- a/lib/Transforms/Coroutines/CoroCleanup.cpp +++ b/lib/Transforms/Coroutines/CoroCleanup.cpp @@ -115,7 +115,7 @@ struct CoroCleanup : FunctionPass { "llvm.coro.subfn.addr", "llvm.coro.free", "llvm.coro.id", "llvm.coro.id.retcon", "llvm.coro.id.retcon.once"})) - L = llvm::make_unique(M); + L = std::make_unique(M); return false; } diff --git a/lib/Transforms/Coroutines/CoroEarly.cpp b/lib/Transforms/Coroutines/CoroEarly.cpp index aff69a45c5d..55993d33ee4 100644 --- a/lib/Transforms/Coroutines/CoroEarly.cpp +++ b/lib/Transforms/Coroutines/CoroEarly.cpp @@ -247,7 +247,7 @@ struct CoroEarly : public FunctionPass { "llvm.coro.promise", "llvm.coro.resume", "llvm.coro.suspend"})) - L = llvm::make_unique(M); + L = std::make_unique(M); return false; } diff --git a/lib/Transforms/Coroutines/CoroElide.cpp b/lib/Transforms/Coroutines/CoroElide.cpp index 6707aa1c827..aca77119023 100644 --- a/lib/Transforms/Coroutines/CoroElide.cpp +++ b/lib/Transforms/Coroutines/CoroElide.cpp @@ -286,7 +286,7 @@ struct CoroElide : FunctionPass { bool doInitialization(Module &M) override { if (coro::declaresIntrinsics(M, {"llvm.coro.id"})) - L = llvm::make_unique(M); + L = std::make_unique(M); return false; } diff --git a/lib/Transforms/IPO/FunctionImport.cpp b/lib/Transforms/IPO/FunctionImport.cpp index c81ed538cbc..f915aea004f 100644 --- a/lib/Transforms/IPO/FunctionImport.cpp +++ b/lib/Transforms/IPO/FunctionImport.cpp @@ -450,7 +450,7 @@ static void computeImportForFunction( } else if (PrintImportFailures) { assert(!FailureInfo && "Expected no FailureInfo for newly rejected candidate"); - FailureInfo = llvm::make_unique( + FailureInfo = std::make_unique( VI, Edge.second.getHotness(), Reason, 1); } LLVM_DEBUG( diff --git a/lib/Transforms/IPO/HotColdSplitting.cpp b/lib/Transforms/IPO/HotColdSplitting.cpp index ab1a9a79cad..79a5a9b80a9 100644 --- a/lib/Transforms/IPO/HotColdSplitting.cpp +++ b/lib/Transforms/IPO/HotColdSplitting.cpp @@ -607,9 +607,9 @@ bool HotColdSplitting::outlineColdRegions(Function &F, bool HasProfileSummary) { }); if (!DT) - DT = make_unique(F); + DT = std::make_unique(F); if (!PDT) - PDT = make_unique(F); + PDT = std::make_unique(F); auto Regions = OutliningRegion::create(*BB, *DT, *PDT); for (OutliningRegion &Region : Regions) { diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 945f8affae6..3b9e7cf3b71 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -879,7 +879,7 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC, if (!ImportedFunctionsStats && InlinerFunctionImportStats != InlinerFunctionImportStatsOpts::No) { ImportedFunctionsStats = - llvm::make_unique(); + std::make_unique(); ImportedFunctionsStats->setModuleInfo(M); } diff --git a/lib/Transforms/IPO/PartialInlining.cpp b/lib/Transforms/IPO/PartialInlining.cpp index 733782e8764..62f4584d5f5 100644 --- a/lib/Transforms/IPO/PartialInlining.cpp +++ b/lib/Transforms/IPO/PartialInlining.cpp @@ -409,7 +409,7 @@ PartialInlinerImpl::computeOutliningColdRegionsInfo(Function *F, return std::unique_ptr(); std::unique_ptr OutliningInfo = - llvm::make_unique(); + std::make_unique(); auto IsSingleEntry = [](SmallVectorImpl &BlockList) { BasicBlock *Dom = BlockList.front(); @@ -589,7 +589,7 @@ PartialInlinerImpl::computeOutliningInfo(Function *F) { }; std::unique_ptr OutliningInfo = - llvm::make_unique(); + std::make_unique(); BasicBlock *CurrEntry = EntryBlock; bool CandidateFound = false; @@ -966,7 +966,7 @@ PartialInlinerImpl::FunctionCloner::FunctionCloner( Function *F, FunctionOutliningInfo *OI, OptimizationRemarkEmitter &ORE, function_ref LookupAC) : OrigFunc(F), ORE(ORE), LookupAC(LookupAC) { - ClonedOI = llvm::make_unique(); + ClonedOI = std::make_unique(); // Clone the function, so that we can hack away on it. ValueToValueMapTy VMap; @@ -991,7 +991,7 @@ PartialInlinerImpl::FunctionCloner::FunctionCloner( OptimizationRemarkEmitter &ORE, function_ref LookupAC) : OrigFunc(F), ORE(ORE), LookupAC(LookupAC) { - ClonedOMRI = llvm::make_unique(); + ClonedOMRI = std::make_unique(); // Clone the function, so that we can hack away on it. ValueToValueMapTy VMap; diff --git a/lib/Transforms/IPO/SCCP.cpp b/lib/Transforms/IPO/SCCP.cpp index 7be3608bd2e..1393befe77b 100644 --- a/lib/Transforms/IPO/SCCP.cpp +++ b/lib/Transforms/IPO/SCCP.cpp @@ -14,7 +14,7 @@ PreservedAnalyses IPSCCPPass::run(Module &M, ModuleAnalysisManager &AM) { auto getAnalysis = [&FAM](Function &F) -> AnalysisResultsForFn { DominatorTree &DT = FAM.getResult(F); return { - make_unique(F, DT, FAM.getResult(F)), + std::make_unique(F, DT, FAM.getResult(F)), &DT, FAM.getCachedResult(F)}; }; @@ -54,7 +54,7 @@ public: DominatorTree &DT = this->getAnalysis(F).getDomTree(); return { - make_unique( + std::make_unique( F, DT, this->getAnalysis().getAssumptionCache( F)), diff --git a/lib/Transforms/IPO/SampleProfile.cpp b/lib/Transforms/IPO/SampleProfile.cpp index 77140c746a1..79b42e7611f 100644 --- a/lib/Transforms/IPO/SampleProfile.cpp +++ b/lib/Transforms/IPO/SampleProfile.cpp @@ -1745,7 +1745,7 @@ bool SampleProfileLoader::runOnFunction(Function &F, ModuleAnalysisManager *AM) .getManager(); ORE = &FAM.getResult(F); } else { - OwnedORE = make_unique(&F); + OwnedORE = std::make_unique(&F); ORE = OwnedORE.get(); } Samples = Reader->getSamplesFor(F); diff --git a/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp index 31c731e734f..690b5e8bf49 100644 --- a/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp +++ b/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp @@ -466,7 +466,7 @@ void writeThinLTOBitcode(raw_ostream &OS, raw_ostream *ThinLinkOS, // splitAndWriteThinLTOBitcode). Just always build it once via the // buildModuleSummaryIndex when Module(s) are ready. ProfileSummaryInfo PSI(M); - NewIndex = llvm::make_unique( + NewIndex = std::make_unique( buildModuleSummaryIndex(M, nullptr, &PSI)); Index = NewIndex.get(); } diff --git a/lib/Transforms/IPO/WholeProgramDevirt.cpp b/lib/Transforms/IPO/WholeProgramDevirt.cpp index 4436363f658..4490a7ef62a 100644 --- a/lib/Transforms/IPO/WholeProgramDevirt.cpp +++ b/lib/Transforms/IPO/WholeProgramDevirt.cpp @@ -644,7 +644,7 @@ struct WholeProgramDevirt : public ModulePass { // an optimization remark emitter on the fly, when we need it. std::unique_ptr ORE; auto OREGetter = [&](Function *F) -> OptimizationRemarkEmitter & { - ORE = make_unique(F); + ORE = std::make_unique(F); return *ORE; }; diff --git a/lib/Transforms/Instrumentation/CFGMST.h b/lib/Transforms/Instrumentation/CFGMST.h index 971e0004176..8bb6f47c484 100644 --- a/lib/Transforms/Instrumentation/CFGMST.h +++ b/lib/Transforms/Instrumentation/CFGMST.h @@ -257,13 +257,13 @@ public: std::tie(Iter, Inserted) = BBInfos.insert(std::make_pair(Src, nullptr)); if (Inserted) { // Newly inserted, update the real info. - Iter->second = std::move(llvm::make_unique(Index)); + Iter->second = std::move(std::make_unique(Index)); Index++; } std::tie(Iter, Inserted) = BBInfos.insert(std::make_pair(Dest, nullptr)); if (Inserted) // Newly inserted, update the real info. - Iter->second = std::move(llvm::make_unique(Index)); + Iter->second = std::move(std::make_unique(Index)); AllEdges.emplace_back(new Edge(Src, Dest, W)); return *AllEdges.back(); } diff --git a/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/lib/Transforms/Instrumentation/ControlHeightReduction.cpp index c08eb673fd6..04bc614334f 100644 --- a/lib/Transforms/Instrumentation/ControlHeightReduction.cpp +++ b/lib/Transforms/Instrumentation/ControlHeightReduction.cpp @@ -2070,7 +2070,7 @@ bool ControlHeightReductionLegacyPass::runOnFunction(Function &F) { getAnalysis().getPSI(); RegionInfo &RI = getAnalysis().getRegionInfo(); std::unique_ptr OwnedORE = - llvm::make_unique(&F); + std::make_unique(&F); return CHR(F, BFI, DT, PSI, RI, *OwnedORE.get()).run(); } diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp index b2d52fad1c0..510a3ad57b3 100644 --- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -696,7 +696,7 @@ void GCOVProfiler::emitProfileNotes() { ++It; EntryBlock.splitBasicBlock(It); - Funcs.push_back(make_unique(SP, &F, &out, FunctionIdent++, + Funcs.push_back(std::make_unique(SP, &F, &out, FunctionIdent++, Options.UseCfgChecksum, Options.ExitBlockBeforeBody)); GCOVFunction &Func = *Funcs.back(); diff --git a/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp index f09bf25deaf..163ae3ec62f 100644 --- a/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp @@ -287,7 +287,7 @@ public: StringRef getPassName() const override { return "HWAddressSanitizer"; } bool doInitialization(Module &M) override { - HWASan = llvm::make_unique(M, CompileKernel, Recover); + HWASan = std::make_unique(M, CompileKernel, Recover); return true; } diff --git a/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp b/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp index c7371f567ff..74d6e76eceb 100644 --- a/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp +++ b/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp @@ -403,7 +403,7 @@ static bool promoteIndirectCalls(Module &M, ProfileSummaryInfo *PSI, AM->getResult(M).getManager(); ORE = &FAM.getResult(F); } else { - OwnedORE = llvm::make_unique(&F); + OwnedORE = std::make_unique(&F); ORE = OwnedORE.get(); } diff --git a/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/lib/Transforms/Instrumentation/PGOInstrumentation.cpp index 6fec3c9c79e..73a91d909a9 100644 --- a/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -1662,9 +1662,9 @@ static bool annotateAllFunctions( F.getName().equals(ViewBlockFreqFuncName))) { LoopInfo LI{DominatorTree(F)}; std::unique_ptr NewBPI = - llvm::make_unique(F, LI); + std::make_unique(F, LI); std::unique_ptr NewBFI = - llvm::make_unique(F, *NewBPI, LI); + std::make_unique(F, *NewBPI, LI); if (PGOViewCounts == PGOVCT_Graph) NewBFI->view(); else if (PGOViewCounts == PGOVCT_Text) { diff --git a/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp b/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp index 188f95b4676..ac78b4d993e 100644 --- a/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp +++ b/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp @@ -138,7 +138,7 @@ public: OptimizationRemarkEmitter &ORE, DominatorTree *DT) : Func(Func), BFI(BFI), ORE(ORE), DT(DT), Changed(false) { ValueDataArray = - llvm::make_unique(MemOPMaxVersion + 2); + std::make_unique(MemOPMaxVersion + 2); // Get the MemOPSize range information from option MemOPSizeRange, getMemOPSizeRangeFromOption(MemOPSizeRange, PreciseRangeStart, PreciseRangeLast); diff --git a/lib/Transforms/Scalar/EarlyCSE.cpp b/lib/Transforms/Scalar/EarlyCSE.cpp index 22628ffa3e2..829f310b6fb 100644 --- a/lib/Transforms/Scalar/EarlyCSE.cpp +++ b/lib/Transforms/Scalar/EarlyCSE.cpp @@ -527,7 +527,7 @@ public: const TargetTransformInfo &TTI, DominatorTree &DT, AssumptionCache &AC, MemorySSA *MSSA) : TLI(TLI), TTI(TTI), DT(DT), AC(AC), SQ(DL, &TLI, &DT, &AC), MSSA(MSSA), - MSSAUpdater(llvm::make_unique(MSSA)) {} + MSSAUpdater(std::make_unique(MSSA)) {} bool run(); diff --git a/lib/Transforms/Scalar/GVNHoist.cpp b/lib/Transforms/Scalar/GVNHoist.cpp index 7614599653c..46f4ee48822 100644 --- a/lib/Transforms/Scalar/GVNHoist.cpp +++ b/lib/Transforms/Scalar/GVNHoist.cpp @@ -257,7 +257,7 @@ public: GVNHoist(DominatorTree *DT, PostDominatorTree *PDT, AliasAnalysis *AA, MemoryDependenceResults *MD, MemorySSA *MSSA) : DT(DT), PDT(PDT), AA(AA), MD(MD), MSSA(MSSA), - MSSAUpdater(llvm::make_unique(MSSA)) {} + MSSAUpdater(std::make_unique(MSSA)) {} bool run(Function &F) { NumFuncArgs = F.arg_size(); diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 572b69fb890..5015ca8dbb1 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -346,7 +346,7 @@ bool LoopInvariantCodeMotion::runOnLoop( CurAST = collectAliasInfoForLoop(L, LI, AA); } else { LLVM_DEBUG(dbgs() << "LICM: Using MemorySSA.\n"); - MSSAU = make_unique(MSSA); + MSSAU = std::make_unique(MSSA); unsigned AccessCapCount = 0; for (auto *BB : L->getBlocks()) { @@ -2168,7 +2168,7 @@ LoopInvariantCodeMotion::collectAliasInfoForLoop(Loop *L, LoopInfo *LI, LoopToAliasSetMap.erase(MapI); } if (!CurAST) - CurAST = make_unique(*AA); + CurAST = std::make_unique(*AA); // Add everything from the sub loops that are no longer directly available. for (Loop *InnerL : RecomputeLoops) @@ -2187,7 +2187,7 @@ std::unique_ptr LoopInvariantCodeMotion::collectAliasInfoForLoopWithMSSA( Loop *L, AliasAnalysis *AA, MemorySSAUpdater *MSSAU) { auto *MSSA = MSSAU->getMemorySSA(); - auto CurAST = make_unique(*AA, MSSA, L); + auto CurAST = std::make_unique(*AA, MSSA, L); CurAST->addAllInstructionsInLoopUsingMSSA(); return CurAST; } diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index b5b8e720069..1ff5e969992 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -525,7 +525,7 @@ bool LoopUnswitch::runOnLoop(Loop *L, LPPassManager &LPM_Ref) { DT = &getAnalysis().getDomTree(); if (EnableMSSALoopDependency) { MSSA = &getAnalysis().getMSSA(); - MSSAU = make_unique(MSSA); + MSSAU = std::make_unique(MSSA); assert(DT && "Cannot update MemorySSA without a valid DomTree."); } currentLoop = L; diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index 08ac2b666fc..e26f8057656 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -656,7 +656,7 @@ public: TargetLibraryInfo *TLI, AliasAnalysis *AA, MemorySSA *MSSA, const DataLayout &DL) : F(F), DT(DT), TLI(TLI), AA(AA), MSSA(MSSA), DL(DL), - PredInfo(make_unique(F, *DT, *AC)), + PredInfo(std::make_unique(F, *DT, *AC)), SQ(DL, TLI, DT, AC, /*CtxI=*/nullptr, /*UseInstrInfo=*/false) {} bool runGVN(); diff --git a/lib/Transforms/Utils/CloneModule.cpp b/lib/Transforms/Utils/CloneModule.cpp index 7ddf59becba..71e39e9f56f 100644 --- a/lib/Transforms/Utils/CloneModule.cpp +++ b/lib/Transforms/Utils/CloneModule.cpp @@ -48,7 +48,7 @@ std::unique_ptr llvm::CloneModule( function_ref ShouldCloneDefinition) { // First off, we need to create the new module. std::unique_ptr New = - llvm::make_unique(M.getModuleIdentifier(), M.getContext()); + std::make_unique(M.getModuleIdentifier(), M.getContext()); New->setSourceFileName(M.getSourceFileName()); New->setDataLayout(M.getDataLayout()); New->setTargetTriple(M.getTargetTriple()); diff --git a/lib/Transforms/Utils/Evaluator.cpp b/lib/Transforms/Utils/Evaluator.cpp index 0e203f4e075..ad36790b8c6 100644 --- a/lib/Transforms/Utils/Evaluator.cpp +++ b/lib/Transforms/Utils/Evaluator.cpp @@ -469,7 +469,7 @@ bool Evaluator::EvaluateBlock(BasicBlock::iterator CurInst, return false; // Cannot handle array allocs. } Type *Ty = AI->getAllocatedType(); - AllocaTmps.push_back(llvm::make_unique( + AllocaTmps.push_back(std::make_unique( Ty, false, GlobalValue::InternalLinkage, UndefValue::get(Ty), AI->getName(), /*TLMode=*/GlobalValue::NotThreadLocal, AI->getType()->getPointerAddressSpace())); diff --git a/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp b/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp index 8041e66e6c4..1e9864a12d1 100644 --- a/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp +++ b/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp @@ -25,7 +25,7 @@ ImportedFunctionsInliningStatistics::createInlineGraphNode(const Function &F) { auto &ValueLookup = NodesMap[F.getName()]; if (!ValueLookup) { - ValueLookup = llvm::make_unique(); + ValueLookup = std::make_unique(); ValueLookup->Imported = F.getMetadata("thinlto_src_module") != nullptr; } return *ValueLookup; diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index e202b452086..d0f89dc54bf 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -808,7 +808,7 @@ bool LoopSimplify::runOnFunction(Function &F) { auto *MSSAAnalysis = getAnalysisIfAvailable(); if (MSSAAnalysis) { MSSA = &MSSAAnalysis->getMSSA(); - MSSAU = make_unique(MSSA); + MSSAU = std::make_unique(MSSA); } } @@ -839,7 +839,7 @@ PreservedAnalyses LoopSimplifyPass::run(Function &F, std::unique_ptr MSSAU; if (MSSAAnalysis) { auto *MSSA = &MSSAAnalysis->getMSSA(); - MSSAU = make_unique(MSSA); + MSSAU = std::make_unique(MSSA); } diff --git a/lib/Transforms/Utils/PredicateInfo.cpp b/lib/Transforms/Utils/PredicateInfo.cpp index 5ae24a97311..3c288bab377 100644 --- a/lib/Transforms/Utils/PredicateInfo.cpp +++ b/lib/Transforms/Utils/PredicateInfo.cpp @@ -798,7 +798,7 @@ static void replaceCreatedSSACopys(PredicateInfo &PredInfo, Function &F) { bool PredicateInfoPrinterLegacyPass::runOnFunction(Function &F) { auto &DT = getAnalysis().getDomTree(); auto &AC = getAnalysis().getAssumptionCache(F); - auto PredInfo = make_unique(F, DT, AC); + auto PredInfo = std::make_unique(F, DT, AC); PredInfo->print(dbgs()); if (VerifyPredicateInfo) PredInfo->verifyPredicateInfo(); @@ -812,7 +812,7 @@ PreservedAnalyses PredicateInfoPrinterPass::run(Function &F, auto &DT = AM.getResult(F); auto &AC = AM.getResult(F); OS << "PredicateInfo for function: " << F.getName() << "\n"; - auto PredInfo = make_unique(F, DT, AC); + auto PredInfo = std::make_unique(F, DT, AC); PredInfo->print(OS); replaceCreatedSSACopys(*PredInfo, F); @@ -871,7 +871,7 @@ PreservedAnalyses PredicateInfoVerifierPass::run(Function &F, FunctionAnalysisManager &AM) { auto &DT = AM.getResult(F); auto &AC = AM.getResult(F); - make_unique(F, DT, AC)->verifyPredicateInfo(); + std::make_unique(F, DT, AC)->verifyPredicateInfo(); return PreservedAnalyses::all(); } diff --git a/lib/Transforms/Utils/SymbolRewriter.cpp b/lib/Transforms/Utils/SymbolRewriter.cpp index 456724779b4..5d380dcf231 100644 --- a/lib/Transforms/Utils/SymbolRewriter.cpp +++ b/lib/Transforms/Utils/SymbolRewriter.cpp @@ -380,11 +380,11 @@ parseRewriteFunctionDescriptor(yaml::Stream &YS, yaml::ScalarNode *K, // TODO see if there is a more elegant solution to selecting the rewrite // descriptor type if (!Target.empty()) - DL->push_back(llvm::make_unique( + DL->push_back(std::make_unique( Source, Target, Naked)); else DL->push_back( - llvm::make_unique(Source, Transform)); + std::make_unique(Source, Transform)); return true; } @@ -442,11 +442,11 @@ parseRewriteGlobalVariableDescriptor(yaml::Stream &YS, yaml::ScalarNode *K, } if (!Target.empty()) - DL->push_back(llvm::make_unique( + DL->push_back(std::make_unique( Source, Target, /*Naked*/ false)); else - DL->push_back(llvm::make_unique( + DL->push_back(std::make_unique( Source, Transform)); return true; @@ -505,11 +505,11 @@ parseRewriteGlobalAliasDescriptor(yaml::Stream &YS, yaml::ScalarNode *K, } if (!Target.empty()) - DL->push_back(llvm::make_unique( + DL->push_back(std::make_unique( Source, Target, /*Naked*/ false)); else - DL->push_back(llvm::make_unique( + DL->push_back(std::make_unique( Source, Transform)); return true; diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index dac48a1d814..870ac700571 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2746,7 +2746,7 @@ void InnerLoopVectorizer::emitMemRuntimeChecks(Loop *L, BasicBlock *Bypass) { // We currently don't use LoopVersioning for the actual loop cloning but we // still use it to add the noalias metadata. - LVer = llvm::make_unique(*Legal->getLAI(), OrigLoop, LI, DT, + LVer = std::make_unique(*Legal->getLAI(), OrigLoop, LI, DT, PSE.getSE()); LVer->prepareNoAliasMetadata(); } @@ -6972,7 +6972,7 @@ VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes( // Create a dummy pre-entry VPBasicBlock to start building the VPlan. VPBasicBlock *VPBB = new VPBasicBlock("Pre-Entry"); - auto Plan = llvm::make_unique(VPBB); + auto Plan = std::make_unique(VPBB); VPRecipeBuilder RecipeBuilder(OrigLoop, TLI, Legal, CM, Builder); // Represent values that will have defs inside VPlan. @@ -7092,7 +7092,7 @@ VPlanPtr LoopVectorizationPlanner::buildVPlan(VFRange &Range) { assert(EnableVPlanNativePath && "VPlan-native path is not enabled."); // Create new empty VPlan - auto Plan = llvm::make_unique(); + auto Plan = std::make_unique(); // Build hierarchical CFG VPlanHCFGBuilder HCFGBuilder(OrigLoop, LI, *Plan); diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index e22eea2cbde..e2a04dbaa8f 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -1299,7 +1299,7 @@ private: const EdgeInfo &UserTreeIdx, ArrayRef ReuseShuffleIndices = None, ArrayRef ReorderIndices = None) { - VectorizableTree.push_back(llvm::make_unique(VectorizableTree)); + VectorizableTree.push_back(std::make_unique(VectorizableTree)); TreeEntry *Last = VectorizableTree.back().get(); Last->Idx = VectorizableTree.size() - 1; Last->Scalars.insert(Last->Scalars.begin(), VL.begin(), VL.end()); @@ -2142,7 +2142,7 @@ void BoUpSLP::buildTree_rec(ArrayRef VL, unsigned Depth, auto &BSRef = BlocksSchedules[BB]; if (!BSRef) - BSRef = llvm::make_unique(BB); + BSRef = std::make_unique(BB); BlockScheduling &BS = *BSRef.get(); @@ -4364,7 +4364,7 @@ void BoUpSLP::BlockScheduling::cancelScheduling(ArrayRef VL, BoUpSLP::ScheduleData *BoUpSLP::BlockScheduling::allocateScheduleDataChunks() { // Allocate a new ScheduleData for the instruction. if (ChunkPos >= ChunkSize) { - ScheduleDataChunks.push_back(llvm::make_unique(ChunkSize)); + ScheduleDataChunks.push_back(std::make_unique(ChunkSize)); ChunkPos = 0; } return &(ScheduleDataChunks.back()[ChunkPos++]); diff --git a/lib/WindowsManifest/WindowsManifestMerger.cpp b/lib/WindowsManifest/WindowsManifestMerger.cpp index d092ab493c9..de03e232aaa 100644 --- a/lib/WindowsManifest/WindowsManifestMerger.cpp +++ b/lib/WindowsManifest/WindowsManifestMerger.cpp @@ -704,7 +704,7 @@ bool windows_manifest::isAvailable() { return false; } #endif WindowsManifestMerger::WindowsManifestMerger() - : Impl(make_unique()) {} + : Impl(std::make_unique()) {} WindowsManifestMerger::~WindowsManifestMerger() {} diff --git a/lib/XRay/FDRRecordProducer.cpp b/lib/XRay/FDRRecordProducer.cpp index 870dd7c4fad..02132b283e9 100644 --- a/lib/XRay/FDRRecordProducer.cpp +++ b/lib/XRay/FDRRecordProducer.cpp @@ -40,32 +40,32 @@ metadataRecordType(const XRayFileHeader &Header, uint8_t T) { "Invalid metadata record type: %d", T); switch (T) { case MetadataRecordKinds::NewBufferKind: - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::EndOfBufferKind: if (Header.Version >= 2) return createStringError( std::make_error_code(std::errc::executable_format_error), "End of buffer records are no longer supported starting version " "2 of the log."); - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::NewCPUIdKind: - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::TSCWrapKind: - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::WalltimeMarkerKind: - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::CustomEventMarkerKind: if (Header.Version >= 5) - return make_unique(); - return make_unique(); + return std::make_unique(); + return std::make_unique(); case MetadataRecordKinds::CallArgumentKind: - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::BufferExtentsKind: - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::TypedEventMarkerKind: - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::PidKind: - return make_unique(); + return std::make_unique(); case MetadataRecordKinds::EnumEndMarker: llvm_unreachable("Invalid MetadataRecordKind"); } @@ -167,7 +167,7 @@ Expected> FileBasedRecordProducer::produce() { LoadedType, PreReadOffset)); R = std::move(MetadataRecordOrErr.get()); } else { - R = llvm::make_unique(); + R = std::make_unique(); } RecordInitializer RI(E, OffsetPtr); diff --git a/tools/dsymutil/DwarfLinker.cpp b/tools/dsymutil/DwarfLinker.cpp index f8fee696717..18dbf6b87ef 100644 --- a/tools/dsymutil/DwarfLinker.cpp +++ b/tools/dsymutil/DwarfLinker.cpp @@ -239,7 +239,7 @@ bool DwarfLinker::createStreamer(const Triple &TheTriple, if (Options.NoOutput) return true; - Streamer = llvm::make_unique(OutFile, Options); + Streamer = std::make_unique(OutFile, Options); return Streamer->init(TheTriple); } @@ -998,7 +998,7 @@ void DwarfLinker::AssignAbbrev(DIEAbbrev &Abbrev) { } else { // Add to abbreviation list. Abbreviations.push_back( - llvm::make_unique(Abbrev.getTag(), Abbrev.hasChildren())); + std::make_unique(Abbrev.getTag(), Abbrev.hasChildren())); for (const auto &Attr : Abbrev.getData()) Abbreviations.back()->AddAttribute(Attr.getAttribute(), Attr.getForm()); AbbreviationsSet.InsertNode(Abbreviations.back().get(), InsertToken); @@ -2324,7 +2324,7 @@ Error DwarfLinker::loadClangModule( } // Add this module. - Unit = llvm::make_unique(*CU, UnitID++, !Options.NoODR, + Unit = std::make_unique(*CU, UnitID++, !Options.NoODR, ModuleName); Unit->setHasInterestingContent(); analyzeContextInfo(CUDie, 0, *Unit, &ODRContexts.getRoot(), @@ -2711,7 +2711,7 @@ bool DwarfLinker::link(const DebugMap &Map) { LinkContext.Ranges, OffsetsStringPool, UniquingStringPool, ODRContexts, ModulesEndOffset, UnitID, Quiet)) { - LinkContext.CompileUnits.push_back(llvm::make_unique( + LinkContext.CompileUnits.push_back(std::make_unique( *CU, UnitID++, !Options.NoODR && !Options.Update, "")); } } diff --git a/tools/dsymutil/DwarfStreamer.cpp b/tools/dsymutil/DwarfStreamer.cpp index 8fc29851786..75ec3207b03 100644 --- a/tools/dsymutil/DwarfStreamer.cpp +++ b/tools/dsymutil/DwarfStreamer.cpp @@ -91,7 +91,7 @@ bool DwarfStreamer::init(Triple TheTriple) { MIP = TheTarget->createMCInstPrinter(TheTriple, MAI->getAssemblerDialect(), *MAI, *MII, *MRI); MS = TheTarget->createAsmStreamer( - *MC, llvm::make_unique(OutFile), true, true, MIP, + *MC, std::make_unique(OutFile), true, true, MIP, std::unique_ptr(MCE), std::unique_ptr(MAB), true); break; diff --git a/tools/dsymutil/MachODebugMapParser.cpp b/tools/dsymutil/MachODebugMapParser.cpp index 8c7e686a304..27379c232de 100644 --- a/tools/dsymutil/MachODebugMapParser.cpp +++ b/tools/dsymutil/MachODebugMapParser.cpp @@ -163,7 +163,7 @@ MachODebugMapParser::parseOneBinary(const MachOObjectFile &MainBinary, StringRef BinaryPath) { loadMainBinarySymbols(MainBinary); ArrayRef UUID = MainBinary.getUuid(); - Result = make_unique(MainBinary.getArchTriple(), BinaryPath, UUID); + Result = std::make_unique(MainBinary.getArchTriple(), BinaryPath, UUID); MainBinaryStrings = MainBinary.getStringTableData(); for (const SymbolRef &Symbol : MainBinary.symbols()) { const DataRefImpl &DRI = Symbol.getRawDataRefImpl(); diff --git a/tools/dsymutil/MachOUtils.cpp b/tools/dsymutil/MachOUtils.cpp index cd0f2805dc2..ec9df299ebb 100644 --- a/tools/dsymutil/MachOUtils.cpp +++ b/tools/dsymutil/MachOUtils.cpp @@ -35,7 +35,7 @@ llvm::Error ArchAndFile::createTempFile() { if (!T) return T.takeError(); - File = llvm::make_unique(std::move(*T)); + File = std::make_unique(std::move(*T)); return Error::success(); } diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index 0211add7e20..0f720b6be23 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -81,7 +81,7 @@ struct PluginInputFile { std::unique_ptr File; PluginInputFile(void *Handle) : Handle(Handle) { - File = llvm::make_unique(); + File = std::make_unique(); if (get_input_file(Handle, File.get()) != LDPS_OK) message(LDPL_FATAL, "Failed to get file information"); } @@ -924,7 +924,7 @@ static std::unique_ptr createLTO(IndexWriteCallback OnIndexWrite, Conf.DebugPassManager = options::debug_pass_manager; Conf.StatsFile = options::stats_file; - return llvm::make_unique(std::move(Conf), Backend, + return std::make_unique(std::move(Conf), Backend, options::ParallelCodeGenParallelismLevel); } @@ -974,7 +974,7 @@ static std::unique_ptr CreateLinkedObjectsFile() { return nullptr; assert(options::thinlto_index_only); std::error_code EC; - auto LinkedObjectsFile = llvm::make_unique( + auto LinkedObjectsFile = std::make_unique( options::thinlto_linked_objects_file, EC, sys::fs::OpenFlags::OF_None); if (EC) message(LDPL_FATAL, "Failed to create '%s': %s", @@ -1011,7 +1011,7 @@ static std::vector, bool>> runLTO() { for (claimed_file &F : Modules) { if (options::thinlto && !HandleToInputFile.count(F.leader_handle)) HandleToInputFile.insert(std::make_pair( - F.leader_handle, llvm::make_unique(F.handle))); + F.leader_handle, std::make_unique(F.handle))); // In case we are thin linking with a minimized bitcode file, ensure // the module paths encoded in the index reflect where the backends // will locate the full bitcode files for compiling/importing. @@ -1046,8 +1046,8 @@ static std::vector, bool>> runLTO() { Files[Task].second = !SaveTemps; int FD = getOutputFileName(Filename, /* TempOutFile */ !SaveTemps, Files[Task].first, Task); - return llvm::make_unique( - llvm::make_unique(FD, true)); + return std::make_unique( + std::make_unique(FD, true)); }; auto AddBuffer = [&](size_t Task, std::unique_ptr MB) { diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 7df07b90a1d..74ad643496b 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -242,7 +242,7 @@ static std::unique_ptr GetOutputStream(const char *TargetName, sys::fs::OpenFlags OpenFlags = sys::fs::OF_None; if (!Binary) OpenFlags |= sys::fs::OF_Text; - auto FDOut = llvm::make_unique(OutputFilename, EC, OpenFlags); + auto FDOut = std::make_unique(OutputFilename, EC, OpenFlags); if (EC) { WithColor::error() << EC.message() << '\n'; return nullptr; @@ -329,7 +329,7 @@ int main(int argc, char **argv) { // Set a diagnostic handler that doesn't exit on the first error bool HasError = false; Context.setDiagnosticHandler( - llvm::make_unique(&HasError)); + std::make_unique(&HasError)); Context.setInlineAsmDiagnosticHandler(InlineAsmDiagHandler, &HasError); Expected> RemarksFileOrErr = @@ -479,7 +479,7 @@ static int compileModule(char **argv, LLVMContext &Context) { std::unique_ptr DwoOut; if (!SplitDwarfOutputFile.empty()) { std::error_code EC; - DwoOut = llvm::make_unique(SplitDwarfOutputFile, EC, + DwoOut = std::make_unique(SplitDwarfOutputFile, EC, sys::fs::OF_None); if (EC) { WithColor::error(errs(), argv[0]) << EC.message() << '\n'; @@ -533,7 +533,7 @@ static int compileModule(char **argv, LLVMContext &Context) { if ((FileType != TargetMachine::CGFT_AssemblyFile && !Out->os().supportsSeeking()) || CompileTwice) { - BOS = make_unique(Buffer); + BOS = std::make_unique(Buffer); OS = BOS.get(); } diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 84b0f6c08c9..ccad0672141 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -308,7 +308,7 @@ static void addCygMingExtraModule(ExecutionEngine &EE, LLVMContext &Context, Triple TargetTriple(TargetTripleStr); // Create a new module. - std::unique_ptr M = make_unique("CygMingHelper", Context); + std::unique_ptr M = std::make_unique("CygMingHelper", Context); M->setTargetTriple(TargetTripleStr); // Create an empty function named "__main". @@ -744,7 +744,7 @@ int runOrcLazyJIT(const char *ProgName) { // Start setting up the JIT environment. // Parse the main module. - orc::ThreadSafeContext TSCtx(llvm::make_unique()); + orc::ThreadSafeContext TSCtx(std::make_unique()); SMDiagnostic Err; auto MainModule = parseIRFile(InputFile, Err, *TSCtx.getContext()); if (!MainModule) @@ -962,6 +962,6 @@ std::unique_ptr launchRemote() { close(PipeFD[1][1]); // Return an RPC channel connected to our end of the pipes. - return llvm::make_unique(PipeFD[1][0], PipeFD[0][1]); + return std::make_unique(PipeFD[1][0], PipeFD[0][1]); #endif } diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp index f707e3c7ab5..7151cfb032f 100644 --- a/tools/llvm-cov/CodeCoverage.cpp +++ b/tools/llvm-cov/CodeCoverage.cpp @@ -712,15 +712,15 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { // Create the function filters if (!NameFilters.empty() || NameWhitelist || !NameRegexFilters.empty()) { - auto NameFilterer = llvm::make_unique(); + auto NameFilterer = std::make_unique(); for (const auto &Name : NameFilters) - NameFilterer->push_back(llvm::make_unique(Name)); + NameFilterer->push_back(std::make_unique(Name)); if (NameWhitelist) NameFilterer->push_back( - llvm::make_unique(*NameWhitelist)); + std::make_unique(*NameWhitelist)); for (const auto &Regex : NameRegexFilters) NameFilterer->push_back( - llvm::make_unique(Regex)); + std::make_unique(Regex)); Filters.push_back(std::move(NameFilterer)); } @@ -728,18 +728,18 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { RegionCoverageGtFilter.getNumOccurrences() || LineCoverageLtFilter.getNumOccurrences() || LineCoverageGtFilter.getNumOccurrences()) { - auto StatFilterer = llvm::make_unique(); + auto StatFilterer = std::make_unique(); if (RegionCoverageLtFilter.getNumOccurrences()) - StatFilterer->push_back(llvm::make_unique( + StatFilterer->push_back(std::make_unique( RegionCoverageFilter::LessThan, RegionCoverageLtFilter)); if (RegionCoverageGtFilter.getNumOccurrences()) - StatFilterer->push_back(llvm::make_unique( + StatFilterer->push_back(std::make_unique( RegionCoverageFilter::GreaterThan, RegionCoverageGtFilter)); if (LineCoverageLtFilter.getNumOccurrences()) - StatFilterer->push_back(llvm::make_unique( + StatFilterer->push_back(std::make_unique( LineCoverageFilter::LessThan, LineCoverageLtFilter)); if (LineCoverageGtFilter.getNumOccurrences()) - StatFilterer->push_back(llvm::make_unique( + StatFilterer->push_back(std::make_unique( RegionCoverageFilter::GreaterThan, LineCoverageGtFilter)); Filters.push_back(std::move(StatFilterer)); } @@ -747,7 +747,7 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { // Create the ignore filename filters. for (const auto &RE : IgnoreFilenameRegexFilters) IgnoreFilenameFilters.push_back( - llvm::make_unique(RE)); + std::make_unique(RE)); if (!Arches.empty()) { for (const std::string &Arch : Arches) { @@ -1040,7 +1040,7 @@ int CodeCoverageTool::doExport(int argc, const char **argv, switch (ViewOpts.Format) { case CoverageViewOptions::OutputFormat::Text: - Exporter = llvm::make_unique(*Coverage.get(), + Exporter = std::make_unique(*Coverage.get(), ViewOpts, outs()); break; case CoverageViewOptions::OutputFormat::HTML: @@ -1048,7 +1048,7 @@ int CodeCoverageTool::doExport(int argc, const char **argv, // above. llvm_unreachable("Export in HTML is not supported!"); case CoverageViewOptions::OutputFormat::Lcov: - Exporter = llvm::make_unique(*Coverage.get(), + Exporter = std::make_unique(*Coverage.get(), ViewOpts, outs()); break; } diff --git a/tools/llvm-cov/SourceCoverageView.cpp b/tools/llvm-cov/SourceCoverageView.cpp index 616f667e2c8..0e20ea63cd6 100644 --- a/tools/llvm-cov/SourceCoverageView.cpp +++ b/tools/llvm-cov/SourceCoverageView.cpp @@ -76,9 +76,9 @@ std::unique_ptr CoveragePrinter::create(const CoverageViewOptions &Opts) { switch (Opts.Format) { case CoverageViewOptions::OutputFormat::Text: - return llvm::make_unique(Opts); + return std::make_unique(Opts); case CoverageViewOptions::OutputFormat::HTML: - return llvm::make_unique(Opts); + return std::make_unique(Opts); case CoverageViewOptions::OutputFormat::Lcov: // Unreachable because CodeCoverage.cpp should terminate with an error // before we get here. @@ -141,10 +141,10 @@ SourceCoverageView::create(StringRef SourceName, const MemoryBuffer &File, CoverageData &&CoverageInfo) { switch (Options.Format) { case CoverageViewOptions::OutputFormat::Text: - return llvm::make_unique( + return std::make_unique( SourceName, File, Options, std::move(CoverageInfo)); case CoverageViewOptions::OutputFormat::HTML: - return llvm::make_unique( + return std::make_unique( SourceName, File, Options, std::move(CoverageInfo)); case CoverageViewOptions::OutputFormat::Lcov: // Unreachable because CodeCoverage.cpp should terminate with an error diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp index 1db498f035f..ae3295171d1 100644 --- a/tools/llvm-dis/llvm-dis.cpp +++ b/tools/llvm-dis/llvm-dis.cpp @@ -153,7 +153,7 @@ int main(int argc, char **argv) { LLVMContext Context; Context.setDiagnosticHandler( - llvm::make_unique(argv[0])); + std::make_unique(argv[0])); cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n"); std::unique_ptr MB = diff --git a/tools/llvm-elfabi/ELFObjHandler.cpp b/tools/llvm-elfabi/ELFObjHandler.cpp index a41fc19f56c..b886a8dff25 100644 --- a/tools/llvm-elfabi/ELFObjHandler.cpp +++ b/tools/llvm-elfabi/ELFObjHandler.cpp @@ -292,7 +292,7 @@ buildStub(const ELFObjectFile &ElfObj) { using Elf_Phdr_Range = typename ELFT::PhdrRange; using Elf_Sym_Range = typename ELFT::SymRange; using Elf_Sym = typename ELFT::Sym; - std::unique_ptr DestStub = make_unique(); + std::unique_ptr DestStub = std::make_unique(); const ELFFile *ElfFile = ElfObj.getELFFile(); // Fetch .dynamic table. Expected DynTable = ElfFile->dynamicEntries(); diff --git a/tools/llvm-exegesis/lib/Analysis.cpp b/tools/llvm-exegesis/lib/Analysis.cpp index 53b2005d0db..eb8320e06bb 100644 --- a/tools/llvm-exegesis/lib/Analysis.cpp +++ b/tools/llvm-exegesis/lib/Analysis.cpp @@ -178,7 +178,7 @@ Analysis::Analysis(const llvm::Target &Target, llvm::Triple(FirstPoint.LLVMTriple), 0 /*default variant*/, *AsmInfo_, *InstrInfo_, *RegInfo_)); - Context_ = llvm::make_unique(AsmInfo_.get(), RegInfo_.get(), + Context_ = std::make_unique(AsmInfo_.get(), RegInfo_.get(), &ObjectFileInfo_); Disasm_.reset(Target.createMCDisassembler(*SubtargetInfo_, *Context_)); assert(Disasm_ && "cannot create MCDisassembler. missing call to " diff --git a/tools/llvm-exegesis/lib/Assembler.cpp b/tools/llvm-exegesis/lib/Assembler.cpp index 437fe892603..9695c79b57a 100644 --- a/tools/llvm-exegesis/lib/Assembler.cpp +++ b/tools/llvm-exegesis/lib/Assembler.cpp @@ -131,20 +131,20 @@ static void fillMachineFunction(llvm::MachineFunction &MF, static std::unique_ptr createModule(const std::unique_ptr &Context, const llvm::DataLayout DL) { - auto Module = llvm::make_unique(ModuleID, *Context); + auto Module = std::make_unique(ModuleID, *Context); Module->setDataLayout(DL); return Module; } llvm::BitVector getFunctionReservedRegs(const llvm::TargetMachine &TM) { std::unique_ptr Context = - llvm::make_unique(); + std::make_unique(); std::unique_ptr Module = createModule(Context, TM.createDataLayout()); // TODO: This only works for targets implementing LLVMTargetMachine. const LLVMTargetMachine &LLVMTM = static_cast(TM); std::unique_ptr MMI = - llvm::make_unique(&LLVMTM); + std::make_unique(&LLVMTM); llvm::MachineFunction &MF = createVoidVoidPtrMachineFunction(FunctionID, Module.get(), MMI.get()); // Saving reserved registers for client. @@ -158,11 +158,11 @@ void assembleToStream(const ExegesisTarget &ET, llvm::ArrayRef Instructions, llvm::raw_pwrite_stream &AsmStream) { std::unique_ptr Context = - llvm::make_unique(); + std::make_unique(); std::unique_ptr Module = createModule(Context, TM->createDataLayout()); std::unique_ptr MMI = - llvm::make_unique(TM.get()); + std::make_unique(TM.get()); llvm::MachineFunction &MF = createVoidVoidPtrMachineFunction(FunctionID, Module.get(), MMI.get()); @@ -268,7 +268,7 @@ private: ExecutableFunction::ExecutableFunction( std::unique_ptr TM, llvm::object::OwningBinary &&ObjectFileHolder) - : Context(llvm::make_unique()) { + : Context(std::make_unique()) { assert(ObjectFileHolder.getBinary() && "cannot create object file"); // Initializing the execution engine. // We need to use the JIT EngineKind to be able to add an object file. @@ -281,7 +281,7 @@ ExecutableFunction::ExecutableFunction( .setMCPU(TM->getTargetCPU()) .setEngineKind(llvm::EngineKind::JIT) .setMCJITMemoryManager( - llvm::make_unique(&CodeSize)) + std::make_unique(&CodeSize)) .create(TM.release())); if (!ExecEngine) llvm::report_fatal_error(Error); diff --git a/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/tools/llvm-exegesis/lib/BenchmarkRunner.cpp index 1f0ca6f8bf5..38abf3eefa3 100644 --- a/tools/llvm-exegesis/lib/BenchmarkRunner.cpp +++ b/tools/llvm-exegesis/lib/BenchmarkRunner.cpp @@ -29,7 +29,7 @@ BenchmarkFailure::BenchmarkFailure(const llvm::Twine &S) BenchmarkRunner::BenchmarkRunner(const LLVMState &State, InstructionBenchmark::ModeE Mode) - : State(State), Mode(Mode), Scratch(llvm::make_unique()) {} + : State(State), Mode(Mode), Scratch(std::make_unique()) {} BenchmarkRunner::~BenchmarkRunner() = default; diff --git a/tools/llvm-exegesis/lib/BenchmarkRunner.h b/tools/llvm-exegesis/lib/BenchmarkRunner.h index 395c0f8e32d..29e98619301 100644 --- a/tools/llvm-exegesis/lib/BenchmarkRunner.h +++ b/tools/llvm-exegesis/lib/BenchmarkRunner.h @@ -53,7 +53,7 @@ public: static constexpr const size_t kAlignment = 1024; static constexpr const size_t kSize = 1 << 20; // 1MB. ScratchSpace() - : UnalignedPtr(llvm::make_unique(kSize + kAlignment)), + : UnalignedPtr(std::make_unique(kSize + kAlignment)), AlignedPtr( UnalignedPtr.get() + kAlignment - (reinterpret_cast(UnalignedPtr.get()) % kAlignment)) {} diff --git a/tools/llvm-exegesis/lib/Target.cpp b/tools/llvm-exegesis/lib/Target.cpp index 945aabb8a3f..a5ba24c20f2 100644 --- a/tools/llvm-exegesis/lib/Target.cpp +++ b/tools/llvm-exegesis/lib/Target.cpp @@ -68,22 +68,22 @@ ExegesisTarget::createBenchmarkRunner(InstructionBenchmark::ModeE Mode, std::unique_ptr ExegesisTarget::createLatencySnippetGenerator(const LLVMState &State) const { - return llvm::make_unique(State); + return std::make_unique(State); } std::unique_ptr ExegesisTarget::createUopsSnippetGenerator(const LLVMState &State) const { - return llvm::make_unique(State); + return std::make_unique(State); } std::unique_ptr ExegesisTarget::createLatencyBenchmarkRunner( const LLVMState &State, InstructionBenchmark::ModeE Mode) const { - return llvm::make_unique(State, Mode); + return std::make_unique(State, Mode); } std::unique_ptr ExegesisTarget::createUopsBenchmarkRunner(const LLVMState &State) const { - return llvm::make_unique(State); + return std::make_unique(State); } void ExegesisTarget::randomizeMCOperand( diff --git a/tools/llvm-exegesis/lib/X86/Target.cpp b/tools/llvm-exegesis/lib/X86/Target.cpp index 21d424a4bee..cebcb1c1aea 100644 --- a/tools/llvm-exegesis/lib/X86/Target.cpp +++ b/tools/llvm-exegesis/lib/X86/Target.cpp @@ -453,12 +453,12 @@ private: std::unique_ptr createLatencySnippetGenerator(const LLVMState &State) const override { - return llvm::make_unique(State); + return std::make_unique(State); } std::unique_ptr createUopsSnippetGenerator(const LLVMState &State) const override { - return llvm::make_unique(State); + return std::make_unique(State); } bool matchesArch(llvm::Triple::ArchType Arch) const override { diff --git a/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp b/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp index a348ab300d1..a27f1147a4a 100644 --- a/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp +++ b/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp @@ -59,7 +59,7 @@ std::unique_ptr createISelMutator() { new InjectorIRStrategy(InjectorIRStrategy::getDefaultOps())); Strategies.emplace_back(new InstDeleterIRStrategy()); - return llvm::make_unique(std::move(Types), std::move(Strategies)); + return std::make_unique(std::move(Types), std::move(Strategies)); } extern "C" LLVM_ATTRIBUTE_USED size_t LLVMFuzzerCustomMutator( diff --git a/tools/llvm-jitlink/llvm-jitlink.cpp b/tools/llvm-jitlink/llvm-jitlink.cpp index 79c185a926e..1e449153ad8 100644 --- a/tools/llvm-jitlink/llvm-jitlink.cpp +++ b/tools/llvm-jitlink/llvm-jitlink.cpp @@ -233,10 +233,10 @@ Session::Session(Triple TT) : ObjLayer(ES, MemMgr), TT(std::move(TT)) { }; if (!NoExec && !TT.isOSWindows()) - ObjLayer.addPlugin(llvm::make_unique( + ObjLayer.addPlugin(std::make_unique( InProcessEHFrameRegistrar::getInstance())); - ObjLayer.addPlugin(llvm::make_unique(*this)); + ObjLayer.addPlugin(std::make_unique(*this)); } void Session::dumpSessionInfo(raw_ostream &OS) { @@ -589,7 +589,7 @@ Expected runEntryPoint(Session &S, JITEvaluatedSymbol EntryPoint) { assert(EntryPoint.getAddress() && "Entry point address should not be null"); constexpr const char *JITProgramName = ""; - auto PNStorage = llvm::make_unique(strlen(JITProgramName) + 1); + auto PNStorage = std::make_unique(strlen(JITProgramName) + 1); strcpy(PNStorage.get(), JITProgramName); std::vector EntryPointArgs; diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index 46d9d5d7292..fa36e083b6f 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -351,13 +351,13 @@ int main(int argc, char **argv) { LLVMContext Context; Context.setDiagnosticHandler( - llvm::make_unique(), true); + std::make_unique(), true); cl::ParseCommandLineOptions(argc, argv, "llvm linker\n"); if (!DisableDITypeMap) Context.enableDebugTypeODRUniquing(); - auto Composite = make_unique("llvm-link", Context); + auto Composite = std::make_unique("llvm-link", Context); Linker L(*Composite); unsigned Flags = Linker::Flags::None; diff --git a/tools/llvm-lto/llvm-lto.cpp b/tools/llvm-lto/llvm-lto.cpp index eb3448e74e6..b47e68e8285 100644 --- a/tools/llvm-lto/llvm-lto.cpp +++ b/tools/llvm-lto/llvm-lto.cpp @@ -315,8 +315,8 @@ getLocalLTOModule(StringRef Path, std::unique_ptr &Buffer, error(BufferOrErr, "error loading file '" + Path + "'"); Buffer = std::move(BufferOrErr.get()); CurrentActivity = ("loading file '" + Path + "'").str(); - std::unique_ptr Context = llvm::make_unique(); - Context->setDiagnosticHandler(llvm::make_unique(), + std::unique_ptr Context = std::make_unique(); + Context->setDiagnosticHandler(std::make_unique(), true); ErrorOr> Ret = LTOModule::createInLocalContext( std::move(Context), Buffer->getBufferStart(), Buffer->getBufferSize(), @@ -921,7 +921,7 @@ int main(int argc, char **argv) { unsigned BaseArg = 0; LLVMContext Context; - Context.setDiagnosticHandler(llvm::make_unique(), + Context.setDiagnosticHandler(std::make_unique(), true); LTOCodeGenerator CodeGen(Context); diff --git a/tools/llvm-lto2/llvm-lto2.cpp b/tools/llvm-lto2/llvm-lto2.cpp index 91e2a444326..5e3b3dcb6c3 100644 --- a/tools/llvm-lto2/llvm-lto2.cpp +++ b/tools/llvm-lto2/llvm-lto2.cpp @@ -333,9 +333,9 @@ static int run(int argc, char **argv) { std::string Path = OutputFilename + "." + utostr(Task); std::error_code EC; - auto S = llvm::make_unique(Path, EC, sys::fs::OF_None); + auto S = std::make_unique(Path, EC, sys::fs::OF_None); check(EC, Path); - return llvm::make_unique(std::move(S)); + return std::make_unique(std::move(S)); }; auto AddBuffer = [&](size_t Task, std::unique_ptr MB) { diff --git a/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp b/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp index a996d496a99..d59229e6496 100644 --- a/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp +++ b/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp @@ -197,7 +197,7 @@ int AssembleOneInput(const uint8_t *Data, size_t Size) { std::string OutputString; raw_string_ostream Out(OutputString); - auto FOut = llvm::make_unique(Out); + auto FOut = std::make_unique(Out); std::unique_ptr Str; @@ -211,7 +211,7 @@ int AssembleOneInput(const uint8_t *Data, size_t Size) { std::error_code EC; const std::string OutputFilename = "-"; auto Out = - llvm::make_unique(OutputFilename, EC, sys::fs::OF_None); + std::make_unique(OutputFilename, EC, sys::fs::OF_None); if (EC) { errs() << EC.message() << '\n'; abort(); @@ -223,7 +223,7 @@ int AssembleOneInput(const uint8_t *Data, size_t Size) { std::unique_ptr BOS; raw_pwrite_stream *OS = &Out->os(); if (!Out->os().supportsSeeking()) { - BOS = make_unique(Out->os()); + BOS = std::make_unique(Out->os()); OS = BOS.get(); } diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index ac6b464ab07..832c46683b8 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -211,7 +211,7 @@ static const Target *GetTarget(const char *ProgName) { static std::unique_ptr GetOutputStream(StringRef Path) { std::error_code EC; - auto Out = llvm::make_unique(Path, EC, sys::fs::OF_None); + auto Out = std::make_unique(Path, EC, sys::fs::OF_None); if (EC) { WithColor::error() << EC.message() << '\n'; return nullptr; @@ -459,7 +459,7 @@ int main(int argc, char **argv) { std::unique_ptr MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); - auto FOut = llvm::make_unique(*OS); + auto FOut = std::make_unique(*OS); Str.reset( TheTarget->createAsmStreamer(Ctx, std::move(FOut), /*asmverbose*/ true, /*useDwarfDirectory*/ true, IP, @@ -474,7 +474,7 @@ int main(int argc, char **argv) { Ctx.setUseNamesOnTempLabels(false); if (!Out->os().supportsSeeking()) { - BOS = make_unique(Out->os()); + BOS = std::make_unique(Out->os()); OS = BOS.get(); } diff --git a/tools/llvm-mca/CodeRegion.cpp b/tools/llvm-mca/CodeRegion.cpp index bf592f67245..e05517c1ac9 100644 --- a/tools/llvm-mca/CodeRegion.cpp +++ b/tools/llvm-mca/CodeRegion.cpp @@ -18,7 +18,7 @@ namespace mca { CodeRegions::CodeRegions(llvm::SourceMgr &S) : SM(S), FoundErrors(false) { // Create a default region for the input code sequence. - Regions.emplace_back(make_unique("", SMLoc())); + Regions.emplace_back(std::make_unique("", SMLoc())); } bool CodeRegion::isLocInRange(SMLoc Loc) const { @@ -36,7 +36,7 @@ void CodeRegions::beginRegion(StringRef Description, SMLoc Loc) { if (Regions.size() == 1 && !Regions[0]->startLoc().isValid() && !Regions[0]->endLoc().isValid()) { ActiveRegions[Description] = 0; - Regions[0] = make_unique(Description, Loc); + Regions[0] = std::make_unique(Description, Loc); return; } } else { @@ -62,7 +62,7 @@ void CodeRegions::beginRegion(StringRef Description, SMLoc Loc) { } ActiveRegions[Description] = Regions.size(); - Regions.emplace_back(make_unique(Description, Loc)); + Regions.emplace_back(std::make_unique(Description, Loc)); return; } diff --git a/tools/llvm-mca/llvm-mca.cpp b/tools/llvm-mca/llvm-mca.cpp index 1bcf850193e..dde42c11730 100644 --- a/tools/llvm-mca/llvm-mca.cpp +++ b/tools/llvm-mca/llvm-mca.cpp @@ -233,7 +233,7 @@ ErrorOr> getOutputStream() { OutputFilename = "-"; std::error_code EC; auto Out = - llvm::make_unique(OutputFilename, EC, sys::fs::OF_None); + std::make_unique(OutputFilename, EC, sys::fs::OF_None); if (!EC) return std::move(Out); return EC; @@ -485,18 +485,18 @@ int main(int argc, char **argv) { if (PrintInstructionTables) { // Create a pipeline, stages, and a printer. - auto P = llvm::make_unique(); - P->appendStage(llvm::make_unique(S)); - P->appendStage(llvm::make_unique(SM)); + auto P = std::make_unique(); + P->appendStage(std::make_unique(S)); + P->appendStage(std::make_unique(SM)); mca::PipelinePrinter Printer(*P); // Create the views for this pipeline, execute, and emit a report. if (PrintInstructionInfoView) { - Printer.addView(llvm::make_unique( + Printer.addView(std::make_unique( *STI, *MCII, CE, ShowEncoding, Insts, *IP)); } Printer.addView( - llvm::make_unique(*STI, *IP, Insts)); + std::make_unique(*STI, *IP, Insts)); if (!runPipeline(*P)) return 1; @@ -511,37 +511,37 @@ int main(int argc, char **argv) { if (PrintSummaryView) Printer.addView( - llvm::make_unique(SM, Insts, DispatchWidth)); + std::make_unique(SM, Insts, DispatchWidth)); if (EnableBottleneckAnalysis) { - Printer.addView(llvm::make_unique( + Printer.addView(std::make_unique( *STI, *IP, Insts, S.getNumIterations())); } if (PrintInstructionInfoView) - Printer.addView(llvm::make_unique( + Printer.addView(std::make_unique( *STI, *MCII, CE, ShowEncoding, Insts, *IP)); if (PrintDispatchStats) - Printer.addView(llvm::make_unique()); + Printer.addView(std::make_unique()); if (PrintSchedulerStats) - Printer.addView(llvm::make_unique(*STI)); + Printer.addView(std::make_unique(*STI)); if (PrintRetireStats) - Printer.addView(llvm::make_unique(SM)); + Printer.addView(std::make_unique(SM)); if (PrintRegisterFileStats) - Printer.addView(llvm::make_unique(*STI)); + Printer.addView(std::make_unique(*STI)); if (PrintResourcePressureView) Printer.addView( - llvm::make_unique(*STI, *IP, Insts)); + std::make_unique(*STI, *IP, Insts)); if (PrintTimelineView) { unsigned TimelineIterations = TimelineMaxIterations ? TimelineMaxIterations : 10; - Printer.addView(llvm::make_unique( + Printer.addView(std::make_unique( *STI, *IP, Insts, std::min(TimelineIterations, S.getNumIterations()), TimelineMaxCycles)); } diff --git a/tools/llvm-objcopy/COFF/Reader.cpp b/tools/llvm-objcopy/COFF/Reader.cpp index 1f0ec9fa969..a2681be7192 100644 --- a/tools/llvm-objcopy/COFF/Reader.cpp +++ b/tools/llvm-objcopy/COFF/Reader.cpp @@ -196,7 +196,7 @@ Error COFFReader::setSymbolTargets(Object &Obj) const { } Expected> COFFReader::create() const { - auto Obj = llvm::make_unique(); + auto Obj = std::make_unique(); const coff_file_header *CFH = nullptr; const coff_bigobj_file_header *CBFH = nullptr; diff --git a/tools/llvm-objcopy/ELF/ELFObjcopy.cpp b/tools/llvm-objcopy/ELF/ELFObjcopy.cpp index bbaac96f070..da814759bf6 100644 --- a/tools/llvm-objcopy/ELF/ELFObjcopy.cpp +++ b/tools/llvm-objcopy/ELF/ELFObjcopy.cpp @@ -136,16 +136,16 @@ static std::unique_ptr createELFWriter(const CopyConfig &Config, // Depending on the initial ELFT and OutputFormat we need a different Writer. switch (OutputElfType) { case ELFT_ELF32LE: - return llvm::make_unique>(Obj, Buf, + return std::make_unique>(Obj, Buf, !Config.StripSections); case ELFT_ELF64LE: - return llvm::make_unique>(Obj, Buf, + return std::make_unique>(Obj, Buf, !Config.StripSections); case ELFT_ELF32BE: - return llvm::make_unique>(Obj, Buf, + return std::make_unique>(Obj, Buf, !Config.StripSections); case ELFT_ELF64BE: - return llvm::make_unique>(Obj, Buf, + return std::make_unique>(Obj, Buf, !Config.StripSections); } llvm_unreachable("Invalid output format"); @@ -156,9 +156,9 @@ static std::unique_ptr createWriter(const CopyConfig &Config, ElfType OutputElfType) { switch (Config.OutputFormat) { case FileFormat::Binary: - return llvm::make_unique(Obj, Buf); + return std::make_unique(Obj, Buf); case FileFormat::IHex: - return llvm::make_unique(Obj, Buf); + return std::make_unique(Obj, Buf); default: return createELFWriter(Config, Obj, Buf, OutputElfType); } diff --git a/tools/llvm-objcopy/ELF/Object.cpp b/tools/llvm-objcopy/ELF/Object.cpp index 2d85b3ad36f..2862af1c09a 100644 --- a/tools/llvm-objcopy/ELF/Object.cpp +++ b/tools/llvm-objcopy/ELF/Object.cpp @@ -665,7 +665,7 @@ void SymbolTableSection::addSymbol(Twine Name, uint8_t Bind, uint8_t Type, Sym.Visibility = Visibility; Sym.Size = SymbolSize; Sym.Index = Symbols.size(); - Symbols.emplace_back(llvm::make_unique(Sym)); + Symbols.emplace_back(std::make_unique(Sym)); Size += this->EntrySize; } @@ -1645,7 +1645,7 @@ std::unique_ptr IHexReader::create() const { } std::unique_ptr ELFReader::create() const { - auto Obj = llvm::make_unique(); + auto Obj = std::make_unique(); if (auto *O = dyn_cast>(Bin)) { ELFBuilder Builder(*O, *Obj, ExtractPartition); Builder.build(); @@ -2076,7 +2076,7 @@ template Error ELFWriter::finalize() { // Also, the output arch may not be the same as the input arch, so fix up // size-related fields before doing layout calculations. uint64_t Index = 0; - auto SecSizer = llvm::make_unique>(); + auto SecSizer = std::make_unique>(); for (auto &Sec : Obj.sections()) { Sec.Index = Index++; Sec.accept(*SecSizer); @@ -2114,7 +2114,7 @@ template Error ELFWriter::finalize() { if (Error E = Buf.allocate(totalSize())) return E; - SecWriter = llvm::make_unique>(Buf); + SecWriter = std::make_unique>(Buf); return Error::success(); } @@ -2200,7 +2200,7 @@ Error BinaryWriter::finalize() { if (Error E = Buf.allocate(TotalSize)) return E; - SecWriter = llvm::make_unique(Buf); + SecWriter = std::make_unique(Buf); return Error::success(); } diff --git a/tools/llvm-objcopy/ELF/Object.h b/tools/llvm-objcopy/ELF/Object.h index 3b4f3c7a0d7..42d254c1b2b 100644 --- a/tools/llvm-objcopy/ELF/Object.h +++ b/tools/llvm-objcopy/ELF/Object.h @@ -884,7 +884,7 @@ protected: public: BasicELFBuilder(uint16_t EM) - : EMachine(EM), Obj(llvm::make_unique()) {} + : EMachine(EM), Obj(std::make_unique()) {} }; class BinaryELFBuilder : public BasicELFBuilder { @@ -1042,7 +1042,7 @@ public: std::function ToRemove); Error removeSymbols(function_ref ToRemove); template T &addSection(Ts &&... Args) { - auto Sec = llvm::make_unique(std::forward(Args)...); + auto Sec = std::make_unique(std::forward(Args)...); auto Ptr = Sec.get(); MustBeRelocatable |= isa(*Ptr); Sections.emplace_back(std::move(Sec)); @@ -1050,7 +1050,7 @@ public: return *Ptr; } Segment &addSegment(ArrayRef Data) { - Segments.emplace_back(llvm::make_unique(Data)); + Segments.emplace_back(std::make_unique(Data)); return *Segments.back(); } bool isRelocatable() const { diff --git a/tools/llvm-objcopy/MachO/MachOReader.cpp b/tools/llvm-objcopy/MachO/MachOReader.cpp index d3129303460..23dde7de53d 100644 --- a/tools/llvm-objcopy/MachO/MachOReader.cpp +++ b/tools/llvm-objcopy/MachO/MachOReader.cpp @@ -188,7 +188,7 @@ void MachOReader::readSymbolTable(Object &O) const { StrTable, MachOObj.getSymbolTableEntry(Symbol.getRawDataRefImpl()))); - O.SymTable.Symbols.push_back(llvm::make_unique(SE)); + O.SymTable.Symbols.push_back(std::make_unique(SE)); } } @@ -223,7 +223,7 @@ void MachOReader::readExportInfo(Object &O) const { } std::unique_ptr MachOReader::create() const { - auto Obj = llvm::make_unique(); + auto Obj = std::make_unique(); readHeader(*Obj); readLoadCommands(*Obj); readSymbolTable(*Obj); diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index c4fa6b5c2a2..e91808b276b 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -3131,7 +3131,7 @@ static void method_reference(struct DisassembleInfo *info, if (strcmp(*ReferenceName, "_objc_msgSend") == 0) { if (info->selector_name != nullptr) { if (info->class_name != nullptr) { - info->method = llvm::make_unique( + info->method = std::make_unique( 5 + strlen(info->class_name) + strlen(info->selector_name)); char *method = info->method.get(); if (method != nullptr) { @@ -3145,7 +3145,7 @@ static void method_reference(struct DisassembleInfo *info, } } else { info->method = - llvm::make_unique(9 + strlen(info->selector_name)); + std::make_unique(9 + strlen(info->selector_name)); char *method = info->method.get(); if (method != nullptr) { if (Arch == Triple::x86_64) @@ -3165,7 +3165,7 @@ static void method_reference(struct DisassembleInfo *info, } else if (strcmp(*ReferenceName, "_objc_msgSendSuper2") == 0) { if (info->selector_name != nullptr) { info->method = - llvm::make_unique(17 + strlen(info->selector_name)); + std::make_unique(17 + strlen(info->selector_name)); char *method = info->method.get(); if (method != nullptr) { if (Arch == Triple::x86_64) @@ -10411,7 +10411,7 @@ void printMachOWeakBindTable(object::MachOObjectFile *Obj) { static const char *get_dyld_bind_info_symbolname(uint64_t ReferenceValue, struct DisassembleInfo *info) { if (info->bindtable == nullptr) { - info->bindtable = llvm::make_unique(); + info->bindtable = std::make_unique(); Error Err = Error::success(); for (const object::MachOBindEntry &Entry : info->O->bindTable(Err)) { uint64_t Address = Entry.address(); diff --git a/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp b/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp index 6567aaebd6c..02c113d117b 100644 --- a/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp +++ b/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp @@ -41,12 +41,12 @@ std::unique_ptr createOptMutator() { std::vector> Strategies; Strategies.push_back( - llvm::make_unique( + std::make_unique( InjectorIRStrategy::getDefaultOps())); Strategies.push_back( - llvm::make_unique()); + std::make_unique()); - return llvm::make_unique(std::move(Types), std::move(Strategies)); + return std::make_unique(std::move(Types), std::move(Strategies)); } extern "C" LLVM_ATTRIBUTE_USED size_t LLVMFuzzerCustomMutator( diff --git a/tools/llvm-pdbutil/BytesOutputStyle.cpp b/tools/llvm-pdbutil/BytesOutputStyle.cpp index 162d12c120b..ffc907e09f1 100644 --- a/tools/llvm-pdbutil/BytesOutputStyle.cpp +++ b/tools/llvm-pdbutil/BytesOutputStyle.cpp @@ -457,7 +457,7 @@ BytesOutputStyle::initializeTypes(uint32_t StreamIdx) { uint32_t Count = Tpi->getNumTypeRecords(); auto Offsets = Tpi->getTypeIndexOffsets(); TypeCollection = - llvm::make_unique(Types, Count, Offsets); + std::make_unique(Types, Count, Offsets); return *TypeCollection; } diff --git a/tools/llvm-pdbutil/DumpOutputStyle.cpp b/tools/llvm-pdbutil/DumpOutputStyle.cpp index 288e76cc173..4d82e0fd917 100644 --- a/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ b/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -1552,7 +1552,7 @@ Error DumpOutputStyle::dumpModuleSymsForObj() { Dumper.setSymbolGroup(&Strings); for (auto Symbol : Symbols) { if (auto EC = Visitor.visitSymbolRecord(Symbol)) { - SymbolError = llvm::make_unique(std::move(EC)); + SymbolError = std::make_unique(std::move(EC)); return; } } diff --git a/tools/llvm-pdbutil/ExplainOutputStyle.cpp b/tools/llvm-pdbutil/ExplainOutputStyle.cpp index 94faa046398..3d2490509c0 100644 --- a/tools/llvm-pdbutil/ExplainOutputStyle.cpp +++ b/tools/llvm-pdbutil/ExplainOutputStyle.cpp @@ -64,7 +64,7 @@ Error ExplainOutputStyle::explainPdbFile() { Error ExplainOutputStyle::explainBinaryFile() { std::unique_ptr Stream = - llvm::make_unique(File.unknown().getBuffer(), + std::make_unique(File.unknown().getBuffer(), llvm::support::little); switch (opts::explain::InputType) { case opts::explain::InputFileType::DBIStream: { diff --git a/tools/llvm-pdbutil/InputFile.cpp b/tools/llvm-pdbutil/InputFile.cpp index 8380054b631..b316882de64 100644 --- a/tools/llvm-pdbutil/InputFile.cpp +++ b/tools/llvm-pdbutil/InputFile.cpp @@ -385,7 +385,7 @@ InputFile::getOrCreateTypeCollection(TypeCollectionKind Kind) { uint32_t Count = Stream.getNumTypeRecords(); auto Offsets = Stream.getTypeIndexOffsets(); Collection = - llvm::make_unique(Array, Count, Offsets); + std::make_unique(Array, Count, Offsets); return *Collection; } @@ -398,11 +398,11 @@ InputFile::getOrCreateTypeCollection(TypeCollectionKind Kind) { if (!isDebugTSection(Section, Records)) continue; - Types = llvm::make_unique(Records, 100); + Types = std::make_unique(Records, 100); return *Types; } - Types = llvm::make_unique(100); + Types = std::make_unique(100); return *Types; } diff --git a/tools/llvm-pdbutil/PrettyTypeDumper.cpp b/tools/llvm-pdbutil/PrettyTypeDumper.cpp index e8f8e5aa62c..2f7a39803ca 100644 --- a/tools/llvm-pdbutil/PrettyTypeDumper.cpp +++ b/tools/llvm-pdbutil/PrettyTypeDumper.cpp @@ -117,7 +117,7 @@ filterAndSortClassDefs(LinePrinter &Printer, Enumerator &E, continue; } - auto Layout = llvm::make_unique(std::move(Class)); + auto Layout = std::make_unique(std::move(Class)); if (Layout->deepPaddingSize() < opts::pretty::PaddingThreshold) { ++Discarded; continue; @@ -259,7 +259,7 @@ void TypeDumper::start(const PDBSymbolExe &Exe) { continue; } - auto Layout = llvm::make_unique(std::move(Class)); + auto Layout = std::make_unique(std::move(Class)); if (Layout->deepPaddingSize() < opts::pretty::PaddingThreshold) continue; diff --git a/tools/llvm-pdbutil/llvm-pdbutil.cpp b/tools/llvm-pdbutil/llvm-pdbutil.cpp index 785a9808679..9307300861d 100644 --- a/tools/llvm-pdbutil/llvm-pdbutil.cpp +++ b/tools/llvm-pdbutil/llvm-pdbutil.cpp @@ -863,8 +863,8 @@ static void pdb2Yaml(StringRef Path) { std::unique_ptr Session; auto &File = loadPDB(Path, Session); - auto O = llvm::make_unique(File); - O = llvm::make_unique(File); + auto O = std::make_unique(File); + O = std::make_unique(File); ExitOnErr(O->dump()); } @@ -872,7 +872,7 @@ static void pdb2Yaml(StringRef Path) { static void dumpRaw(StringRef Path) { InputFile IF = ExitOnErr(InputFile::open(Path)); - auto O = llvm::make_unique(IF); + auto O = std::make_unique(IF); ExitOnErr(O->dump()); } @@ -880,7 +880,7 @@ static void dumpBytes(StringRef Path) { std::unique_ptr Session; auto &File = loadPDB(Path, Session); - auto O = llvm::make_unique(File); + auto O = std::make_unique(File); ExitOnErr(O->dump()); } @@ -1347,7 +1347,7 @@ static void explain() { ExitOnErr(InputFile::open(opts::explain::InputFilename.front(), true)); for (uint64_t Off : opts::explain::Offsets) { - auto O = llvm::make_unique(IF, Off); + auto O = std::make_unique(IF, Off); ExitOnErr(O->dump()); } diff --git a/tools/llvm-profdata/llvm-profdata.cpp b/tools/llvm-profdata/llvm-profdata.cpp index 926dd1576e6..24ccd950a91 100644 --- a/tools/llvm-profdata/llvm-profdata.cpp +++ b/tools/llvm-profdata/llvm-profdata.cpp @@ -136,7 +136,7 @@ public: if (!BufOrError) exitWithErrorCode(BufOrError.getError(), InputFile); - auto Remapper = llvm::make_unique(); + auto Remapper = std::make_unique(); Remapper->File = std::move(BufOrError.get()); for (line_iterator LineIt(*Remapper->File, /*SkipBlanks=*/true, '#'); @@ -328,7 +328,7 @@ static void mergeInstrProfile(const WeightedFileVector &Inputs, // Initialize the writer contexts. SmallVector, 4> Contexts; for (unsigned I = 0; I < NumThreads; ++I) - Contexts.emplace_back(llvm::make_unique( + Contexts.emplace_back(std::make_unique( OutputSparse, ErrorLock, WriterErrorCodes)); if (NumThreads == 1) { diff --git a/tools/llvm-rc/ResourceScriptParser.cpp b/tools/llvm-rc/ResourceScriptParser.cpp index 56534e73087..36b305645fb 100644 --- a/tools/llvm-rc/ResourceScriptParser.cpp +++ b/tools/llvm-rc/ResourceScriptParser.cpp @@ -428,7 +428,7 @@ RCParser::ParseType RCParser::parseAcceleratorsResource() { ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements()); RETURN_IF_ERROR(consumeType(Kind::BlockBegin)); - auto Accels = llvm::make_unique( + auto Accels = std::make_unique( std::move(*OptStatements), MemoryFlags); while (!consumeOptionalType(Kind::BlockEnd)) { @@ -449,7 +449,7 @@ RCParser::ParseType RCParser::parseCursorResource() { uint16_t MemoryFlags = parseMemoryFlags(CursorResource::getDefaultMemoryFlags()); ASSIGN_OR_RETURN(Arg, readFilename()); - return llvm::make_unique(*Arg, MemoryFlags); + return std::make_unique(*Arg, MemoryFlags); } RCParser::ParseType RCParser::parseDialogResource(bool IsExtended) { @@ -475,7 +475,7 @@ RCParser::ParseType RCParser::parseDialogResource(bool IsExtended) { "parseOptionalStatements, when successful, halts on BlockBegin."); consume(); - auto Dialog = llvm::make_unique( + auto Dialog = std::make_unique( (*LocResult)[0], (*LocResult)[1], (*LocResult)[2], (*LocResult)[3], HelpID, std::move(*OptStatements), IsExtended, MemoryFlags); @@ -497,7 +497,7 @@ RCParser::ParseType RCParser::parseUserDefinedResource(IntOrString Type) { switch (look().kind()) { case Kind::String: case Kind::Identifier: - return llvm::make_unique(Type, read().value(), + return std::make_unique(Type, read().value(), MemoryFlags); default: break; @@ -517,7 +517,7 @@ RCParser::ParseType RCParser::parseUserDefinedResource(IntOrString Type) { Data.push_back(*Item); } - return llvm::make_unique(Type, std::move(Data), + return std::make_unique(Type, std::move(Data), MemoryFlags); } @@ -526,7 +526,7 @@ RCParser::ParseType RCParser::parseVersionInfoResource() { parseMemoryFlags(VersionInfoResource::getDefaultMemoryFlags()); ASSIGN_OR_RETURN(FixedResult, parseVersionInfoFixed()); ASSIGN_OR_RETURN(BlockResult, parseVersionInfoBlockContents(StringRef())); - return llvm::make_unique( + return std::make_unique( std::move(**BlockResult), std::move(*FixedResult), MemoryFlags); } @@ -597,21 +597,21 @@ RCParser::ParseType RCParser::parseBitmapResource() { uint16_t MemoryFlags = parseMemoryFlags(BitmapResource::getDefaultMemoryFlags()); ASSIGN_OR_RETURN(Arg, readFilename()); - return llvm::make_unique(*Arg, MemoryFlags); + return std::make_unique(*Arg, MemoryFlags); } RCParser::ParseType RCParser::parseIconResource() { uint16_t MemoryFlags = parseMemoryFlags(IconResource::getDefaultMemoryFlags()); ASSIGN_OR_RETURN(Arg, readFilename()); - return llvm::make_unique(*Arg, MemoryFlags); + return std::make_unique(*Arg, MemoryFlags); } RCParser::ParseType RCParser::parseHTMLResource() { uint16_t MemoryFlags = parseMemoryFlags(HTMLResource::getDefaultMemoryFlags()); ASSIGN_OR_RETURN(Arg, readFilename()); - return llvm::make_unique(*Arg, MemoryFlags); + return std::make_unique(*Arg, MemoryFlags); } RCParser::ParseType RCParser::parseMenuResource() { @@ -619,7 +619,7 @@ RCParser::ParseType RCParser::parseMenuResource() { parseMemoryFlags(MenuResource::getDefaultMemoryFlags()); ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements()); ASSIGN_OR_RETURN(Items, parseMenuItemsList()); - return llvm::make_unique(std::move(*OptStatements), + return std::make_unique(std::move(*OptStatements), std::move(*Items), MemoryFlags); } @@ -644,7 +644,7 @@ Expected RCParser::parseMenuItemsList() { // Now, expecting SEPARATOR. ASSIGN_OR_RETURN(SeparatorResult, readIdentifier()); if (SeparatorResult->equals_lower("SEPARATOR")) { - List.addDefinition(llvm::make_unique()); + List.addDefinition(std::make_unique()); continue; } @@ -669,14 +669,14 @@ Expected RCParser::parseMenuItemsList() { if (IsPopup) { // If POPUP, read submenu items recursively. ASSIGN_OR_RETURN(SubMenuResult, parseMenuItemsList()); - List.addDefinition(llvm::make_unique( + List.addDefinition(std::make_unique( *CaptionResult, *FlagsResult, std::move(*SubMenuResult))); continue; } assert(IsMenuItem); List.addDefinition( - llvm::make_unique(*CaptionResult, MenuResult, *FlagsResult)); + std::make_unique(*CaptionResult, MenuResult, *FlagsResult)); } return std::move(List); @@ -688,7 +688,7 @@ RCParser::ParseType RCParser::parseStringTableResource() { ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements()); RETURN_IF_ERROR(consumeType(Kind::BlockBegin)); - auto Table = llvm::make_unique(std::move(*OptStatements), + auto Table = std::make_unique(std::move(*OptStatements), MemoryFlags); // Read strings until we reach the end of the block. @@ -709,7 +709,7 @@ Expected> RCParser::parseVersionInfoBlockContents(StringRef BlockName) { RETURN_IF_ERROR(consumeType(Kind::BlockBegin)); - auto Contents = llvm::make_unique(BlockName); + auto Contents = std::make_unique(BlockName); while (!isNextTokenKind(Kind::BlockEnd)) { ASSIGN_OR_RETURN(Stmt, parseVersionInfoStmt()); @@ -746,7 +746,7 @@ Expected> RCParser::parseVersionInfoStmt() { Values.push_back(*ValueResult); PrecedingCommas.push_back(HadComma); } - return llvm::make_unique(*KeyResult, std::move(Values), + return std::make_unique(*KeyResult, std::move(Values), std::move(PrecedingCommas)); } @@ -781,27 +781,27 @@ RCParser::parseVersionInfoFixed() { RCParser::ParseOptionType RCParser::parseLanguageStmt() { ASSIGN_OR_RETURN(Args, readIntsWithCommas(/* min = */ 2, /* max = */ 2)); - return llvm::make_unique((*Args)[0], (*Args)[1]); + return std::make_unique((*Args)[0], (*Args)[1]); } RCParser::ParseOptionType RCParser::parseCharacteristicsStmt() { ASSIGN_OR_RETURN(Arg, readInt()); - return llvm::make_unique(*Arg); + return std::make_unique(*Arg); } RCParser::ParseOptionType RCParser::parseVersionStmt() { ASSIGN_OR_RETURN(Arg, readInt()); - return llvm::make_unique(*Arg); + return std::make_unique(*Arg); } RCParser::ParseOptionType RCParser::parseCaptionStmt() { ASSIGN_OR_RETURN(Arg, readString()); - return llvm::make_unique(*Arg); + return std::make_unique(*Arg); } RCParser::ParseOptionType RCParser::parseClassStmt() { ASSIGN_OR_RETURN(Arg, readIntOrString()); - return llvm::make_unique(*Arg); + return std::make_unique(*Arg); } RCParser::ParseOptionType RCParser::parseFontStmt(OptStmtType DialogType) { @@ -826,18 +826,18 @@ RCParser::ParseOptionType RCParser::parseFontStmt(OptStmtType DialogType) { FontCharset = (*Args)[2]; } } - return llvm::make_unique(*SizeResult, *NameResult, FontWeight, + return std::make_unique(*SizeResult, *NameResult, FontWeight, FontItalic, FontCharset); } RCParser::ParseOptionType RCParser::parseStyleStmt() { ASSIGN_OR_RETURN(Arg, readInt()); - return llvm::make_unique(*Arg); + return std::make_unique(*Arg); } RCParser::ParseOptionType RCParser::parseExStyleStmt() { ASSIGN_OR_RETURN(Arg, readInt()); - return llvm::make_unique(*Arg); + return std::make_unique(*Arg); } Error RCParser::getExpectedError(const Twine &Message, bool IsAlreadyRead) { diff --git a/tools/llvm-rc/ResourceScriptStmt.h b/tools/llvm-rc/ResourceScriptStmt.h index fcb55aa76d6..7076eca96a2 100644 --- a/tools/llvm-rc/ResourceScriptStmt.h +++ b/tools/llvm-rc/ResourceScriptStmt.h @@ -287,7 +287,7 @@ public: OptStatementsRCResource(OptionalStmtList &&Stmts, uint16_t Flags = RCResource::getDefaultMemoryFlags()) : RCResource(Flags), - OptStatements(llvm::make_unique(std::move(Stmts))) {} + OptStatements(std::make_unique(std::move(Stmts))) {} virtual Error applyStmts(Visitor *V) const { return OptStatements->visit(V); } }; diff --git a/tools/llvm-rc/llvm-rc.cpp b/tools/llvm-rc/llvm-rc.cpp index 4c115b7f06f..97cc7c88b68 100644 --- a/tools/llvm-rc/llvm-rc.cpp +++ b/tools/llvm-rc/llvm-rc.cpp @@ -176,12 +176,12 @@ int main(int Argc, const char **Argv) { "No more than one output file should be provided (using /FO flag)."); std::error_code EC; - auto FOut = llvm::make_unique( + auto FOut = std::make_unique( OutArgsInfo[0], EC, sys::fs::FA_Read | sys::fs::FA_Write); if (EC) fatalError("Error opening output file '" + OutArgsInfo[0] + "': " + EC.message()); - Visitor = llvm::make_unique(Params, std::move(FOut)); + Visitor = std::make_unique(Params, std::move(FOut)); Visitor->AppendNull = InputArgs.hasArg(OPT_ADD_NULL); ExitOnErr(NullResource().visit(Visitor.get())); diff --git a/tools/llvm-readobj/COFFDumper.cpp b/tools/llvm-readobj/COFFDumper.cpp index c7ccbe9ee4b..4c37d262ae4 100644 --- a/tools/llvm-readobj/COFFDumper.cpp +++ b/tools/llvm-readobj/COFFDumper.cpp @@ -1153,7 +1153,7 @@ void COFFDumper::printCodeViewSymbolsSubsection(StringRef Subsection, StringRef SectionContents) { ArrayRef BinaryData(Subsection.bytes_begin(), Subsection.bytes_end()); - auto CODD = llvm::make_unique(*this, Section, Obj, + auto CODD = std::make_unique(*this, Section, Obj, SectionContents); CVSymbolDumper CVSD(W, Types, CodeViewContainer::ObjectFile, std::move(CODD), CompilationCPUType, opts::CodeViewSubsectionBytes); diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp index 818670a2088..af83ea1227b 100644 --- a/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -889,7 +889,7 @@ static int linkAndVerify() { ObjectFile &Obj = **MaybeObj; if (!Checker) - Checker = llvm::make_unique( + Checker = std::make_unique( IsSymbolValid, GetSymbolInfo, GetSectionInfo, GetStubInfo, GetStubInfo, Obj.isLittleEndian() ? support::little : support::big, Disassembler.get(), InstPrinter.get(), dbgs()); diff --git a/tools/llvm-stress/llvm-stress.cpp b/tools/llvm-stress/llvm-stress.cpp index 5f76e5bf7ec..5f36a785332 100644 --- a/tools/llvm-stress/llvm-stress.cpp +++ b/tools/llvm-stress/llvm-stress.cpp @@ -735,7 +735,7 @@ int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv, "llvm codegen stress-tester\n"); llvm_shutdown_obj Y; - auto M = llvm::make_unique("/tmp/autogen.bc", Context); + auto M = std::make_unique("/tmp/autogen.bc", Context); Function *F = GenEmptyFunction(M.get()); // Pick an initial seed value diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index fc2d3da43c0..ce670c22c7f 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -112,7 +112,7 @@ static void lto_initialize() { static LLVMContext Context; LTOContext = &Context; LTOContext->setDiagnosticHandler( - llvm::make_unique(), true); + std::make_unique(), true); initialized = true; } } @@ -277,8 +277,8 @@ lto_module_t lto_module_create_in_local_context(const void *mem, size_t length, llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags(); // Create a local context. Ownership will be transferred to LTOModule. - std::unique_ptr Context = llvm::make_unique(); - Context->setDiagnosticHandler(llvm::make_unique(), + std::unique_ptr Context = std::make_unique(); + Context->setDiagnosticHandler(std::make_unique(), true); ErrorOr> M = LTOModule::createInLocalContext( @@ -338,7 +338,7 @@ static lto_code_gen_t createCodeGen(bool InLocalContext) { TargetOptions Options = InitTargetOptionsFromCodeGenFlags(); LibLTOCodeGenerator *CodeGen = - InLocalContext ? new LibLTOCodeGenerator(make_unique()) + InLocalContext ? new LibLTOCodeGenerator(std::make_unique()) : new LibLTOCodeGenerator(); CodeGen->setTargetOptions(Options); return wrap(CodeGen); diff --git a/tools/obj2yaml/elf2yaml.cpp b/tools/obj2yaml/elf2yaml.cpp index a228d3917ee..baa1b863273 100644 --- a/tools/obj2yaml/elf2yaml.cpp +++ b/tools/obj2yaml/elf2yaml.cpp @@ -137,7 +137,7 @@ ELFDumper::getUniquedSymbolName(const Elf_Sym *Sym, StringRef StrTable, } template Expected ELFDumper::dump() { - auto Y = make_unique(); + auto Y = std::make_unique(); // Dump header. We do not dump SHEntSize, SHOffset, SHNum and SHStrNdx field. // When not explicitly set, the values are set by yaml2obj automatically @@ -453,7 +453,7 @@ Error ELFDumper::dumpCommonRelocationSection( template Expected ELFDumper::dumpDynamicSection(const Elf_Shdr *Shdr) { - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); @@ -470,7 +470,7 @@ ELFDumper::dumpDynamicSection(const Elf_Shdr *Shdr) { template Expected ELFDumper::dumpRelocSection(const Elf_Shdr *Shdr) { - auto S = make_unique(); + auto S = std::make_unique(); if (auto E = dumpCommonRelocationSection(Shdr, *S)) return std::move(E); @@ -508,7 +508,7 @@ ELFDumper::dumpRelocSection(const Elf_Shdr *Shdr) { template Expected ELFDumper::dumpContentSection(const Elf_Shdr *Shdr) { - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); @@ -532,7 +532,7 @@ ELFDumper::dumpContentSection(const Elf_Shdr *Shdr) { template Expected ELFDumper::dumpSymtabShndxSection(const Elf_Shdr *Shdr) { - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); @@ -547,7 +547,7 @@ ELFDumper::dumpSymtabShndxSection(const Elf_Shdr *Shdr) { template Expected ELFDumper::dumpNoBitsSection(const Elf_Shdr *Shdr) { - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); S->Size = Shdr->sh_size; @@ -561,7 +561,7 @@ ELFDumper::dumpVerdefSection(const Elf_Shdr *Shdr) { typedef typename ELFT::Verdef Elf_Verdef; typedef typename ELFT::Verdaux Elf_Verdaux; - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); @@ -610,7 +610,7 @@ Expected ELFDumper::dumpSymverSection(const Elf_Shdr *Shdr) { typedef typename ELFT::Half Elf_Half; - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); @@ -629,7 +629,7 @@ ELFDumper::dumpVerneedSection(const Elf_Shdr *Shdr) { typedef typename ELFT::Verneed Elf_Verneed; typedef typename ELFT::Vernaux Elf_Vernaux; - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); @@ -682,7 +682,7 @@ ELFDumper::dumpVerneedSection(const Elf_Shdr *Shdr) { template Expected ELFDumper::dumpGroup(const Elf_Shdr *Shdr) { - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); @@ -730,7 +730,7 @@ Expected ELFDumper::dumpMipsABIFlags(const Elf_Shdr *Shdr) { assert(Shdr->sh_type == ELF::SHT_MIPS_ABIFLAGS && "Section type is not SHT_MIPS_ABIFLAGS"); - auto S = make_unique(); + auto S = std::make_unique(); if (Error E = dumpCommonSection(Shdr, *S)) return std::move(E); diff --git a/tools/obj2yaml/macho2yaml.cpp b/tools/obj2yaml/macho2yaml.cpp index 63e81686632..95c42de9fae 100644 --- a/tools/obj2yaml/macho2yaml.cpp +++ b/tools/obj2yaml/macho2yaml.cpp @@ -180,7 +180,7 @@ const char *MachODumper::processLoadCommandData( } Expected> MachODumper::dump() { - auto Y = make_unique(); + auto Y = std::make_unique(); Y->IsLittleEndian = Obj.isLittleEndian(); dumpHeader(Y); dumpLoadCommands(Y); diff --git a/tools/obj2yaml/wasm2yaml.cpp b/tools/obj2yaml/wasm2yaml.cpp index 47d984b53fb..7a540974d50 100644 --- a/tools/obj2yaml/wasm2yaml.cpp +++ b/tools/obj2yaml/wasm2yaml.cpp @@ -53,7 +53,7 @@ WasmDumper::dumpCustomSection(const WasmSection &WasmSec) { std::unique_ptr CustomSec; if (WasmSec.Name == "dylink") { std::unique_ptr DylinkSec = - make_unique(); + std::make_unique(); const wasm::WasmDylinkInfo& Info = Obj.dylinkInfo(); DylinkSec->MemorySize = Info.MemorySize; DylinkSec->MemoryAlignment = Info.MemoryAlignment; @@ -63,7 +63,7 @@ WasmDumper::dumpCustomSection(const WasmSection &WasmSec) { CustomSec = std::move(DylinkSec); } else if (WasmSec.Name == "name") { std::unique_ptr NameSec = - make_unique(); + std::make_unique(); for (const llvm::wasm::WasmFunctionName &Func : Obj.debugNames()) { WasmYAML::NameEntry NameEntry; NameEntry.Name = Func.Name; @@ -73,7 +73,7 @@ WasmDumper::dumpCustomSection(const WasmSection &WasmSec) { CustomSec = std::move(NameSec); } else if (WasmSec.Name == "linking") { std::unique_ptr LinkingSec = - make_unique(); + std::make_unique(); LinkingSec->Version = Obj.linkingData().Version; ArrayRef Comdats = Obj.linkingData().Comdats; @@ -134,7 +134,7 @@ WasmDumper::dumpCustomSection(const WasmSection &WasmSec) { CustomSec = std::move(LinkingSec); } else if (WasmSec.Name == "producers") { std::unique_ptr ProducersSec = - make_unique(); + std::make_unique(); const llvm::wasm::WasmProducerInfo &Info = Obj.getProducerInfo(); for (auto &E : Info.Languages) { WasmYAML::ProducerEntry Producer; @@ -157,7 +157,7 @@ WasmDumper::dumpCustomSection(const WasmSection &WasmSec) { CustomSec = std::move(ProducersSec); } else if (WasmSec.Name == "target_features") { std::unique_ptr TargetFeaturesSec = - make_unique(); + std::make_unique(); for (auto &E : Obj.getTargetFeatures()) { WasmYAML::FeatureEntry Feature; Feature.Prefix = E.Prefix; @@ -166,14 +166,14 @@ WasmDumper::dumpCustomSection(const WasmSection &WasmSec) { } CustomSec = std::move(TargetFeaturesSec); } else { - CustomSec = make_unique(WasmSec.Name); + CustomSec = std::make_unique(WasmSec.Name); } CustomSec->Payload = yaml::BinaryRef(WasmSec.Content); return CustomSec; } ErrorOr WasmDumper::dump() { - auto Y = make_unique(); + auto Y = std::make_unique(); // Dump header Y->Header.Version = Obj.getHeader().Version; @@ -193,7 +193,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_TYPE: { - auto TypeSec = make_unique(); + auto TypeSec = std::make_unique(); uint32_t Index = 0; for (const auto &FunctionSig : Obj.types()) { WasmYAML::Signature Sig; @@ -211,7 +211,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_IMPORT: { - auto ImportSec = make_unique(); + auto ImportSec = std::make_unique(); for (auto &Import : Obj.imports()) { WasmYAML::Import Im; Im.Module = Import.Module; @@ -242,7 +242,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_FUNCTION: { - auto FuncSec = make_unique(); + auto FuncSec = std::make_unique(); for (const auto &Func : Obj.functionTypes()) { FuncSec->FunctionTypes.push_back(Func); } @@ -250,7 +250,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_TABLE: { - auto TableSec = make_unique(); + auto TableSec = std::make_unique(); for (const wasm::WasmTable &Table : Obj.tables()) { TableSec->Tables.push_back(makeTable(Table)); } @@ -258,7 +258,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_MEMORY: { - auto MemorySec = make_unique(); + auto MemorySec = std::make_unique(); for (const wasm::WasmLimits &Memory : Obj.memories()) { MemorySec->Memories.push_back(makeLimits(Memory)); } @@ -266,7 +266,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_GLOBAL: { - auto GlobalSec = make_unique(); + auto GlobalSec = std::make_unique(); for (auto &Global : Obj.globals()) { WasmYAML::Global G; G.Index = Global.Index; @@ -279,7 +279,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_EVENT: { - auto EventSec = make_unique(); + auto EventSec = std::make_unique(); for (auto &Event : Obj.events()) { WasmYAML::Event E; E.Index = Event.Index; @@ -291,13 +291,13 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_START: { - auto StartSec = make_unique(); + auto StartSec = std::make_unique(); StartSec->StartFunction = Obj.startFunction(); S = std::move(StartSec); break; } case wasm::WASM_SEC_EXPORT: { - auto ExportSec = make_unique(); + auto ExportSec = std::make_unique(); for (auto &Export : Obj.exports()) { WasmYAML::Export Ex; Ex.Name = Export.Name; @@ -309,7 +309,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_ELEM: { - auto ElemSec = make_unique(); + auto ElemSec = std::make_unique(); for (auto &Segment : Obj.elements()) { WasmYAML::ElemSegment Seg; Seg.TableIndex = Segment.TableIndex; @@ -323,7 +323,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_CODE: { - auto CodeSec = make_unique(); + auto CodeSec = std::make_unique(); for (auto &Func : Obj.functions()) { WasmYAML::Function Function; Function.Index = Func.Index; @@ -340,7 +340,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_DATA: { - auto DataSec = make_unique(); + auto DataSec = std::make_unique(); for (const object::WasmSegment &Segment : Obj.dataSegments()) { WasmYAML::DataSegment Seg; Seg.SectionOffset = Segment.SectionOffset; @@ -354,7 +354,7 @@ ErrorOr WasmDumper::dump() { break; } case wasm::WASM_SEC_DATACOUNT: { - auto DataCountSec = make_unique(); + auto DataCountSec = std::make_unique(); DataCountSec->Count = Obj.dataSegments().size(); S = std::move(DataCountSec); break; diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index a30547b89f8..4143d340b41 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -720,7 +720,7 @@ int main(int argc, char **argv) { OutputFilename = "-"; std::error_code EC; - Out = llvm::make_unique(OutputFilename, EC, + Out = std::make_unique(OutputFilename, EC, sys::fs::OF_None); if (EC) { errs() << EC.message() << '\n'; @@ -867,7 +867,7 @@ int main(int argc, char **argv) { assert(Out); OS = &Out->os(); if (RunTwice) { - BOS = make_unique(Buffer); + BOS = std::make_unique(Buffer); OS = BOS.get(); } if (OutputAssembly) { diff --git a/tools/sancov/sancov.cpp b/tools/sancov/sancov.cpp index acf47b99b9c..9f5de69ee55 100644 --- a/tools/sancov/sancov.cpp +++ b/tools/sancov/sancov.cpp @@ -243,7 +243,7 @@ RawCoverage::read(const std::string &FileName) { return make_error_code(errc::illegal_byte_sequence); } - auto Addrs = llvm::make_unique>(); + auto Addrs = std::make_unique>(); switch (Header->Bitness) { case Bitness64: @@ -458,7 +458,7 @@ static std::string parseScalarString(yaml::Node *N) { std::unique_ptr SymbolizedCoverage::read(const std::string &InputFile) { - auto Coverage(make_unique()); + auto Coverage(std::make_unique()); std::map Points; ErrorOr> BufOrErr = @@ -958,7 +958,7 @@ static bool isSymbolizedCoverageFile(const std::string &FileName) { static std::unique_ptr symbolize(const RawCoverage &Data, const std::string ObjectFile) { - auto Coverage = make_unique(); + auto Coverage = std::make_unique(); ErrorOr> BufOrErr = MemoryBuffer::getFile(ObjectFile); @@ -1112,7 +1112,7 @@ merge(const std::vector> &Coverages) { if (Coverages.empty()) return nullptr; - auto Result = make_unique(); + auto Result = std::make_unique(); for (size_t I = 0; I < Coverages.size(); ++I) { const SymbolizedCoverage &Coverage = *Coverages[I]; diff --git a/unittests/ADT/FunctionRefTest.cpp b/unittests/ADT/FunctionRefTest.cpp index a599bee7e15..5064a2975a9 100644 --- a/unittests/ADT/FunctionRefTest.cpp +++ b/unittests/ADT/FunctionRefTest.cpp @@ -1,4 +1,4 @@ -//===- llvm/unittest/ADT/MakeUniqueTest.cpp - make_unique unit tests ------===// +//===- llvm/unittest/ADT/MakeUniqueTest.cpp - std::make_unique unit tests ------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/unittests/ADT/IteratorTest.cpp b/unittests/ADT/IteratorTest.cpp index f46f109d572..2f5abb64e7d 100644 --- a/unittests/ADT/IteratorTest.cpp +++ b/unittests/ADT/IteratorTest.cpp @@ -107,10 +107,10 @@ TEST(PointeeIteratorTest, Basic) { TEST(PointeeIteratorTest, SmartPointer) { SmallVector, 4> V; - V.push_back(make_unique(1)); - V.push_back(make_unique(2)); - V.push_back(make_unique(3)); - V.push_back(make_unique(4)); + V.push_back(std::make_unique(1)); + V.push_back(std::make_unique(2)); + V.push_back(std::make_unique(3)); + V.push_back(std::make_unique(4)); typedef pointee_iterator< SmallVectorImpl>::const_iterator> @@ -209,10 +209,10 @@ TEST(FilterIteratorTest, FunctionPointer) { TEST(FilterIteratorTest, Composition) { auto IsOdd = [](int N) { return N % 2 == 1; }; - std::unique_ptr A[] = {make_unique(0), make_unique(1), - make_unique(2), make_unique(3), - make_unique(4), make_unique(5), - make_unique(6)}; + std::unique_ptr A[] = {make_unique(0), std::make_unique(1), + std::make_unique(2), std::make_unique(3), + std::make_unique(4), std::make_unique(5), + std::make_unique(6)}; using PointeeIterator = pointee_iterator *>; auto Range = make_filter_range( make_range(PointeeIterator(std::begin(A)), PointeeIterator(std::end(A))), diff --git a/unittests/ADT/MakeUniqueTest.cpp b/unittests/ADT/MakeUniqueTest.cpp index c0c10969947..d643d09df7a 100644 --- a/unittests/ADT/MakeUniqueTest.cpp +++ b/unittests/ADT/MakeUniqueTest.cpp @@ -1,4 +1,4 @@ -//===- llvm/unittest/ADT/MakeUniqueTest.cpp - make_unique unit tests ------===// +//===- llvm/unittest/ADT/MakeUniqueTest.cpp - std::make_unique unit tests ------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -14,60 +14,60 @@ using namespace llvm; namespace { TEST(MakeUniqueTest, SingleObject) { - auto p0 = make_unique(); + auto p0 = std::make_unique(); EXPECT_TRUE((bool)p0); EXPECT_EQ(0, *p0); - auto p1 = make_unique(5); + auto p1 = std::make_unique(5); EXPECT_TRUE((bool)p1); EXPECT_EQ(5, *p1); - auto p2 = make_unique>(0, 1); + auto p2 = std::make_unique>(0, 1); EXPECT_TRUE((bool)p2); EXPECT_EQ(std::make_tuple(0, 1), *p2); - auto p3 = make_unique>(0, 1, 2); + auto p3 = std::make_unique>(0, 1, 2); EXPECT_TRUE((bool)p3); EXPECT_EQ(std::make_tuple(0, 1, 2), *p3); - auto p4 = make_unique>(0, 1, 2, 3); + auto p4 = std::make_unique>(0, 1, 2, 3); EXPECT_TRUE((bool)p4); EXPECT_EQ(std::make_tuple(0, 1, 2, 3), *p4); - auto p5 = make_unique>(0, 1, 2, 3, 4); + auto p5 = std::make_unique>(0, 1, 2, 3, 4); EXPECT_TRUE((bool)p5); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4), *p5); auto p6 = - make_unique>(0, 1, 2, 3, 4, 5); + std::make_unique>(0, 1, 2, 3, 4, 5); EXPECT_TRUE((bool)p6); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5), *p6); - auto p7 = make_unique>( + auto p7 = std::make_unique>( 0, 1, 2, 3, 4, 5, 6); EXPECT_TRUE((bool)p7); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6), *p7); - auto p8 = make_unique>( + auto p8 = std::make_unique>( 0, 1, 2, 3, 4, 5, 6, 7); EXPECT_TRUE((bool)p8); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7), *p8); auto p9 = - make_unique>( + std::make_unique>( 0, 1, 2, 3, 4, 5, 6, 7, 8); EXPECT_TRUE((bool)p9); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7, 8), *p9); auto p10 = - make_unique>( + std::make_unique>( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); EXPECT_TRUE((bool)p10); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), *p10); } TEST(MakeUniqueTest, Array) { - auto p1 = make_unique(2); + auto p1 = std::make_unique(2); EXPECT_TRUE((bool)p1); EXPECT_EQ(0, p1[0]); EXPECT_EQ(0, p1[1]); diff --git a/unittests/ADT/MapVectorTest.cpp b/unittests/ADT/MapVectorTest.cpp index b8fdbdd0e0b..f7e5812f2e9 100644 --- a/unittests/ADT/MapVectorTest.cpp +++ b/unittests/ADT/MapVectorTest.cpp @@ -149,8 +149,8 @@ TEST(MapVectorTest, iteration_test) { TEST(MapVectorTest, NonCopyable) { MapVector> MV; - MV.insert(std::make_pair(1, llvm::make_unique(1))); - MV.insert(std::make_pair(2, llvm::make_unique(2))); + MV.insert(std::make_pair(1, std::make_unique(1))); + MV.insert(std::make_pair(2, std::make_unique(2))); ASSERT_EQ(MV.count(1), 1u); ASSERT_EQ(*MV.find(2)->second, 2); @@ -306,8 +306,8 @@ TEST(SmallMapVectorSmallTest, iteration_test) { TEST(SmallMapVectorSmallTest, NonCopyable) { SmallMapVector, 8> MV; - MV.insert(std::make_pair(1, llvm::make_unique(1))); - MV.insert(std::make_pair(2, llvm::make_unique(2))); + MV.insert(std::make_pair(1, std::make_unique(1))); + MV.insert(std::make_pair(2, std::make_unique(2))); ASSERT_EQ(MV.count(1), 1u); ASSERT_EQ(*MV.find(2)->second, 2); diff --git a/unittests/ADT/STLExtrasTest.cpp b/unittests/ADT/STLExtrasTest.cpp index 8704ddda265..4cbef904ca8 100644 --- a/unittests/ADT/STLExtrasTest.cpp +++ b/unittests/ADT/STLExtrasTest.cpp @@ -451,7 +451,7 @@ TEST(STLExtrasTest, to_address) { EXPECT_EQ(V1, to_address(V1)); // Check fancy pointer overload for unique_ptr - std::unique_ptr V2 = make_unique(0); + std::unique_ptr V2 = std::make_unique(0); EXPECT_EQ(V2.get(), to_address(V2)); V2.reset(V1); diff --git a/unittests/Analysis/MemorySSATest.cpp b/unittests/Analysis/MemorySSATest.cpp index bfdf37ee190..b470f162612 100644 --- a/unittests/Analysis/MemorySSATest.cpp +++ b/unittests/Analysis/MemorySSATest.cpp @@ -51,7 +51,7 @@ protected: : DT(*Test.F), AC(*Test.F), AA(Test.TLI), BAA(Test.DL, *Test.F, Test.TLI, AC, &DT) { AA.addAAResult(BAA); - MSSA = make_unique(*Test.F, &AA, &DT); + MSSA = std::make_unique(*Test.F, &AA, &DT); Walker = MSSA->getWalker(); } }; @@ -1431,7 +1431,7 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithPhiNotOpt) { MemorySSA &MSSA = *Analyses->MSSA; MemorySSAWalker *Walker = Analyses->Walker; std::unique_ptr MSSAU = - make_unique(&MSSA); + std::make_unique(&MSSA); MemoryPhi *Phi = MSSA.getMemoryAccess(Exit); EXPECT_EQ(Phi, Walker->getClobberingMemoryAccess(S1)); @@ -1493,7 +1493,7 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithPhiOpt) { MemorySSA &MSSA = *Analyses->MSSA; MemorySSAWalker *Walker = Analyses->Walker; std::unique_ptr MSSAU = - make_unique(&MSSA); + std::make_unique(&MSSA); MemoryDef *DefS1 = cast(MSSA.getMemoryAccess(S1)); EXPECT_EQ(DefS1, Walker->getClobberingMemoryAccess(S2)); @@ -1565,7 +1565,7 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithNoPhiAddNewPhis) { setupAnalyses(); MemorySSA &MSSA = *Analyses->MSSA; std::unique_ptr MSSAU = - make_unique(&MSSA); + std::make_unique(&MSSA); // Alter CFG, add edge: f -> c FBlock->getTerminator()->eraseFromParent(); diff --git a/unittests/CodeGen/AArch64SelectionDAGTest.cpp b/unittests/CodeGen/AArch64SelectionDAGTest.cpp index 3ac32aebeac..f98173a35a1 100644 --- a/unittests/CodeGen/AArch64SelectionDAGTest.cpp +++ b/unittests/CodeGen/AArch64SelectionDAGTest.cpp @@ -59,10 +59,10 @@ protected: MachineModuleInfo MMI(TM.get()); - MF = make_unique(*F, *TM, *TM->getSubtargetImpl(*F), 0, + MF = std::make_unique(*F, *TM, *TM->getSubtargetImpl(*F), 0, MMI); - DAG = make_unique(*TM, CodeGenOpt::None); + DAG = std::make_unique(*TM, CodeGenOpt::None); if (!DAG) report_fatal_error("DAG?"); OptimizationRemarkEmitter ORE(F); diff --git a/unittests/CodeGen/GlobalISel/CSETest.cpp b/unittests/CodeGen/GlobalISel/CSETest.cpp index 11983f72cb0..dea0fc7ed02 100644 --- a/unittests/CodeGen/GlobalISel/CSETest.cpp +++ b/unittests/CodeGen/GlobalISel/CSETest.cpp @@ -22,7 +22,7 @@ TEST_F(GISelMITest, TestCSE) { auto MIBInput1 = B.buildInstr(TargetOpcode::G_TRUNC, {s16}, {Copies[1]}); auto MIBAdd = B.buildInstr(TargetOpcode::G_ADD, {s16}, {MIBInput, MIBInput}); GISelCSEInfo CSEInfo; - CSEInfo.setCSEConfig(make_unique()); + CSEInfo.setCSEConfig(std::make_unique()); CSEInfo.analyze(*MF); B.setCSEInfo(&CSEInfo); CSEMIRBuilder CSEB(B.getState()); @@ -84,7 +84,7 @@ TEST_F(GISelMITest, TestCSEConstantConfig) { auto MIBAdd = B.buildInstr(TargetOpcode::G_ADD, {s16}, {MIBInput, MIBInput}); auto MIBZero = B.buildConstant(s16, 0); GISelCSEInfo CSEInfo; - CSEInfo.setCSEConfig(make_unique()); + CSEInfo.setCSEConfig(std::make_unique()); CSEInfo.analyze(*MF); B.setCSEInfo(&CSEInfo); CSEMIRBuilder CSEB(B.getState()); diff --git a/unittests/CodeGen/GlobalISel/GISelMITest.h b/unittests/CodeGen/GlobalISel/GISelMITest.h index 37188760c1d..0af63b70eec 100644 --- a/unittests/CodeGen/GlobalISel/GISelMITest.h +++ b/unittests/CodeGen/GlobalISel/GISelMITest.h @@ -111,7 +111,7 @@ body: | )MIR") + Twine(MIRFunc) + Twine("...\n")) .toNullTerminatedStringRef(S); std::unique_ptr MIR; - auto MMI = make_unique(&TM); + auto MMI = std::make_unique(&TM); std::unique_ptr M = parseMIR(Context, MIR, TM, MIRString, "func", *MMI); return make_pair(std::move(M), std::move(MMI)); diff --git a/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp b/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp index de6445175e4..5e7b750f194 100644 --- a/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp +++ b/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp @@ -98,7 +98,7 @@ body: | )MIR") + Twine(MIRFunc) + Twine("...\n")) .toNullTerminatedStringRef(S); std::unique_ptr MIR; - auto MMI = make_unique(&TM); + auto MMI = std::make_unique(&TM); std::unique_ptr M = parseMIR(Context, MIR, TM, MIRString, "func", *MMI); return make_pair(std::move(M), std::move(MMI)); diff --git a/unittests/CodeGen/MachineInstrTest.cpp b/unittests/CodeGen/MachineInstrTest.cpp index 67d0c5954cc..b94763a06b5 100644 --- a/unittests/CodeGen/MachineInstrTest.cpp +++ b/unittests/CodeGen/MachineInstrTest.cpp @@ -136,7 +136,7 @@ private: }; std::unique_ptr createTargetMachine() { - return llvm::make_unique(); + return std::make_unique(); } std::unique_ptr createMachineFunction() { @@ -150,7 +150,7 @@ std::unique_ptr createMachineFunction() { MachineModuleInfo MMI(TM.get()); const TargetSubtargetInfo &STI = *TM->getSubtargetImpl(*F); - return llvm::make_unique(*F, *TM, STI, FunctionNum, MMI); + return std::make_unique(*F, *TM, STI, FunctionNum, MMI); } // This test makes sure that MachineInstr::isIdenticalTo handles Defs correctly diff --git a/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp b/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp index ff01ef7e739..7a4000d9613 100644 --- a/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp +++ b/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp @@ -88,7 +88,7 @@ public: RandomAccessVisitorTest() {} static void SetUpTestCase() { - GlobalState = llvm::make_unique(); + GlobalState = std::make_unique(); AppendingTypeTableBuilder Builder(GlobalState->Allocator); @@ -120,7 +120,7 @@ public: static void TearDownTestCase() { GlobalState.reset(); } void SetUp() override { - TestState = llvm::make_unique(); + TestState = std::make_unique(); } void TearDown() override { TestState.reset(); } diff --git a/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp b/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp index d011db9fcd4..e00240d7427 100644 --- a/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp +++ b/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp @@ -25,8 +25,8 @@ public: void SetUp() override { Refs.clear(); - TTB = make_unique(Storage); - CRB = make_unique(); + TTB = std::make_unique(Storage); + CRB = std::make_unique(); Symbols.clear(); } diff --git a/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/unittests/DebugInfo/DWARF/DwarfGenerator.cpp index d2c0f3c3b20..2e062e8fe96 100644 --- a/unittests/DebugInfo/DWARF/DwarfGenerator.cpp +++ b/unittests/DebugInfo/DWARF/DwarfGenerator.cpp @@ -446,7 +446,7 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) { return make_error("no code emitter for target " + TripleName, inconvertibleErrorCode()); - Stream = make_unique(FileBytes); + Stream = std::make_unique(FileBytes); MS = TheTarget->createMCObjectStreamer( TheTriple, *MC, std::unique_ptr(MAB), @@ -469,7 +469,7 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) { MC->setDwarfVersion(Version); Asm->setDwarfVersion(Version); - StringPool = llvm::make_unique(Allocator, *Asm, StringRef()); + StringPool = std::make_unique(Allocator, *Asm, StringRef()); StringOffsetsStartSym = Asm->createTempSymbol("str_offsets_base"); return Error::success(); @@ -541,12 +541,12 @@ bool dwarfgen::Generator::saveFile(StringRef Path) { dwarfgen::CompileUnit &dwarfgen::Generator::addCompileUnit() { CompileUnits.push_back( - make_unique(*this, Version, Asm->getPointerSize())); + std::make_unique(*this, Version, Asm->getPointerSize())); return *CompileUnits.back(); } dwarfgen::LineTable &dwarfgen::Generator::addLineTable(DwarfFormat Format) { LineTables.push_back( - make_unique(Version, Format, Asm->getPointerSize())); + std::make_unique(Version, Format, Asm->getPointerSize())); return *LineTables.back(); } diff --git a/unittests/DebugInfo/PDB/PDBApiTest.cpp b/unittests/DebugInfo/PDB/PDBApiTest.cpp index 766f54d5206..f48e8379046 100644 --- a/unittests/DebugInfo/PDB/PDBApiTest.cpp +++ b/unittests/DebugInfo/PDB/PDBApiTest.cpp @@ -464,7 +464,7 @@ private: std::unique_ptr Session; void InsertItemWithTag(PDB_SymType Tag) { - auto RawSymbol = llvm::make_unique(Tag); + auto RawSymbol = std::make_unique(Tag); auto Symbol = PDBSymbol::create(*Session, std::move(RawSymbol)); SymbolMap.insert(std::make_pair(Tag, std::move(Symbol))); } diff --git a/unittests/ExecutionEngine/ExecutionEngineTest.cpp b/unittests/ExecutionEngine/ExecutionEngineTest.cpp index 77b1085a852..b92b3f6e984 100644 --- a/unittests/ExecutionEngine/ExecutionEngineTest.cpp +++ b/unittests/ExecutionEngine/ExecutionEngineTest.cpp @@ -27,7 +27,7 @@ private: protected: ExecutionEngineTest() { - auto Owner = make_unique("
", Context); + auto Owner = std::make_unique("
", Context); M = Owner.get(); Engine.reset(EngineBuilder(std::move(Owner)).setErrorStr(&Error).create()); } diff --git a/unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp b/unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp index b0c6d5b4481..23f8a691c8f 100644 --- a/unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp +++ b/unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp @@ -71,7 +71,7 @@ Error JITLinkTestCommon::TestResources::initializeTripleSpecifics(Triple &TT) { if (!STI) report_fatal_error("Could not build MCSubtargetInfo for triple"); - DisCtx = llvm::make_unique(MAI.get(), MRI.get(), nullptr); + DisCtx = std::make_unique(MAI.get(), MRI.get(), nullptr); Dis.reset(TheTarget->createMCDisassembler(*STI, *DisCtx)); if (!Dis) @@ -83,7 +83,7 @@ Error JITLinkTestCommon::TestResources::initializeTripleSpecifics(Triple &TT) { void JITLinkTestCommon::TestResources::initializeTestSpecifics( StringRef AsmSrc, const Triple &TT, bool PIC, bool LargeCodeModel) { SrcMgr.AddNewSourceBuffer(MemoryBuffer::getMemBuffer(AsmSrc), SMLoc()); - AsCtx = llvm::make_unique(MAI.get(), MRI.get(), &MOFI, &SrcMgr); + AsCtx = std::make_unique(MAI.get(), MRI.get(), &MOFI, &SrcMgr); MOFI.InitMCObjectFileInfo(TT, PIC, *AsCtx, LargeCodeModel); std::unique_ptr CE( @@ -131,7 +131,7 @@ JITLinkTestCommon::TestJITLinkContext::setMemoryManager( JITLinkMemoryManager & JITLinkTestCommon::TestJITLinkContext::getMemoryManager() { if (!MemMgr) - MemMgr = llvm::make_unique(); + MemMgr = std::make_unique(); return *MemMgr; } diff --git a/unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp b/unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp index 98c5d44d466..e051ad551c7 100644 --- a/unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp +++ b/unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp @@ -39,7 +39,7 @@ public: return; } - auto JTCtx = llvm::make_unique( + auto JTCtx = std::make_unique( **TR, [&](AtomGraph &G) { RunGraphTest(G, (*TR)->getDisassembler()); }); JTCtx->externals() = std::move(Externals); diff --git a/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp b/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp index 375318c323f..d52ff4ba651 100644 --- a/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp +++ b/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp @@ -37,7 +37,7 @@ TEST_F(CoreAPIsStandardTest, BasicSuccessfulLookup) { std::shared_ptr FooMR; - cantFail(JD.define(llvm::make_unique( + cantFail(JD.define(std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { FooMR = std::make_shared(std::move(R)); @@ -105,7 +105,7 @@ TEST_F(CoreAPIsStandardTest, RemoveSymbolsTest) { // Bar will be unmaterialized. bool BarDiscarded = false; bool BarMaterializerDestructed = false; - cantFail(JD.define(llvm::make_unique( + cantFail(JD.define(std::make_unique( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [this](MaterializationResponsibility R) { ADD_FAILURE() << "Unexpected materialization of \"Bar\""; @@ -122,7 +122,7 @@ TEST_F(CoreAPIsStandardTest, RemoveSymbolsTest) { // Baz will be in the materializing state initially, then // materialized for the final removal attempt. Optional BazR; - cantFail(JD.define(llvm::make_unique( + cantFail(JD.define(std::make_unique( SymbolFlagsMap({{Baz, BazSym.getFlags()}}), [&](MaterializationResponsibility R) { BazR.emplace(std::move(R)); }, [](const JITDylib &JD, const SymbolStringPtr &Name) { @@ -217,7 +217,7 @@ TEST_F(CoreAPIsStandardTest, LookupFlagsTest) { BarSym.setFlags(static_cast( JITSymbolFlags::Exported | JITSymbolFlags::Weak)); - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [](MaterializationResponsibility R) { llvm_unreachable("Symbol materialized on flags lookup"); @@ -251,7 +251,7 @@ TEST_F(CoreAPIsStandardTest, LookupWithGeneratorFailure) { } }; - JD.addGenerator(llvm::make_unique()); + JD.addGenerator(std::make_unique()); EXPECT_THAT_ERROR(JD.lookupFlags({Foo}).takeError(), Failed()) << "Generator failure did not propagate through lookupFlags"; @@ -314,7 +314,7 @@ TEST_F(CoreAPIsStandardTest, TestThatReExportsDontUnnecessarilyMaterialize) { cantFail(JD.define(absoluteSymbols({{Foo, FooSym}}))); bool BarMaterialized = false; - auto BarMU = llvm::make_unique( + auto BarMU = std::make_unique( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { BarMaterialized = true; @@ -344,7 +344,7 @@ TEST_F(CoreAPIsStandardTest, TestReexportsGenerator) { auto Filter = [this](SymbolStringPtr Name) { return Name != Bar; }; - JD.addGenerator(llvm::make_unique(JD2, false, Filter)); + JD.addGenerator(std::make_unique(JD2, false, Filter)); auto Flags = cantFail(JD.lookupFlags({Foo, Bar, Baz})); EXPECT_EQ(Flags.size(), 1U) << "Unexpected number of results"; @@ -358,7 +358,7 @@ TEST_F(CoreAPIsStandardTest, TestReexportsGenerator) { TEST_F(CoreAPIsStandardTest, TestTrivialCircularDependency) { Optional FooR; - auto FooMU = llvm::make_unique( + auto FooMU = std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { FooR.emplace(std::move(R)); }); @@ -394,15 +394,15 @@ TEST_F(CoreAPIsStandardTest, TestCircularDependenceInOneJITDylib) { // Create a MaterializationUnit for each symbol that moves the // MaterializationResponsibility into one of the locals above. - auto FooMU = llvm::make_unique( + auto FooMU = std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { FooR.emplace(std::move(R)); }); - auto BarMU = llvm::make_unique( + auto BarMU = std::make_unique( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { BarR.emplace(std::move(R)); }); - auto BazMU = llvm::make_unique( + auto BazMU = std::make_unique( SymbolFlagsMap({{Baz, BazSym.getFlags()}}), [&](MaterializationResponsibility R) { BazR.emplace(std::move(R)); }); @@ -524,7 +524,7 @@ TEST_F(CoreAPIsStandardTest, DropMaterializerWhenEmpty) { JITSymbolFlags WeakExported(JITSymbolFlags::Exported); WeakExported |= JITSymbolFlags::Weak; - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, WeakExported}, {Bar, WeakExported}}), [](MaterializationResponsibility R) { llvm_unreachable("Unexpected call to materialize"); @@ -555,7 +555,7 @@ TEST_F(CoreAPIsStandardTest, AddAndMaterializeLazySymbol) { JITSymbolFlags WeakExported(JITSymbolFlags::Exported); WeakExported |= JITSymbolFlags::Weak; - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}, {Bar, WeakExported}}), [&](MaterializationResponsibility R) { assert(BarDiscarded && "Bar should have been discarded by this point"); @@ -597,7 +597,7 @@ TEST_F(CoreAPIsStandardTest, TestBasicWeakSymbolMaterialization) { BarSym.setFlags(BarSym.getFlags() | JITSymbolFlags::Weak); bool BarMaterialized = false; - auto MU1 = llvm::make_unique( + auto MU1 = std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}})), R.notifyEmitted(); @@ -605,7 +605,7 @@ TEST_F(CoreAPIsStandardTest, TestBasicWeakSymbolMaterialization) { }); bool DuplicateBarDiscarded = false; - auto MU2 = llvm::make_unique( + auto MU2 = std::make_unique( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { ADD_FAILURE() << "Attempt to materialize Bar from the wrong unit"; @@ -644,7 +644,7 @@ TEST_F(CoreAPIsStandardTest, DefineMaterializingSymbol) { MU->doMaterialize(JD); }); - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { cantFail( @@ -690,7 +690,7 @@ TEST_F(CoreAPIsStandardTest, GeneratorTest) { SymbolMap Symbols; }; - JD.addGenerator(llvm::make_unique(SymbolMap({{Bar, BarSym}}))); + JD.addGenerator(std::make_unique(SymbolMap({{Bar, BarSym}}))); auto Result = cantFail(ES.lookup(JITDylibSearchList({{&JD, false}}), {Foo, Bar})); @@ -701,7 +701,7 @@ TEST_F(CoreAPIsStandardTest, GeneratorTest) { } TEST_F(CoreAPIsStandardTest, FailResolution) { - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, JITSymbolFlags::Exported | JITSymbolFlags::Weak}, {Bar, JITSymbolFlags::Exported | JITSymbolFlags::Weak}}), [&](MaterializationResponsibility R) { @@ -737,7 +737,7 @@ TEST_F(CoreAPIsStandardTest, FailEmissionEarly) { cantFail(JD.define(absoluteSymbols({{Baz, BazSym}}))); - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}})); @@ -769,7 +769,7 @@ TEST_F(CoreAPIsStandardTest, FailEmissionEarly) { } TEST_F(CoreAPIsStandardTest, TestLookupWithUnthreadedMaterialization) { - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}}), [&](MaterializationResponsibility R) { R.notifyResolved({{Foo, FooSym}}); @@ -821,14 +821,14 @@ TEST_F(CoreAPIsStandardTest, TestGetRequestedSymbolsAndReplace) { bool FooMaterialized = false; bool BarMaterialized = false; - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { auto Requested = R.getRequestedSymbols(); EXPECT_EQ(Requested.size(), 1U) << "Expected one symbol requested"; EXPECT_EQ(*Requested.begin(), Foo) << "Expected \"Foo\" requested"; - auto NewMU = llvm::make_unique( + auto NewMU = std::make_unique( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R2) { R2.notifyResolved(SymbolMap({{Bar, BarSym}})); @@ -865,7 +865,7 @@ TEST_F(CoreAPIsStandardTest, TestGetRequestedSymbolsAndReplace) { } TEST_F(CoreAPIsStandardTest, TestMaterializationResponsibilityDelegation) { - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { auto R2 = R.delegate({Bar}); @@ -896,11 +896,11 @@ TEST_F(CoreAPIsStandardTest, TestMaterializeWeakSymbol) { WeakExported &= JITSymbolFlags::Weak; std::unique_ptr FooResponsibility; - auto MU = llvm::make_unique( + auto MU = std::make_unique( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { FooResponsibility = - llvm::make_unique(std::move(R)); + std::make_unique(std::move(R)); }); cantFail(JD.define(MU)); @@ -911,7 +911,7 @@ TEST_F(CoreAPIsStandardTest, TestMaterializeWeakSymbol) { ES.lookup(JITDylibSearchList({{&JD, false}}), {Foo}, SymbolState::Ready, std::move(OnCompletion), NoDependenciesToRegister); - auto MU2 = llvm::make_unique( + auto MU2 = std::make_unique( SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}}), [](MaterializationResponsibility R) { llvm_unreachable("This unit should never be materialized"); diff --git a/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp b/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp index 87d582b3c27..d4757e0f86e 100644 --- a/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp +++ b/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp @@ -37,7 +37,7 @@ TEST_F(LazyReexportsTest, BasicLocalCallThroughManagerOperation) { bool DummyTargetMaterialized = false; - cantFail(JD.define(llvm::make_unique( + cantFail(JD.define(std::make_unique( SymbolFlagsMap({{DummyTarget, JITSymbolFlags::Exported}}), [&](MaterializationResponsibility R) { DummyTargetMaterialized = true; diff --git a/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp b/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp index 06b96f9fd38..59cd11c5e5a 100644 --- a/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp +++ b/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp @@ -25,7 +25,7 @@ public: class DummyCallbackManager : public JITCompileCallbackManager { public: DummyCallbackManager(ExecutionSession &ES) - : JITCompileCallbackManager(llvm::make_unique(), ES, + : JITCompileCallbackManager(std::make_unique(), ES, 0) {} }; @@ -78,7 +78,7 @@ TEST(LegacyCompileOnDemandLayerTest, FindSymbol) { llvm::orc::LegacyCompileOnDemandLayer COD( AcknowledgeORCv1Deprecation, ES, TestBaseLayer, GetResolver, SetResolver, [](Function &F) { return std::set{&F}; }, CallbackMgr, - [] { return llvm::make_unique(); }, true); + [] { return std::make_unique(); }, true); auto Sym = COD.findSymbol("foo", true); diff --git a/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp b/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp index 001019daa4b..3f0f85b69a7 100644 --- a/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp +++ b/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp @@ -75,7 +75,7 @@ TEST(LegacyRTDyldObjectLinkingLayerTest, TestSetProcessAllSections) { }); LLVMContext Context; - auto M = llvm::make_unique("", Context); + auto M = std::make_unique("", Context); M->setTargetTriple("x86_64-unknown-linux-gnu"); Type *Int32Ty = IntegerType::get(Context, 32); GlobalVariable *GV = diff --git a/unittests/ExecutionEngine/Orc/QueueChannel.h b/unittests/ExecutionEngine/Orc/QueueChannel.h index 56a3926ee65..511f038dec1 100644 --- a/unittests/ExecutionEngine/Orc/QueueChannel.h +++ b/unittests/ExecutionEngine/Orc/QueueChannel.h @@ -135,8 +135,8 @@ inline std::pair, std::unique_ptr> createPairedQueueChannels() { auto Q1 = std::make_shared(); auto Q2 = std::make_shared(); - auto C1 = llvm::make_unique(Q1, Q2); - auto C2 = llvm::make_unique(Q2, Q1); + auto C1 = std::make_unique(Q1, Q2); + auto C2 = std::make_unique(Q2, Q1); return std::make_pair(std::move(C1), std::move(C2)); } diff --git a/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp b/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp index 440b840faaa..ecb8cf65393 100644 --- a/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp +++ b/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp @@ -54,7 +54,7 @@ static bool testSetProcessAllSections(std::unique_ptr Obj, auto Foo = ES.intern("foo"); RTDyldObjectLinkingLayer ObjLayer(ES, [&DebugSectionSeen]() { - return llvm::make_unique(DebugSectionSeen); + return std::make_unique(DebugSectionSeen); }); auto OnResolveDoNothing = [](Expected R) { @@ -71,7 +71,7 @@ static bool testSetProcessAllSections(std::unique_ptr Obj, TEST(RTDyldObjectLinkingLayerTest, TestSetProcessAllSections) { LLVMContext Context; - auto M = llvm::make_unique("", Context); + auto M = std::make_unique("", Context); M->setTargetTriple("x86_64-unknown-linux-gnu"); Type *Int32Ty = IntegerType::get(Context, 32); GlobalVariable *GV = @@ -123,7 +123,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestOverrideObjectFlags) { }; // Create a module with two void() functions: foo and bar. - ThreadSafeContext TSCtx(llvm::make_unique()); + ThreadSafeContext TSCtx(std::make_unique()); ThreadSafeModule M; { ModuleBuilder MB(*TSCtx.getContext(), TM->getTargetTriple().str(), "dummy"); @@ -153,7 +153,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestOverrideObjectFlags) { auto &JD = ES.createJITDylib("main"); auto Foo = ES.intern("foo"); RTDyldObjectLinkingLayer ObjLayer( - ES, []() { return llvm::make_unique(); }); + ES, []() { return std::make_unique(); }); IRCompileLayer CompileLayer(ES, ObjLayer, FunkySimpleCompiler(*TM)); ObjLayer.setOverrideObjectFlagsWithResponsibilityFlags(true); @@ -196,7 +196,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestAutoClaimResponsibilityForSymbols) { }; // Create a module with two void() functions: foo and bar. - ThreadSafeContext TSCtx(llvm::make_unique()); + ThreadSafeContext TSCtx(std::make_unique()); ThreadSafeModule M; { ModuleBuilder MB(*TSCtx.getContext(), TM->getTargetTriple().str(), "dummy"); @@ -218,7 +218,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestAutoClaimResponsibilityForSymbols) { auto &JD = ES.createJITDylib("main"); auto Foo = ES.intern("foo"); RTDyldObjectLinkingLayer ObjLayer( - ES, []() { return llvm::make_unique(); }); + ES, []() { return std::make_unique(); }); IRCompileLayer CompileLayer(ES, ObjLayer, FunkySimpleCompiler(*TM)); ObjLayer.setAutoClaimResponsibilityForObjectSymbols(true); diff --git a/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp b/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp index b50c5f99707..1ffb06db659 100644 --- a/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp +++ b/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp @@ -21,36 +21,36 @@ namespace { TEST(ThreadSafeModuleTest, ContextWhollyOwnedByOneModule) { // Test that ownership of a context can be transferred to a single // ThreadSafeModule. - ThreadSafeContext TSCtx(llvm::make_unique()); - auto M = llvm::make_unique("M", *TSCtx.getContext()); + ThreadSafeContext TSCtx(std::make_unique()); + auto M = std::make_unique("M", *TSCtx.getContext()); ThreadSafeModule TSM(std::move(M), std::move(TSCtx)); } TEST(ThreadSafeModuleTest, ContextOwnershipSharedByTwoModules) { // Test that ownership of a context can be shared between more than one // ThreadSafeModule. - ThreadSafeContext TSCtx(llvm::make_unique()); + ThreadSafeContext TSCtx(std::make_unique()); - auto M1 = llvm::make_unique("M1", *TSCtx.getContext()); + auto M1 = std::make_unique("M1", *TSCtx.getContext()); ThreadSafeModule TSM1(std::move(M1), TSCtx); - auto M2 = llvm::make_unique("M2", *TSCtx.getContext()); + auto M2 = std::make_unique("M2", *TSCtx.getContext()); ThreadSafeModule TSM2(std::move(M2), std::move(TSCtx)); } TEST(ThreadSafeModuleTest, ContextOwnershipSharedWithClient) { // Test that ownership of a context can be shared with a client-held // ThreadSafeContext so that it can be re-used for new modules. - ThreadSafeContext TSCtx(llvm::make_unique()); + ThreadSafeContext TSCtx(std::make_unique()); { // Create and destroy a module. - auto M1 = llvm::make_unique("M1", *TSCtx.getContext()); + auto M1 = std::make_unique("M1", *TSCtx.getContext()); ThreadSafeModule TSM1(std::move(M1), TSCtx); } // Verify that the context is still available for re-use. - auto M2 = llvm::make_unique("M2", *TSCtx.getContext()); + auto M2 = std::make_unique("M2", *TSCtx.getContext()); ThreadSafeModule TSM2(std::move(M2), std::move(TSCtx)); } @@ -58,16 +58,16 @@ TEST(ThreadSafeModuleTest, ThreadSafeModuleMoveAssignment) { // Move assignment needs to move the module before the context (opposite // to the field order) to ensure that overwriting with an empty // ThreadSafeModule does not destroy the context early. - ThreadSafeContext TSCtx(llvm::make_unique()); - auto M = llvm::make_unique("M", *TSCtx.getContext()); + ThreadSafeContext TSCtx(std::make_unique()); + auto M = std::make_unique("M", *TSCtx.getContext()); ThreadSafeModule TSM(std::move(M), std::move(TSCtx)); TSM = ThreadSafeModule(); } TEST(ThreadSafeModuleTest, BasicContextLockAPI) { // Test that basic lock API calls work. - ThreadSafeContext TSCtx(llvm::make_unique()); - auto M = llvm::make_unique("M", *TSCtx.getContext()); + ThreadSafeContext TSCtx(std::make_unique()); + auto M = std::make_unique("M", *TSCtx.getContext()); ThreadSafeModule TSM(std::move(M), TSCtx); { auto L = TSCtx.getLock(); } @@ -84,10 +84,10 @@ TEST(ThreadSafeModuleTest, ContextLockPreservesContext) { // has been destroyed) even though all references to the context have // been thrown away (apart from the lock). - ThreadSafeContext TSCtx(llvm::make_unique()); + ThreadSafeContext TSCtx(std::make_unique()); auto L = TSCtx.getLock(); auto &Ctx = *TSCtx.getContext(); - auto M = llvm::make_unique("M", Ctx); + auto M = std::make_unique("M", Ctx); TSCtx = ThreadSafeContext(); } diff --git a/unittests/FuzzMutate/StrategiesTest.cpp b/unittests/FuzzMutate/StrategiesTest.cpp index 9ef88e22682..e710f467622 100644 --- a/unittests/FuzzMutate/StrategiesTest.cpp +++ b/unittests/FuzzMutate/StrategiesTest.cpp @@ -32,10 +32,10 @@ std::unique_ptr createInjectorMutator() { std::vector> Strategies; Strategies.push_back( - llvm::make_unique( + std::make_unique( InjectorIRStrategy::getDefaultOps())); - return llvm::make_unique(std::move(Types), std::move(Strategies)); + return std::make_unique(std::move(Types), std::move(Strategies)); } std::unique_ptr createDeleterMutator() { @@ -44,9 +44,9 @@ std::unique_ptr createDeleterMutator() { Type::getInt64Ty, Type::getFloatTy, Type::getDoubleTy}; std::vector> Strategies; - Strategies.push_back(llvm::make_unique()); + Strategies.push_back(std::make_unique()); - return llvm::make_unique(std::move(Types), std::move(Strategies)); + return std::make_unique(std::move(Types), std::move(Strategies)); } std::unique_ptr parseAssembly( @@ -79,7 +79,7 @@ TEST(InjectorIRStrategyTest, EmptyModule) { // Test that we can inject into empty module LLVMContext Ctx; - auto M = llvm::make_unique("M", Ctx); + auto M = std::make_unique("M", Ctx); ASSERT_TRUE(M && !verifyModule(*M, &errs())); auto Mutator = createInjectorMutator(); diff --git a/unittests/IR/CFGBuilder.cpp b/unittests/IR/CFGBuilder.cpp index 1ce598799ca..424a83bb635 100644 --- a/unittests/IR/CFGBuilder.cpp +++ b/unittests/IR/CFGBuilder.cpp @@ -20,8 +20,8 @@ using namespace llvm; CFGHolder::CFGHolder(StringRef ModuleName, StringRef FunctionName) - : Context(llvm::make_unique()), - M(llvm::make_unique(ModuleName, *Context)) { + : Context(std::make_unique()), + M(std::make_unique(ModuleName, *Context)) { FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Context), {}, false); F = Function::Create(FTy, Function::ExternalLinkage, FunctionName, M.get()); } diff --git a/unittests/IR/MetadataTest.cpp b/unittests/IR/MetadataTest.cpp index c1bce90d69a..fa0dc61d3df 100644 --- a/unittests/IR/MetadataTest.cpp +++ b/unittests/IR/MetadataTest.cpp @@ -34,7 +34,7 @@ TEST(ContextAndReplaceableUsesTest, FromContext) { TEST(ContextAndReplaceableUsesTest, FromReplaceableUses) { LLVMContext Context; - ContextAndReplaceableUses CRU(make_unique(Context)); + ContextAndReplaceableUses CRU(std::make_unique(Context)); EXPECT_EQ(&Context, &CRU.getContext()); EXPECT_TRUE(CRU.hasReplaceableUses()); EXPECT_TRUE(CRU.getReplaceableUses()); @@ -43,7 +43,7 @@ TEST(ContextAndReplaceableUsesTest, FromReplaceableUses) { TEST(ContextAndReplaceableUsesTest, makeReplaceable) { LLVMContext Context; ContextAndReplaceableUses CRU(Context); - CRU.makeReplaceable(make_unique(Context)); + CRU.makeReplaceable(std::make_unique(Context)); EXPECT_EQ(&Context, &CRU.getContext()); EXPECT_TRUE(CRU.hasReplaceableUses()); EXPECT_TRUE(CRU.getReplaceableUses()); @@ -51,7 +51,7 @@ TEST(ContextAndReplaceableUsesTest, makeReplaceable) { TEST(ContextAndReplaceableUsesTest, takeReplaceableUses) { LLVMContext Context; - auto ReplaceableUses = make_unique(Context); + auto ReplaceableUses = std::make_unique(Context); auto *Ptr = ReplaceableUses.get(); ContextAndReplaceableUses CRU(std::move(ReplaceableUses)); ReplaceableUses = CRU.takeReplaceableUses(); diff --git a/unittests/IR/TimePassesTest.cpp b/unittests/IR/TimePassesTest.cpp index a76652202b8..fb70503209d 100644 --- a/unittests/IR/TimePassesTest.cpp +++ b/unittests/IR/TimePassesTest.cpp @@ -127,7 +127,7 @@ TEST(TimePassesTest, CustomOut) { // Setup time-passes handler and redirect output to the stream. std::unique_ptr TimePasses = - llvm::make_unique(true); + std::make_unique(true); TimePasses->setOutStream(ReportStream); TimePasses->registerCallbacks(PIC); diff --git a/unittests/Linker/LinkModulesTest.cpp b/unittests/Linker/LinkModulesTest.cpp index 832e50c19ee..05523c56cc2 100644 --- a/unittests/Linker/LinkModulesTest.cpp +++ b/unittests/Linker/LinkModulesTest.cpp @@ -277,7 +277,7 @@ TEST_F(LinkModuleTest, MoveDistinctMDs) { EXPECT_EQ(M3, M4->getOperand(0)); // Link into destination module. - auto Dst = llvm::make_unique("Linked", C); + auto Dst = std::make_unique("Linked", C); ASSERT_TRUE(Dst.get()); Ctx.setDiagnosticHandlerCallBack(expectNoDiags); Linker::linkModules(*Dst, std::move(Src)); @@ -346,7 +346,7 @@ TEST_F(LinkModuleTest, RemangleIntrinsics) { ASSERT_TRUE(Bar->getFunction("llvm.memset.p0s_struct.rtx_def.0s.i32")); // Link two modules together. - auto Dst = llvm::make_unique("Linked", C); + auto Dst = std::make_unique("Linked", C); ASSERT_TRUE(Dst.get()); Ctx.setDiagnosticHandlerCallBack(expectNoDiags); bool Failed = Linker::linkModules(*Foo, std::move(Bar)); diff --git a/unittests/MC/DwarfLineTables.cpp b/unittests/MC/DwarfLineTables.cpp index af1250daee5..88e9565e1ca 100644 --- a/unittests/MC/DwarfLineTables.cpp +++ b/unittests/MC/DwarfLineTables.cpp @@ -38,7 +38,7 @@ struct Context { MRI.reset(TheTarget->createMCRegInfo(Triple)); MAI.reset(TheTarget->createMCAsmInfo(*MRI, Triple)); - Ctx = llvm::make_unique(MAI.get(), MRI.get(), nullptr); + Ctx = std::make_unique(MAI.get(), MRI.get(), nullptr); } operator bool() { return Ctx.get(); } diff --git a/unittests/ProfileData/CoverageMappingTest.cpp b/unittests/ProfileData/CoverageMappingTest.cpp index 6b94fa16bfa..82e7574d15c 100644 --- a/unittests/ProfileData/CoverageMappingTest.cpp +++ b/unittests/ProfileData/CoverageMappingTest.cpp @@ -234,12 +234,12 @@ struct CoverageMappingTest : ::testing::TestWithParam> { for (const auto &OF : OutputFunctions) { ArrayRef Funcs(OF); CoverageReaders.push_back( - make_unique(Funcs)); + std::make_unique(Funcs)); } } else { ArrayRef Funcs(OutputFunctions); CoverageReaders.push_back( - make_unique(Funcs)); + std::make_unique(Funcs)); } return CoverageMapping::load(CoverageReaders, *ProfileReader); } diff --git a/unittests/ProfileData/InstrProfTest.cpp b/unittests/ProfileData/InstrProfTest.cpp index b1e515984a4..3e862aafcf0 100644 --- a/unittests/ProfileData/InstrProfTest.cpp +++ b/unittests/ProfileData/InstrProfTest.cpp @@ -889,7 +889,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_bogus_symtab_empty_func_name) { // Testing symtab creator interface used by value profile transformer. TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_module_test) { LLVMContext Ctx; - std::unique_ptr M = llvm::make_unique("MyModule.cpp", Ctx); + std::unique_ptr M = std::make_unique("MyModule.cpp", Ctx); FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx), /*isVarArg=*/false); Function::Create(FTy, Function::ExternalLinkage, "Gfoo", M.get()); diff --git a/unittests/Support/BinaryStreamTest.cpp b/unittests/Support/BinaryStreamTest.cpp index 5291a31013c..6d6ecc45c90 100644 --- a/unittests/Support/BinaryStreamTest.cpp +++ b/unittests/Support/BinaryStreamTest.cpp @@ -144,8 +144,8 @@ protected: for (uint32_t I = 0; I < NumEndians; ++I) { auto InByteStream = - llvm::make_unique(InputData, Endians[I]); - auto InBrokenStream = llvm::make_unique( + std::make_unique(InputData, Endians[I]); + auto InBrokenStream = std::make_unique( BrokenInputData, Endians[I], Align); Streams[I * 2].Input = std::move(InByteStream); @@ -159,8 +159,8 @@ protected: for (uint32_t I = 0; I < NumEndians; ++I) { Streams[I * 2].Output = - llvm::make_unique(OutputData, Endians[I]); - Streams[I * 2 + 1].Output = llvm::make_unique( + std::make_unique(OutputData, Endians[I]); + Streams[I * 2 + 1].Output = std::make_unique( BrokenOutputData, Endians[I], Align); } } @@ -168,8 +168,8 @@ protected: void initializeOutputFromInput(uint32_t Align) { for (uint32_t I = 0; I < NumEndians; ++I) { Streams[I * 2].Output = - llvm::make_unique(InputData, Endians[I]); - Streams[I * 2 + 1].Output = llvm::make_unique( + std::make_unique(InputData, Endians[I]); + Streams[I * 2 + 1].Output = std::make_unique( BrokenInputData, Endians[I], Align); } } @@ -177,8 +177,8 @@ protected: void initializeInputFromOutput(uint32_t Align) { for (uint32_t I = 0; I < NumEndians; ++I) { Streams[I * 2].Input = - llvm::make_unique(OutputData, Endians[I]); - Streams[I * 2 + 1].Input = llvm::make_unique( + std::make_unique(OutputData, Endians[I]); + Streams[I * 2 + 1].Input = std::make_unique( BrokenOutputData, Endians[I], Align); } } diff --git a/unittests/Support/Casting.cpp b/unittests/Support/Casting.cpp index bcdaca94a3c..a196fc2ec5e 100644 --- a/unittests/Support/Casting.cpp +++ b/unittests/Support/Casting.cpp @@ -193,12 +193,12 @@ TEST(CastingTest, dyn_cast_or_null) { EXPECT_NE(F5, null_foo); } -std::unique_ptr newd() { return llvm::make_unique(); } -std::unique_ptr newb() { return llvm::make_unique(); } +std::unique_ptr newd() { return std::make_unique(); } +std::unique_ptr newb() { return std::make_unique(); } TEST(CastingTest, unique_dyn_cast) { derived *OrigD = nullptr; - auto D = llvm::make_unique(); + auto D = std::make_unique(); OrigD = D.get(); // Converting from D to itself is valid, it should return a new unique_ptr diff --git a/unittests/Support/FileCheckTest.cpp b/unittests/Support/FileCheckTest.cpp index d85690d633b..375f8960c10 100644 --- a/unittests/Support/FileCheckTest.cpp +++ b/unittests/Support/FileCheckTest.cpp @@ -87,9 +87,9 @@ TEST_F(FileCheckTest, NumericVariable) { // returns true, getValue and eval return value of expression, setValue // clears expression. std::unique_ptr FooVarUsePtr = - llvm::make_unique("FOO", &FooVar); + std::make_unique("FOO", &FooVar); std::unique_ptr One = - llvm::make_unique(1); + std::make_unique(1); FileCheckASTBinop Binop = FileCheckASTBinop(doAdd, std::move(FooVarUsePtr), std::move(One)); FileCheckNumericVariable FoobarExprVar = @@ -126,11 +126,11 @@ TEST_F(FileCheckTest, Binop) { FileCheckNumericVariable FooVar = FileCheckNumericVariable("FOO", 1); FooVar.setValue(42); std::unique_ptr FooVarUse = - llvm::make_unique("FOO", &FooVar); + std::make_unique("FOO", &FooVar); FileCheckNumericVariable BarVar = FileCheckNumericVariable("BAR", 2); BarVar.setValue(18); std::unique_ptr BarVarUse = - llvm::make_unique("BAR", &BarVar); + std::make_unique("BAR", &BarVar); FileCheckASTBinop Binop = FileCheckASTBinop(doAdd, std::move(FooVarUse), std::move(BarVarUse)); @@ -453,8 +453,8 @@ TEST_F(FileCheckTest, Substitution) { LineVar.setValue(42); NVar.setValue(10); auto LineVarUse = - llvm::make_unique("@LINE", &LineVar); - auto NVarUse = llvm::make_unique("N", &NVar); + std::make_unique("@LINE", &LineVar); + auto NVarUse = std::make_unique("N", &NVar); FileCheckNumericSubstitution SubstitutionLine = FileCheckNumericSubstitution( &Context, "@LINE", std::move(LineVarUse), 12); FileCheckNumericSubstitution SubstitutionN = diff --git a/unittests/Support/Host.cpp b/unittests/Support/Host.cpp index ec9dd951a9f..4562d933df7 100644 --- a/unittests/Support/Host.cpp +++ b/unittests/Support/Host.cpp @@ -273,7 +273,7 @@ static bool runAndGetCommandOutput( Size = ::lseek(FD, 0, SEEK_END); ASSERT_NE(-1, Size); ::lseek(FD, 0, SEEK_SET); - Buffer = llvm::make_unique(Size); + Buffer = std::make_unique(Size); ASSERT_EQ(::read(FD, Buffer.get(), Size), Size); ::close(FD); diff --git a/unittests/Support/TrigramIndexTest.cpp b/unittests/Support/TrigramIndexTest.cpp index 9b10daa86e8..42b3fcdbd53 100644 --- a/unittests/Support/TrigramIndexTest.cpp +++ b/unittests/Support/TrigramIndexTest.cpp @@ -22,7 +22,7 @@ protected: std::unique_ptr makeTrigramIndex( std::vector Rules) { std::unique_ptr TI = - make_unique(); + std::make_unique(); for (auto &Rule : Rules) TI->insert(Rule); return TI; diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp index e02f68f2ace..0c9df117031 100644 --- a/unittests/Support/YAMLIOTest.cpp +++ b/unittests/Support/YAMLIOTest.cpp @@ -2841,19 +2841,19 @@ template <> struct PolymorphicTraits> { static Scalar &getAsScalar(std::unique_ptr &N) { if (!N || !isa(*N)) - N = llvm::make_unique(); + N = std::make_unique(); return *cast(N.get()); } static Seq &getAsSequence(std::unique_ptr &N) { if (!N || !isa(*N)) - N = llvm::make_unique(); + N = std::make_unique(); return *cast(N.get()); } static Map &getAsMap(std::unique_ptr &N) { if (!N || !isa(*N)) - N = llvm::make_unique(); + N = std::make_unique(); return *cast(N.get()); } }; @@ -2932,7 +2932,7 @@ template <> struct SequenceTraits { TEST(YAMLIO, TestReadWritePolymorphicScalar) { std::string intermediate; - std::unique_ptr node = llvm::make_unique(true); + std::unique_ptr node = std::make_unique(true); llvm::raw_string_ostream ostr(intermediate); Output yout(ostr); @@ -2946,9 +2946,9 @@ TEST(YAMLIO, TestReadWritePolymorphicScalar) { TEST(YAMLIO, TestReadWritePolymorphicSeq) { std::string intermediate; { - auto seq = llvm::make_unique(); - seq->push_back(llvm::make_unique(true)); - seq->push_back(llvm::make_unique(1.0)); + auto seq = std::make_unique(); + seq->push_back(std::make_unique(true)); + seq->push_back(std::make_unique(1.0)); auto node = llvm::unique_dyn_cast(seq); llvm::raw_string_ostream ostr(intermediate); @@ -2978,9 +2978,9 @@ TEST(YAMLIO, TestReadWritePolymorphicSeq) { TEST(YAMLIO, TestReadWritePolymorphicMap) { std::string intermediate; { - auto map = llvm::make_unique(); - (*map)["foo"] = llvm::make_unique(false); - (*map)["bar"] = llvm::make_unique(2.0); + auto map = std::make_unique(); + (*map)["foo"] = std::make_unique(false); + (*map)["bar"] = std::make_unique(2.0); std::unique_ptr node = llvm::unique_dyn_cast(map); llvm::raw_string_ostream ostr(intermediate); diff --git a/unittests/Target/AArch64/InstSizes.cpp b/unittests/Target/AArch64/InstSizes.cpp index a70f43c4379..8214d4f4113 100644 --- a/unittests/Target/AArch64/InstSizes.cpp +++ b/unittests/Target/AArch64/InstSizes.cpp @@ -30,7 +30,7 @@ std::unique_ptr createTargetMachine() { std::unique_ptr createInstrInfo(TargetMachine *TM) { AArch64Subtarget ST(TM->getTargetTriple(), TM->getTargetCPU(), TM->getTargetFeatureString(), *TM, /* isLittle */ false); - return llvm::make_unique(ST); + return std::make_unique(ST); } /// The \p InputIRSnippet is only needed for things that can't be expressed in diff --git a/unittests/Transforms/Utils/ValueMapperTest.cpp b/unittests/Transforms/Utils/ValueMapperTest.cpp index 690f4340068..a586ac7bb20 100644 --- a/unittests/Transforms/Utils/ValueMapperTest.cpp +++ b/unittests/Transforms/Utils/ValueMapperTest.cpp @@ -66,9 +66,9 @@ TEST(ValueMapperTest, mapMDNodeCycle) { TEST(ValueMapperTest, mapMDNodeDuplicatedCycle) { LLVMContext Context; auto *PtrTy = Type::getInt8Ty(Context)->getPointerTo(); - std::unique_ptr G0 = llvm::make_unique( + std::unique_ptr G0 = std::make_unique( PtrTy, false, GlobalValue::ExternalLinkage, nullptr, "G0"); - std::unique_ptr G1 = llvm::make_unique( + std::unique_ptr G1 = std::make_unique( PtrTy, false, GlobalValue::ExternalLinkage, nullptr, "G1"); // Create a cycle that references G0. diff --git a/unittests/Transforms/Vectorize/VPlanTestBase.h b/unittests/Transforms/Vectorize/VPlanTestBase.h index 3ee811a6830..d0bf3cf1a65 100644 --- a/unittests/Transforms/Vectorize/VPlanTestBase.h +++ b/unittests/Transforms/Vectorize/VPlanTestBase.h @@ -48,7 +48,7 @@ protected: VPlanPtr buildHCFG(BasicBlock *LoopHeader) { doAnalysis(*LoopHeader->getParent()); - auto Plan = llvm::make_unique(); + auto Plan = std::make_unique(); VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get(), *Plan); HCFGBuilder.buildHierarchicalCFG(); return Plan; @@ -58,7 +58,7 @@ protected: VPlanPtr buildPlainCFG(BasicBlock *LoopHeader) { doAnalysis(*LoopHeader->getParent()); - auto Plan = llvm::make_unique(); + auto Plan = std::make_unique(); VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get(), *Plan); VPRegionBlock *TopRegion = HCFGBuilder.buildPlainCFG(); Plan->setEntry(TopRegion); diff --git a/unittests/XRay/FDRProducerConsumerTest.cpp b/unittests/XRay/FDRProducerConsumerTest.cpp index e1fa0e345d2..6eff4dfcc50 100644 --- a/unittests/XRay/FDRProducerConsumerTest.cpp +++ b/unittests/XRay/FDRProducerConsumerTest.cpp @@ -34,43 +34,43 @@ using ::testing::SizeIs; template std::unique_ptr MakeRecord(); template <> std::unique_ptr MakeRecord() { - return make_unique(1); + return std::make_unique(1); } template <> std::unique_ptr MakeRecord() { - return make_unique(1, 2); + return std::make_unique(1, 2); } template <> std::unique_ptr MakeRecord() { - return make_unique(1); + return std::make_unique(1); } template <> std::unique_ptr MakeRecord() { - return make_unique(1, 2); + return std::make_unique(1, 2); } template <> std::unique_ptr MakeRecord() { - return make_unique(4, 1, 2, "data"); + return std::make_unique(4, 1, 2, "data"); } template <> std::unique_ptr MakeRecord() { - return make_unique(1); + return std::make_unique(1); } template <> std::unique_ptr MakeRecord() { - return make_unique(1); + return std::make_unique(1); } template <> std::unique_ptr MakeRecord() { - return make_unique(RecordTypes::ENTER, 1, 2); + return std::make_unique(RecordTypes::ENTER, 1, 2); } template <> std::unique_ptr MakeRecord() { - return make_unique(4, 1, "data"); + return std::make_unique(4, 1, "data"); } template <> std::unique_ptr MakeRecord() { - return make_unique(4, 1, 2, "data"); + return std::make_unique(4, 1, 2, "data"); } template class RoundTripTest : public ::testing::Test { @@ -82,7 +82,7 @@ public: H.NonstopTSC = true; H.CycleFrequency = 3e9; - Writer = make_unique(OS, H); + Writer = std::make_unique(OS, H); Rec = MakeRecord(); } @@ -105,7 +105,7 @@ public: H.NonstopTSC = true; H.CycleFrequency = 3e9; - Writer = make_unique(OS, H); + Writer = std::make_unique(OS, H); Rec = MakeRecord(); } diff --git a/unittests/XRay/FDRRecordPrinterTest.cpp b/unittests/XRay/FDRRecordPrinterTest.cpp index 39c1e866f04..bfee1c5d388 100644 --- a/unittests/XRay/FDRRecordPrinterTest.cpp +++ b/unittests/XRay/FDRRecordPrinterTest.cpp @@ -22,7 +22,7 @@ template struct Helper {}; template <> struct Helper { static std::unique_ptr construct() { - return make_unique(1); + return std::make_unique(1); } static const char *expected() { return ""; } @@ -30,7 +30,7 @@ template <> struct Helper { template <> struct Helper { static std::unique_ptr construct() { - return make_unique(1, 2); + return std::make_unique(1, 2); } static const char *expected() { return ""; } @@ -38,7 +38,7 @@ template <> struct Helper { template <> struct Helper { static std::unique_ptr construct() { - return make_unique(1, 2); + return std::make_unique(1, 2); } static const char *expected() { return ""; } @@ -46,7 +46,7 @@ template <> struct Helper { template <> struct Helper { static std::unique_ptr construct() { - return make_unique(1); + return std::make_unique(1); } static const char *expected() { return ""; } @@ -54,7 +54,7 @@ template <> struct Helper { template <> struct Helper { static std::unique_ptr construct() { - return make_unique(4, 1, 2, "data"); + return std::make_unique(4, 1, 2, "data"); } static const char *expected() { @@ -64,7 +64,7 @@ template <> struct Helper { template <> struct Helper { static std::unique_ptr construct() { - return make_unique(1); + return std::make_unique(1); } static const char *expected() { @@ -74,7 +74,7 @@ template <> struct Helper { template <> struct Helper { static std::unique_ptr construct() { - return make_unique(1); + return std::make_unique(1); } static const char *expected() { return ""; } @@ -82,7 +82,7 @@ template <> struct Helper { template <> struct Helper { static std::unique_ptr construct() { - return make_unique(1); + return std::make_unique(1); } static const char *expected() { return ""; } @@ -90,7 +90,7 @@ template <> struct Helper { template <> struct Helper { static std::unique_ptr construct() { - return make_unique(); + return std::make_unique(); } static const char *expected() { return ""; } diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 146d10835b8..f285b1d6767 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -1515,7 +1515,7 @@ void AsmMatcherInfo::buildInfo() { if (!V.empty() && V != Variant.Name) continue; - auto II = llvm::make_unique(*CGI); + auto II = std::make_unique(*CGI); II->initialize(*this, SingletonRegisters, Variant, HasMnemonicFirst); @@ -1532,7 +1532,7 @@ void AsmMatcherInfo::buildInfo() { std::vector AllInstAliases = Records.getAllDerivedDefinitions("InstAlias"); for (unsigned i = 0, e = AllInstAliases.size(); i != e; ++i) { - auto Alias = llvm::make_unique(AllInstAliases[i], + auto Alias = std::make_unique(AllInstAliases[i], Target); // If the tblgen -match-prefix option is specified (for tblgen hackers), @@ -1546,7 +1546,7 @@ void AsmMatcherInfo::buildInfo() { if (!V.empty() && V != Variant.Name) continue; - auto II = llvm::make_unique(std::move(Alias)); + auto II = std::make_unique(std::move(Alias)); II->initialize(*this, SingletonRegisters, Variant, HasMnemonicFirst); @@ -1615,7 +1615,7 @@ void AsmMatcherInfo::buildInfo() { II->TheDef->getValueAsString("TwoOperandAliasConstraint"); if (Constraint != "") { // Start by making a copy of the original matchable. - auto AliasII = llvm::make_unique(*II); + auto AliasII = std::make_unique(*II); // Adjust it to be a two-operand alias. AliasII->formTwoOperandAlias(Constraint); diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index de423655971..c0e38c032e8 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -3101,7 +3101,7 @@ void CodeGenDAGPatterns::ParsePatternFragments(bool OutFrags) { ListInit *LI = Frag->getValueAsListInit("Fragments"); TreePattern *P = - (PatternFragments[Frag] = llvm::make_unique( + (PatternFragments[Frag] = std::make_unique( Frag, LI, !Frag->isSubClassOf("OutPatFrag"), *this)).get(); diff --git a/utils/TableGen/CodeGenRegisters.cpp b/utils/TableGen/CodeGenRegisters.cpp index 9325c464144..689809a5cf7 100644 --- a/utils/TableGen/CodeGenRegisters.cpp +++ b/utils/TableGen/CodeGenRegisters.cpp @@ -670,7 +670,7 @@ struct TupleExpander : SetTheory::Expander { // is only for consumption by CodeGenRegister, it is not added to the // RecordKeeper. SynthDefs.emplace_back( - llvm::make_unique(Name, Def->getLoc(), Def->getRecords())); + std::make_unique(Name, Def->getLoc(), Def->getRecords())); Record *NewReg = SynthDefs.back().get(); Elts.insert(NewReg); @@ -1098,7 +1098,7 @@ CodeGenRegBank::CodeGenRegBank(RecordKeeper &Records, Sets.addFieldExpander("RegisterClass", "MemberList"); Sets.addFieldExpander("CalleeSavedRegs", "SaveList"); Sets.addExpander("RegisterTuples", - llvm::make_unique(SynthDefs)); + std::make_unique(SynthDefs)); // Read in the user-defined (named) sub-register indices. // More indices will be synthesized later. diff --git a/utils/TableGen/CodeGenSchedule.cpp b/utils/TableGen/CodeGenSchedule.cpp index fd007044a16..cb05f78fba4 100644 --- a/utils/TableGen/CodeGenSchedule.cpp +++ b/utils/TableGen/CodeGenSchedule.cpp @@ -172,8 +172,8 @@ CodeGenSchedModels::CodeGenSchedModels(RecordKeeper &RK, // Allow Set evaluation to recognize the dags used in InstRW records: // (instrs Op1, Op1...) - Sets.addOperator("instrs", llvm::make_unique()); - Sets.addOperator("instregex", llvm::make_unique(Target)); + Sets.addOperator("instrs", std::make_unique()); + Sets.addOperator("instregex", std::make_unique(Target)); // Instantiate a CodeGenProcModel for each SchedMachineModel with the values // that are explicitly referenced in tablegen records. Resources associated diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index 05f9f22e282..2f8efbed410 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -289,7 +289,7 @@ Record *CodeGenTarget::getAsmWriter() const { CodeGenRegBank &CodeGenTarget::getRegBank() const { if (!RegBank) - RegBank = llvm::make_unique(Records, getHwModes()); + RegBank = std::make_unique(Records, getHwModes()); return *RegBank; } @@ -339,7 +339,7 @@ void CodeGenTarget::ReadLegalValueTypes() const { CodeGenSchedModels &CodeGenTarget::getSchedModels() const { if (!SchedModels) - SchedModels = llvm::make_unique(Records, *this); + SchedModels = std::make_unique(Records, *this); return *SchedModels; } @@ -352,7 +352,7 @@ void CodeGenTarget::ReadInstructions() const { // Parse the instructions defined in the .td file. for (unsigned i = 0, e = Insts.size(); i != e; ++i) - Instructions[Insts[i]] = llvm::make_unique(Insts[i]); + Instructions[Insts[i]] = std::make_unique(Insts[i]); } static const CodeGenInstruction * diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index fb0c6faa529..d8e78ce55c7 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -173,7 +173,7 @@ void DAGISelEmitter::run(raw_ostream &OS) { } std::unique_ptr TheMatcher = - llvm::make_unique(PatternMatchers); + std::make_unique(PatternMatchers); OptimizeMatcher(TheMatcher, CGP); //Matcher->dump(); diff --git a/utils/TableGen/FixedLenDecoderEmitter.cpp b/utils/TableGen/FixedLenDecoderEmitter.cpp index cfe06dd4d7f..dc9dfa8ff5e 100644 --- a/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -600,7 +600,7 @@ void Filter::recurse() { // Delegates to an inferior filter chooser for further processing on this // group of instructions whose segment values are variable. FilterChooserMap.insert( - std::make_pair(-1U, llvm::make_unique( + std::make_pair(-1U, std::make_unique( Owner->AllInstructions, VariableInstructions, Owner->Operands, BitValueArray, *Owner))); } @@ -626,7 +626,7 @@ void Filter::recurse() { // Delegates to an inferior filter chooser for further processing on this // category of instructions. FilterChooserMap.insert(std::make_pair( - Inst.first, llvm::make_unique( + Inst.first, std::make_unique( Owner->AllInstructions, Inst.second, Owner->Operands, BitValueArray, *Owner))); } diff --git a/utils/TableGen/GlobalISelEmitter.cpp b/utils/TableGen/GlobalISelEmitter.cpp index 06cdfd4ab59..aba2b9c3a62 100644 --- a/utils/TableGen/GlobalISelEmitter.cpp +++ b/utils/TableGen/GlobalISelEmitter.cpp @@ -1450,7 +1450,7 @@ public: Optional addPredicate(Args &&... args) { if (isSameAsAnotherOperand()) return None; - Predicates.emplace_back(llvm::make_unique( + Predicates.emplace_back(std::make_unique( getInsnVarID(), getOpIdx(), std::forward(args)...)); return static_cast(Predicates.back().get()); } @@ -1999,7 +1999,7 @@ public: template Optional addPredicate(Args &&... args) { Predicates.emplace_back( - llvm::make_unique(getInsnVarID(), std::forward(args)...)); + std::make_unique(getInsnVarID(), std::forward(args)...)); return static_cast(Predicates.back().get()); } @@ -2662,7 +2662,7 @@ public: template Kind &addRenderer(Args&&... args) { OperandRenderers.emplace_back( - llvm::make_unique(InsnID, std::forward(args)...)); + std::make_unique(InsnID, std::forward(args)...)); return *static_cast(OperandRenderers.back().get()); } @@ -2823,7 +2823,7 @@ const std::vector &RuleMatcher::getRequiredFeatures() const { // iterator. template Kind &RuleMatcher::addAction(Args &&... args) { - Actions.emplace_back(llvm::make_unique(std::forward(args)...)); + Actions.emplace_back(std::make_unique(std::forward(args)...)); return *static_cast(Actions.back().get()); } @@ -2838,7 +2838,7 @@ template action_iterator RuleMatcher::insertAction(action_iterator InsertPt, Args &&... args) { return Actions.emplace(InsertPt, - llvm::make_unique(std::forward(args)...)); + std::make_unique(std::forward(args)...)); } unsigned RuleMatcher::implicitlyDefineInsnVar(InstructionMatcher &Matcher) { @@ -4289,7 +4289,7 @@ std::vector GlobalISelEmitter::optimizeRules( std::vector> &MatcherStorage) { std::vector OptRules; - std::unique_ptr CurrentGroup = make_unique(); + std::unique_ptr CurrentGroup = std::make_unique(); assert(CurrentGroup->empty() && "Newly created group isn't empty!"); unsigned NumGroups = 0; @@ -4310,7 +4310,7 @@ std::vector GlobalISelEmitter::optimizeRules( MatcherStorage.emplace_back(std::move(CurrentGroup)); ++NumGroups; } - CurrentGroup = make_unique(); + CurrentGroup = std::make_unique(); }; for (Matcher *Rule : Rules) { // Greedily add as many matchers as possible to the current group: diff --git a/utils/TableGen/SearchableTableEmitter.cpp b/utils/TableGen/SearchableTableEmitter.cpp index 954b63e7253..e274415f3ed 100644 --- a/utils/TableGen/SearchableTableEmitter.cpp +++ b/utils/TableGen/SearchableTableEmitter.cpp @@ -134,7 +134,7 @@ private: CodeGenIntrinsic &getIntrinsic(Init *I) { std::unique_ptr &Intr = Intrinsics[I]; if (!Intr) - Intr = make_unique(cast(I)->getDef()); + Intr = std::make_unique(cast(I)->getDef()); return *Intr; } @@ -541,7 +541,7 @@ std::unique_ptr SearchableTableEmitter::parseSearchIndex(GenericTable &Table, StringRef Name, const std::vector &Key, bool EarlyOut) { - auto Index = llvm::make_unique(); + auto Index = std::make_unique(); Index->Name = Name; Index->EarlyOut = EarlyOut; @@ -577,7 +577,7 @@ void SearchableTableEmitter::collectEnumEntries( if (!ValueField.empty()) Value = getInt(EntryRec, ValueField); - Enum.Entries.push_back(llvm::make_unique(Name, Value)); + Enum.Entries.push_back(std::make_unique(Name, Value)); Enum.EntryMap.insert(std::make_pair(EntryRec, Enum.Entries.back().get())); } @@ -647,7 +647,7 @@ void SearchableTableEmitter::run(raw_ostream &OS) { if (!EnumRec->isValueUnset("ValueField")) ValueField = EnumRec->getValueAsString("ValueField"); - auto Enum = llvm::make_unique(); + auto Enum = std::make_unique(); Enum->Name = EnumRec->getName(); Enum->PreprocessorGuard = EnumRec->getName(); @@ -664,7 +664,7 @@ void SearchableTableEmitter::run(raw_ostream &OS) { } for (auto TableRec : Records.getAllDerivedDefinitions("GenericTable")) { - auto Table = llvm::make_unique(); + auto Table = std::make_unique(); Table->Name = TableRec->getName(); Table->PreprocessorGuard = TableRec->getName(); Table->CppTypeName = TableRec->getValueAsString("CppTypeName"); @@ -733,7 +733,7 @@ void SearchableTableEmitter::run(raw_ostream &OS) { if (!Class->isValueUnset("EnumValueField")) ValueField = Class->getValueAsString("EnumValueField"); - auto Enum = llvm::make_unique(); + auto Enum = std::make_unique(); Enum->Name = (Twine(Class->getName()) + "Values").str(); Enum->PreprocessorGuard = Class->getName().upper(); Enum->Class = Class; @@ -743,7 +743,7 @@ void SearchableTableEmitter::run(raw_ostream &OS) { Enums.emplace_back(std::move(Enum)); } - auto Table = llvm::make_unique(); + auto Table = std::make_unique(); Table->Name = (Twine(Class->getName()) + "sList").str(); Table->PreprocessorGuard = Class->getName().upper(); Table->CppTypeName = Class->getName(); diff --git a/utils/TableGen/X86DisassemblerTables.cpp b/utils/TableGen/X86DisassemblerTables.cpp index 8036aecc4f4..14bce4c2944 100644 --- a/utils/TableGen/X86DisassemblerTables.cpp +++ b/utils/TableGen/X86DisassemblerTables.cpp @@ -651,7 +651,7 @@ static const char* stringForDecisionType(ModRMDecisionType dt) { DisassemblerTables::DisassemblerTables() { for (unsigned i = 0; i < array_lengthof(Tables); i++) - Tables[i] = llvm::make_unique(); + Tables[i] = std::make_unique(); HasConflicts = false; } diff --git a/utils/TableGen/X86RecognizableInstr.cpp b/utils/TableGen/X86RecognizableInstr.cpp index 37bf3b82b01..33dc6f3f9e2 100644 --- a/utils/TableGen/X86RecognizableInstr.cpp +++ b/utils/TableGen/X86RecognizableInstr.cpp @@ -749,7 +749,7 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const { case X86Local::RawFrmImm8: case X86Local::RawFrmImm16: case X86Local::AddCCFrm: - filter = llvm::make_unique(); + filter = std::make_unique(); break; case X86Local::MRMDestReg: case X86Local::MRMSrcReg: @@ -758,7 +758,7 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const { case X86Local::MRMSrcRegCC: case X86Local::MRMXrCC: case X86Local::MRMXr: - filter = llvm::make_unique(true); + filter = std::make_unique(true); break; case X86Local::MRMDestMem: case X86Local::MRMSrcMem: @@ -767,22 +767,22 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const { case X86Local::MRMSrcMemCC: case X86Local::MRMXmCC: case X86Local::MRMXm: - filter = llvm::make_unique(false); + filter = std::make_unique(false); break; case X86Local::MRM0r: case X86Local::MRM1r: case X86Local::MRM2r: case X86Local::MRM3r: case X86Local::MRM4r: case X86Local::MRM5r: case X86Local::MRM6r: case X86Local::MRM7r: - filter = llvm::make_unique(true, Form - X86Local::MRM0r); + filter = std::make_unique(true, Form - X86Local::MRM0r); break; case X86Local::MRM0m: case X86Local::MRM1m: case X86Local::MRM2m: case X86Local::MRM3m: case X86Local::MRM4m: case X86Local::MRM5m: case X86Local::MRM6m: case X86Local::MRM7m: - filter = llvm::make_unique(false, Form - X86Local::MRM0m); + filter = std::make_unique(false, Form - X86Local::MRM0m); break; X86_INSTR_MRM_MAPPING - filter = llvm::make_unique(0xC0 + Form - X86Local::MRM_C0); + filter = std::make_unique(0xC0 + Form - X86Local::MRM_C0); break; } // switch (Form)