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 /lib/Frontend/ChainedIncludesSource.cpp | |
parent | 6042ad3646ce7238962b2fdfd60c66c2dc06df1c (diff) |
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 'lib/Frontend/ChainedIncludesSource.cpp')
-rw-r--r-- | lib/Frontend/ChainedIncludesSource.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Frontend/ChainedIncludesSource.cpp b/lib/Frontend/ChainedIncludesSource.cpp index e6e73ac963..6b14e2505f 100644 --- a/lib/Frontend/ChainedIncludesSource.cpp +++ b/lib/Frontend/ChainedIncludesSource.cpp @@ -158,12 +158,12 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource( SmallVector<char, 256> serialAST; llvm::raw_svector_ostream OS(serialAST); - std::unique_ptr<ASTConsumer> consumer; - consumer.reset(new PCHGenerator(Clang->getPreprocessor(), "-", nullptr, - /*isysroot=*/"", &OS)); + auto consumer = + llvm::make_unique<PCHGenerator>(Clang->getPreprocessor(), "-", nullptr, + /*isysroot=*/"", &OS); Clang->getASTContext().setASTMutationListener( consumer->GetASTMutationListener()); - Clang->setASTConsumer(consumer.release()); + Clang->setASTConsumer(std::move(consumer)); Clang->createSema(TU_Prefix, nullptr); if (firstInclude) { |