Skip to content
Snippets Groups Projects
Commit 1183ce58 authored by Nick Lewycky's avatar Nick Lewycky
Browse files

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
parent c1447467
No related branches found
No related tags found
No related merge requests found
......@@ -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()));
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment