summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-10 19:56:51 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-10 19:56:51 +0000
commitb53da8604800249ab936b1316b1d81a81841a3d8 (patch)
tree6c4da40d922f9c0f848547e400f1fd07cd831eba /examples
parentf1d79b587c72d41cd154c158b8f87c920c109485 (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 '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,