summaryrefslogtreecommitdiffstats
path: root/examples
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
commit4d15e347a0bb35430635e1ae50d429c49761ae31 (patch)
treeacf66daecbe11d2bbc0db6285245ec70edb71dfb /examples
parent6042ad3646ce7238962b2fdfd60c66c2dc06df1c (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 'examples')
-rw-r--r--examples/PrintFunctionNames/PrintFunctionNames.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/PrintFunctionNames/PrintFunctionNames.cpp b/examples/PrintFunctionNames/PrintFunctionNames.cpp
index 3f18cd45e5..e8a361dbee 100644
--- a/examples/PrintFunctionNames/PrintFunctionNames.cpp
+++ b/examples/PrintFunctionNames/PrintFunctionNames.cpp
@@ -36,8 +36,9 @@ public:
class PrintFunctionNamesAction : public PluginASTAction {
protected:
- ASTConsumer *CreateASTConsumer(CompilerInstance &CI, llvm::StringRef) {
- return new PrintFunctionsConsumer();
+ std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
+ llvm::StringRef) {
+ return llvm::make_unique<PrintFunctionsConsumer>();
}
bool ParseArgs(const CompilerInstance &CI,