diff options
| author | David Blaikie <dblaikie@gmail.com> | 2014-07-17 20:40:36 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2014-07-17 20:40:36 +0000 |
| commit | 4d15e347a0bb35430635e1ae50d429c49761ae31 (patch) | |
| tree | acf66daecbe11d2bbc0db6285245ec70edb71dfb /unittests/Tooling/RefactoringTest.cpp | |
| parent | 6042ad3646ce7238962b2fdfd60c66c2dc06df1c (diff) | |
| download | clang-4d15e347a0bb35430635e1ae50d429c49761ae31.tar.gz | |
unique_ptr-ify ownership of ASTConsumers
(after fixing a bug in MultiplexConsumer I noticed the ownership of the
nested consumers was implemented with raw pointers - so this fixes
that... and follows the source back to its origin pushing unique_ptr
ownership up through there too)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213307 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: |
