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 | a51666a4d624a745df90e1c84777fb7a644ff80b (patch) | |
tree | 27a6715358a552387f3e0fd041de88a3095d0a35 /clang/lib/Frontend/ChainedIncludesSource.cpp | |
parent | fa59e620126114e35477299dbb726c4e85195276 (diff) | |
download | bcm5719-llvm-a51666a4d624a745df90e1c84777fb7a644ff80b.tar.gz bcm5719-llvm-a51666a4d624a745df90e1c84777fb7a644ff80b.zip |
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)
llvm-svn: 213307
Diffstat (limited to 'clang/lib/Frontend/ChainedIncludesSource.cpp')
-rw-r--r-- | clang/lib/Frontend/ChainedIncludesSource.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Frontend/ChainedIncludesSource.cpp b/clang/lib/Frontend/ChainedIncludesSource.cpp index e6e73ac963f..6b14e2505f8 100644 --- a/clang/lib/Frontend/ChainedIncludesSource.cpp +++ b/clang/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) { |