summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ChainedIncludesSource.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-07-17 20:40:36 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-07-17 20:40:36 +0000
commita51666a4d624a745df90e1c84777fb7a644ff80b (patch)
tree27a6715358a552387f3e0fd041de88a3095d0a35 /clang/lib/Frontend/ChainedIncludesSource.cpp
parentfa59e620126114e35477299dbb726c4e85195276 (diff)
downloadbcm5719-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.cpp8
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) {
OpenPOWER on IntegriCloud