[Tooling] Migrated APIs that take ownership of objects to unique_ptr

Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66960

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@370451 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/clangd/unittests/IndexActionTests.cpp b/clangd/unittests/IndexActionTests.cpp
index 7d7a3c1..4ca86e8 100644
--- a/clangd/unittests/IndexActionTests.cpp
+++ b/clangd/unittests/IndexActionTests.cpp
@@ -88,7 +88,7 @@
     Args.push_back(MainFilePath);
 
     tooling::ToolInvocation Invocation(
-        Args, Action.release(), Files.get(),
+        Args, std::move(Action), Files.get(),
         std::make_shared<PCHContainerOperations>());
 
     Invocation.run();
diff --git a/unittests/clang-tidy/ClangTidyTest.h b/unittests/clang-tidy/ClangTidyTest.h
index 787679c..36727ec 100644
--- a/unittests/clang-tidy/ClangTidyTest.h
+++ b/unittests/clang-tidy/ClangTidyTest.h
@@ -117,7 +117,9 @@
 
   SmallVector<std::unique_ptr<ClangTidyCheck>, 1> Checks;
   tooling::ToolInvocation Invocation(
-      Args, new TestClangTidyAction<CheckTypes...>(Checks, Finder, Context),
+      Args,
+      std::make_unique<TestClangTidyAction<CheckTypes...>>(Checks, Finder,
+                                                           Context),
       Files.get());
   InMemoryFileSystem->addFile(Filename, 0,
                               llvm::MemoryBuffer::getMemBuffer(Code));