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 | 6beb6aa8f0f6fa20e8c8de7a17f39b101ed0da59 (patch) | |
tree | 584157687d5fd851d1afa4ca2e217973ff095555 /clang/lib/Frontend/ChainedIncludesSource.cpp | |
parent | 4422df6fa321019aad77ea3a1aacff3fcf6d0280 (diff) | |
download | llvm-6beb6aa8f0f6fa20e8c8de7a17f39b101ed0da59.zip llvm-6beb6aa8f0f6fa20e8c8de7a17f39b101ed0da59.tar.gz llvm-6beb6aa8f0f6fa20e8c8de7a17f39b101ed0da59.tar.bz2 |
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.
llvm-svn: 215323
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 e6e73ac..6b14e25 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) { |