[PATCH] D39042: [Tooling] Add a factory method for CommonOptionsParser
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 18 04:58:41 PDT 2017
hokein added inline comments.
================
Comment at: include/clang/Tooling/CommonOptionsParser.h:95
+ static llvm::Expected<std::unique_ptr<CommonOptionsParser>>
+ create(int &argc, const char **argv, llvm::cl::OptionCategory &Category,
----------------
worth some documentation?
================
Comment at: include/clang/Tooling/CommonOptionsParser.h:115
+
+ static llvm::Error init(int &argc, const char **argv,
+ llvm::cl::OptionCategory &Category,
----------------
We can get rid of the `static` here by calling `parser->init(XXX)`.
================
Comment at: lib/Tooling/CommonOptionsParser.cpp:165
+ const char *Overview) {
+ std::unique_ptr<CommonOptionsParser> Parser(new CommonOptionsParser);
+ llvm::Error Err =
----------------
nit: using llvm::make_unique.
https://reviews.llvm.org/D39042
More information about the cfe-commits
mailing list