diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-10-22 23:57:14 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-10-22 23:57:14 +0000 |
commit | 1183ce584f8d2883adc1cfe48a357cce21edd4dd (patch) | |
tree | 31189a28da1a90cc28c99109927a92de0c867cbb /docs | |
parent | c14474677c4616e1232a8ca9d99e3980b24cdd80 (diff) |
Update the documentation for API change to CreateASTConsumer the rest of the way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/RAVFrontendAction.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/RAVFrontendAction.rst b/docs/RAVFrontendAction.rst index 288a91d36c..ec5d5d54ff 100644 --- a/docs/RAVFrontendAction.rst +++ b/docs/RAVFrontendAction.rst @@ -27,7 +27,8 @@ unit. public: virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return new FindNamedClassConsumer; + return std::unique_ptr<clang::ASTConsumer>( + new FindNamedClassConsumer); } }; @@ -111,9 +112,10 @@ freshly created FindNamedClassConsumer: :: - virtual clang::ASTConsumer *CreateASTConsumer( + virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return new FindNamedClassConsumer(&Compiler.getASTContext()); + return std::unique_ptr<clang::ASTConsumer>( + new FindNamedClassConsumer(&Compiler.getASTContext())); } Now that the ASTContext is available in the RecursiveASTVisitor, we can @@ -185,9 +187,10 @@ Now we can combine all of the above into a small example program: class FindNamedClassAction : public clang::ASTFrontendAction { public: - virtual clang::ASTConsumer *CreateASTConsumer( + virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return new FindNamedClassConsumer(&Compiler.getASTContext()); + return std::unique_ptr<clang::ASTConsumer>( + new FindNamedClassConsumer(&Compiler.getASTContext())); } }; |