diff options
| author | David Blaikie <dblaikie@gmail.com> | 2014-08-10 19:56:51 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2014-08-10 19:56:51 +0000 |
| commit | b53da8604800249ab936b1316b1d81a81841a3d8 (patch) | |
| tree | 6c4da40d922f9c0f848547e400f1fd07cd831eba /unittests/Tooling/RefactoringTest.cpp | |
| parent | f1d79b587c72d41cd154c158b8f87c920c109485 (diff) | |
| download | clang-b53da8604800249ab936b1316b1d81a81841a3d8.tar.gz | |
Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Tooling/RefactoringTest.cpp')
| -rw-r--r-- | unittests/Tooling/RefactoringTest.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/unittests/Tooling/RefactoringTest.cpp b/unittests/Tooling/RefactoringTest.cpp index ddb974ac9f..3e067dd3f9 100644 --- a/unittests/Tooling/RefactoringTest.cpp +++ b/unittests/Tooling/RefactoringTest.cpp @@ -299,11 +299,12 @@ private: public: TestAction(TestVisitor *Visitor) : Visitor(Visitor) {} - virtual clang::ASTConsumer* CreateASTConsumer( - clang::CompilerInstance& compiler, llvm::StringRef dummy) { + virtual std::unique_ptr<clang::ASTConsumer> + CreateASTConsumer(clang::CompilerInstance &compiler, + llvm::StringRef dummy) { Visitor->SM = &compiler.getSourceManager(); /// TestConsumer will be deleted by the framework calling us. - return new FindConsumer(Visitor); + return llvm::make_unique<FindConsumer>(Visitor); } private: |
