[llvm] Migrate llvm::make_unique to std::make_unique

Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

llvm-svn: 369013
diff --git a/llvm/docs/ORCv2.rst b/llvm/docs/ORCv2.rst
index ba4534e..edb1695 100644
--- a/llvm/docs/ORCv2.rst
+++ b/llvm/docs/ORCv2.rst
@@ -174,7 +174,7 @@
 
   ExecutionSession ES;
   RTDyldObjectLinkingLayer ObjLinkingLayer(
-      ES, []() { return llvm::make_unique<SectionMemoryManager>(); });
+      ES, []() { return std::make_unique<SectionMemoryManager>(); });
   CXXCompileLayer CXXLayer(ES, ObjLinkingLayer);
 
   // Create JITDylib "A" and add code to it using the CXX layer.
@@ -453,7 +453,7 @@
 
   .. code-block:: c++
 
-    ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+    ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
 
 ThreadSafeModules can be constructed from a pair of a std::unique_ptr<Module>
 and a ThreadSafeContext value. ThreadSafeContext values may be shared between
@@ -462,10 +462,10 @@
   .. code-block:: c++
 
     ThreadSafeModule TSM1(
-      llvm::make_unique<Module>("M1", *TSCtx.getContext()), TSCtx);
+      std::make_unique<Module>("M1", *TSCtx.getContext()), TSCtx);
 
     ThreadSafeModule TSM2(
-      llvm::make_unique<Module>("M2", *TSCtx.getContext()), TSCtx);
+      std::make_unique<Module>("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 @@
 
   .. code-block:: c++
 
-    ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+    ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
 
     ThreadPool TP(NumThreads);
     JITStack J;
@@ -519,8 +519,8 @@
     // Maximize concurrency opportunities by loading every module on a
     // separate context.
     for (const auto &IRPath : IRPaths) {
-      auto Ctx = llvm::make_unique<LLVMContext>();
-      auto M = llvm::make_unique<LLVMContext>("M", *Ctx);
+      auto Ctx = std::make_unique<LLVMContext>();
+      auto M = std::make_unique<LLVMContext>("M", *Ctx);
       CompileLayer.add(ES.getMainJITDylib(),
                        ThreadSafeModule(std::move(M), std::move(Ctx)));
     }
@@ -531,7 +531,7 @@
   .. code-block:: c++
 
     // Save memory by using one context for all Modules:
-    ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+    ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
     for (const auto &IRPath : IRPaths) {
       ThreadSafeModule TSM(parsePath(IRPath, *TSCtx.getContext()), TSCtx);
       CompileLayer.add(ES.getMainJITDylib(), ThreadSafeModule(std::move(TSM));
diff --git a/llvm/docs/tutorial/BuildingAJIT1.rst b/llvm/docs/tutorial/BuildingAJIT1.rst
index fcb755b..00ad94a 100644
--- a/llvm/docs/tutorial/BuildingAJIT1.rst
+++ b/llvm/docs/tutorial/BuildingAJIT1.rst
@@ -138,10 +138,10 @@
   public:
     KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL)
         : ObjectLayer(ES,
-                      []() { return llvm::make_unique<SectionMemoryManager>(); }),
+                      []() { return std::make_unique<SectionMemoryManager>(); }),
           CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))),
           DL(std::move(DL)), Mangle(ES, this->DL),
-          Ctx(llvm::make_unique<LLVMContext>()) {
+          Ctx(std::make_unique<LLVMContext>()) {
       ES.getMainJITDylib().setGenerator(
           cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL)));
     }
@@ -195,7 +195,7 @@
     if (!DL)
       return DL.takeError();
 
-    return llvm::make_unique<KaleidoscopeJIT>(std::move(*JTMB), std::move(*DL));
+    return std::make_unique<KaleidoscopeJIT>(std::move(*JTMB), std::move(*DL));
   }
 
   const DataLayout &getDataLayout() const { return DL; }
diff --git a/llvm/docs/tutorial/BuildingAJIT2.rst b/llvm/docs/tutorial/BuildingAJIT2.rst
index 7d25cca..1f818d9 100644
--- a/llvm/docs/tutorial/BuildingAJIT2.rst
+++ b/llvm/docs/tutorial/BuildingAJIT2.rst
@@ -71,11 +71,11 @@
 
     KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL)
         : ObjectLayer(ES,
-                      []() { return llvm::make_unique<SectionMemoryManager>(); }),
+                      []() { return std::make_unique<SectionMemoryManager>(); }),
           CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))),
           TransformLayer(ES, CompileLayer, optimizeModule),
           DL(std::move(DL)), Mangle(ES, this->DL),
-          Ctx(llvm::make_unique<LLVMContext>()) {
+          Ctx(std::make_unique<LLVMContext>()) {
       ES.getMainJITDylib().setGenerator(
           cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL)));
     }
@@ -102,7 +102,7 @@
   static Expected<ThreadSafeModule>
   optimizeModule(ThreadSafeModule M, const MaterializationResponsibility &R) {
     // Create a function pass manager.
-    auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get());
+    auto FPM = std::make_unique<legacy::FunctionPassManager>(M.get());
 
     // Add some optimizations.
     FPM->add(createInstructionCombiningPass());
@@ -213,7 +213,7 @@
 .. code-block:: c++
 
   Error IRLayer::add(JITDylib &JD, ThreadSafeModule TSM, VModuleKey K) {
-    return JD.define(llvm::make_unique<BasicIRLayerMaterializationUnit>(
+    return JD.define(std::make_unique<BasicIRLayerMaterializationUnit>(
         *this, std::move(K), std::move(TSM)));
   }
 
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst
index 3a26800..dec9f36 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst
@@ -155,8 +155,8 @@
 
 .. code-block:: c++
 
-      auto LHS = llvm::make_unique<VariableExprAST>("x");
-      auto RHS = llvm::make_unique<VariableExprAST>("y");
+      auto LHS = std::make_unique<VariableExprAST>("x");
+      auto RHS = std::make_unique<VariableExprAST>("y");
       auto Result = std::make_unique<BinaryExprAST>('+', std::move(LHS),
                                                     std::move(RHS));
 
@@ -210,7 +210,7 @@
 
     /// numberexpr ::= number
     static std::unique_ptr<ExprAST> ParseNumberExpr() {
-      auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+      auto Result = std::make_unique<NumberExprAST>(NumVal);
       getNextToken(); // consume the number
       return std::move(Result);
     }
@@ -276,7 +276,7 @@
       getNextToken();  // eat identifier.
 
       if (CurTok != '(') // Simple variable ref.
-        return llvm::make_unique<VariableExprAST>(IdName);
+        return std::make_unique<VariableExprAST>(IdName);
 
       // Call.
       getNextToken();  // eat (
@@ -300,7 +300,7 @@
       // Eat the ')'.
       getNextToken();
 
-      return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+      return std::make_unique<CallExprAST>(IdName, std::move(Args));
     }
 
 This routine follows the same style as the other routines. (It expects
@@ -503,7 +503,7 @@
         }
 
         // Merge LHS/RHS.
-        LHS = llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
+        LHS = std::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
                                                std::move(RHS));
       }  // loop around to the top of the while loop.
     }
@@ -533,7 +533,7 @@
             return nullptr;
         }
         // Merge LHS/RHS.
-        LHS = llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
+        LHS = std::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
                                                std::move(RHS));
       }  // loop around to the top of the while loop.
     }
@@ -593,7 +593,7 @@
       // success.
       getNextToken();  // eat ')'.
 
-      return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
+      return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
     }
 
 Given this, a function definition is very simple, just a prototype plus
@@ -608,7 +608,7 @@
       if (!Proto) return nullptr;
 
       if (auto E = ParseExpression())
-        return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+        return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
       return nullptr;
     }
 
@@ -634,8 +634,8 @@
     static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
       if (auto E = ParseExpression()) {
         // Make an anonymous proto.
-        auto Proto = llvm::make_unique<PrototypeAST>("", std::vector<std::string>());
-        return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+        auto Proto = std::make_unique<PrototypeAST>("", std::vector<std::string>());
+        return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
       }
       return nullptr;
     }
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst
index 773ce55..f5a46a6 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst
@@ -141,10 +141,10 @@
 
     void InitializeModuleAndPassManager(void) {
       // Open a new module.
-      TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+      TheModule = std::make_unique<Module>("my cool jit", TheContext);
 
       // Create a new pass manager attached to it.
-      TheFPM = llvm::make_unique<FunctionPassManager>(TheModule.get());
+      TheFPM = std::make_unique<FunctionPassManager>(TheModule.get());
 
       // Do simple "peephole" optimizations and bit-twiddling optzns.
       TheFPM->add(createInstructionCombiningPass());
@@ -259,7 +259,7 @@
       fprintf(stderr, "ready> ");
       getNextToken();
 
-      TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+      TheJIT = std::make_unique<KaleidoscopeJIT>();
 
       // Run the main "interpreter loop" now.
       MainLoop();
@@ -273,11 +273,11 @@
 
     void InitializeModuleAndPassManager(void) {
       // Open a new module.
-      TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+      TheModule = std::make_unique<Module>("my cool jit", TheContext);
       TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
 
       // Create a new pass manager attached to it.
-      TheFPM = llvm::make_unique<FunctionPassManager>(TheModule.get());
+      TheFPM = std::make_unique<FunctionPassManager>(TheModule.get());
       ...
 
 The KaleidoscopeJIT class is a simple JIT built specifically for these
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst
index 685e5fb..0e61c07 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst
@@ -146,7 +146,7 @@
       if (!Else)
         return nullptr;
 
-      return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+      return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
                                           std::move(Else));
     }
 
@@ -560,7 +560,7 @@
       if (!Body)
         return nullptr;
 
-      return llvm::make_unique<ForExprAST>(IdName, std::move(Start),
+      return std::make_unique<ForExprAST>(IdName, std::move(Start),
                                            std::move(End), std::move(Step),
                                            std::move(Body));
     }
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst
index 911a7dc..a05ed0b 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst
@@ -220,7 +220,7 @@
       if (Kind && ArgNames.size() != Kind)
         return LogErrorP("Invalid number of operands for operator");
 
-      return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames), Kind != 0,
+      return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames), Kind != 0,
                                              BinaryPrecedence);
     }
 
@@ -348,7 +348,7 @@
       int Opc = CurTok;
       getNextToken();
       if (auto Operand = ParseUnary())
-        return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+        return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
       return nullptr;
     }
 
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst
index 8013dec..218e441 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst
@@ -780,7 +780,7 @@
       if (!Body)
         return nullptr;
 
-      return llvm::make_unique<VarExprAST>(std::move(VarNames),
+      return std::make_unique<VarExprAST>(std::move(VarNames),
                                            std::move(Body));
     }
 
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
index 1dcc0a8..87584cd 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
@@ -77,8 +77,8 @@
 
 .. code-block:: udiff
 
-  -    auto Proto = llvm::make_unique<PrototypeAST>("", std::vector<std::string>());
-  +    auto Proto = llvm::make_unique<PrototypeAST>("main", std::vector<std::string>());
+  -    auto Proto = std::make_unique<PrototypeAST>("", std::vector<std::string>());
+  +    auto Proto = std::make_unique<PrototypeAST>("main", std::vector<std::string>());
 
 just with the simple change of giving it a name.
 
@@ -325,7 +325,7 @@
 
 .. code-block:: c++
 
-   LHS = llvm::make_unique<BinaryExprAST>(BinLoc, BinOp, std::move(LHS),
+   LHS = std::make_unique<BinaryExprAST>(BinLoc, BinOp, std::move(LHS),
                                           std::move(RHS));
 
 giving us locations for each of our expressions and variables.