summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2014-10-22 23:57:14 +0000
committerNick Lewycky <nicholas@mxc.ca>2014-10-22 23:57:14 +0000
commitd935be3568213b56e4d243e90bcdba28bb2d7124 (patch)
treeecab413c6798eb30fccad95efb5e03adce350374
parent5974ee637e437e07990119181fbe4ba5955c178c (diff)
downloadbcm5719-llvm-d935be3568213b56e4d243e90bcdba28bb2d7124.tar.gz
bcm5719-llvm-d935be3568213b56e4d243e90bcdba28bb2d7124.zip
Update the documentation for API change to CreateASTConsumer the rest of the way.
llvm-svn: 220450
-rw-r--r--clang/docs/RAVFrontendAction.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/docs/RAVFrontendAction.rst b/clang/docs/RAVFrontendAction.rst
index 288a91d36cb..ec5d5d54ff9 100644
--- a/clang/docs/RAVFrontendAction.rst
+++ b/clang/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()));
}
};
OpenPOWER on IntegriCloud