This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2da4ceec936e: [docs] Use make_unique in FrontendAction example (authored by nicolas17, committed by thakis).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93185/new/ https://reviews.llvm.org/D93185 Files: clang/docs/RAVFrontendAction.rst Index: clang/docs/RAVFrontendAction.rst =================================================================== --- clang/docs/RAVFrontendAction.rst +++ clang/docs/RAVFrontendAction.rst @@ -27,8 +27,7 @@ public: virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr<clang::ASTConsumer>( - new FindNamedClassConsumer); + return std::make_unique<FindNamedClassConsumer>(); } }; @@ -114,8 +113,7 @@ virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr<clang::ASTConsumer>( - new FindNamedClassConsumer(&Compiler.getASTContext())); + return std::make_unique<FindNamedClassConsumer>(&Compiler.getASTContext()); } Now that the ASTContext is available in the RecursiveASTVisitor, we can @@ -189,8 +187,7 @@ public: virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr<clang::ASTConsumer>( - new FindNamedClassConsumer(&Compiler.getASTContext())); + return std::make_unique<FindNamedClassConsumer>(&Compiler.getASTContext()); } };
Index: clang/docs/RAVFrontendAction.rst =================================================================== --- clang/docs/RAVFrontendAction.rst +++ clang/docs/RAVFrontendAction.rst @@ -27,8 +27,7 @@ public: virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr<clang::ASTConsumer>( - new FindNamedClassConsumer); + return std::make_unique<FindNamedClassConsumer>(); } }; @@ -114,8 +113,7 @@ virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr<clang::ASTConsumer>( - new FindNamedClassConsumer(&Compiler.getASTContext())); + return std::make_unique<FindNamedClassConsumer>(&Compiler.getASTContext()); } Now that the ASTContext is available in the RecursiveASTVisitor, we can @@ -189,8 +187,7 @@ public: virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer( clang::CompilerInstance &Compiler, llvm::StringRef InFile) { - return std::unique_ptr<clang::ASTConsumer>( - new FindNamedClassConsumer(&Compiler.getASTContext())); + return std::make_unique<FindNamedClassConsumer>(&Compiler.getASTContext()); } };
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits