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 /lib/Frontend/ChainedIncludesSource.cpp | |
parent | f1d79b587c72d41cd154c158b8f87c920c109485 (diff) |
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 '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) { |