diff --git a/clang/docs/RAVFrontendAction.rst b/clang/docs/RAVFrontendAction.rst index e38276b432953..f6c46668fba3f 100644 --- a/clang/docs/RAVFrontendAction.rst +++ b/clang/docs/RAVFrontendAction.rst @@ -27,8 +27,7 @@ unit. public: virtual std::unique_ptr CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr( - new FindNamedClassConsumer); + return std::make_unique(); } }; @@ -114,8 +113,7 @@ freshly created FindNamedClassConsumer: virtual std::unique_ptr CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr( - new FindNamedClassConsumer(&Compiler.getASTContext())); + return std::make_unique(&Compiler.getASTContext()); } Now that the ASTContext is available in the RecursiveASTVisitor, we can @@ -189,8 +187,7 @@ Now we can combine all of the above into a small example program: public: virtual std::unique_ptr CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr( - new FindNamedClassConsumer(&Compiler.getASTContext())); + return std::make_unique(&Compiler.getASTContext()); } };