[clang] 1c17252 - [NFC] Update comment in CommonOptionsParser to match documentation (#90441)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 30 06:07:24 PDT 2024
Author: Maxim Moskalets
Date: 2024-04-30T15:07:20+02:00
New Revision: 1c17252cf049e318695b94a7e8a1c7343452e8bf
URL: https://github.com/llvm/llvm-project/commit/1c17252cf049e318695b94a7e8a1c7343452e8bf
DIFF: https://github.com/llvm/llvm-project/commit/1c17252cf049e318695b94a7e8a1c7343452e8bf.diff
LOG: [NFC] Update comment in CommonOptionsParser to match documentation (#90441)
See https://clang.llvm.org/docs/LibTooling.html
Added:
Modified:
clang/include/clang/Tooling/CommonOptionsParser.h
Removed:
################################################################################
diff --git a/clang/include/clang/Tooling/CommonOptionsParser.h b/clang/include/clang/Tooling/CommonOptionsParser.h
index 3c0480af377943..5e2cdc6ac45894 100644
--- a/clang/include/clang/Tooling/CommonOptionsParser.h
+++ b/clang/include/clang/Tooling/CommonOptionsParser.h
@@ -49,17 +49,22 @@ namespace tooling {
/// using namespace clang::tooling;
/// using namespace llvm;
///
-/// static cl::OptionCategory MyToolCategory("My tool options");
+/// static cl::OptionCategory MyToolCategory("my-tool options");
/// static cl::extrahelp CommonHelp(CommonOptionsParser::HelpMessage);
/// static cl::extrahelp MoreHelp("\nMore help text...\n");
-/// static cl::opt<bool> YourOwnOption(...);
-/// ...
///
/// int main(int argc, const char **argv) {
-/// CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
+/// auto ExpectedParser =
+/// CommonOptionsParser::create(argc, argv, MyToolCategory);
+/// if (!ExpectedParser) {
+/// llvm::errs() << ExpectedParser.takeError();
+/// return 1;
+/// }
+/// CommonOptionsParser& OptionsParser = ExpectedParser.get();
/// ClangTool Tool(OptionsParser.getCompilations(),
/// OptionsParser.getSourcePathList());
-/// return Tool.run(newFrontendActionFactory<SyntaxOnlyAction>().get());
+/// return Tool.run(
+/// newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
/// }
/// \endcode
class CommonOptionsParser {
More information about the cfe-commits
mailing list