[clang-tools-extra] r370451 - [Tooling] Migrated APIs that take ownership of objects to unique_ptr

Dmitri Gribenko via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 02:29:35 PDT 2019


Author: gribozavr
Date: Fri Aug 30 02:29:34 2019
New Revision: 370451

URL: http://llvm.org/viewvc/llvm-project?rev=370451&view=rev
Log:
[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

Modified:
    clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp
    clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h

Modified: clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp?rev=370451&r1=370450&r2=370451&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp Fri Aug 30 02:29:34 2019
@@ -88,7 +88,7 @@ public:
     Args.push_back(MainFilePath);
 
     tooling::ToolInvocation Invocation(
-        Args, Action.release(), Files.get(),
+        Args, std::move(Action), Files.get(),
         std::make_shared<PCHContainerOperations>());
 
     Invocation.run();

Modified: clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h?rev=370451&r1=370450&r2=370451&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h Fri Aug 30 02:29:34 2019
@@ -117,7 +117,9 @@ runCheckOnCode(StringRef Code, std::vect
 
   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));




More information about the cfe-commits mailing list