aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/include/clang/Tooling/CommonOptionsParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/Tooling/CommonOptionsParser.h')
-rw-r--r--contrib/llvm-project/clang/include/clang/Tooling/CommonOptionsParser.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/contrib/llvm-project/clang/include/clang/Tooling/CommonOptionsParser.h b/contrib/llvm-project/clang/include/clang/Tooling/CommonOptionsParser.h
index a5bfeeeaf77f..3c0480af3779 100644
--- a/contrib/llvm-project/clang/include/clang/Tooling/CommonOptionsParser.h
+++ b/contrib/llvm-project/clang/include/clang/Tooling/CommonOptionsParser.h
@@ -63,21 +63,8 @@ namespace tooling {
/// }
/// \endcode
class CommonOptionsParser {
-public:
- /// Parses command-line, initializes a compilation database.
- ///
- /// This constructor can change argc and argv contents, e.g. consume
- /// command-line options used for creating FixedCompilationDatabase.
- ///
- /// All options not belonging to \p Category become hidden.
- ///
- /// This constructor exits program in case of error.
- CommonOptionsParser(int &argc, const char **argv,
- llvm::cl::OptionCategory &Category,
- const char *Overview = nullptr)
- : CommonOptionsParser(argc, argv, Category, llvm::cl::OneOrMore,
- Overview) {}
+protected:
/// Parses command-line, initializes a compilation database.
///
/// This constructor can change argc and argv contents, e.g. consume
@@ -86,16 +73,17 @@ public:
/// All options not belonging to \p Category become hidden.
///
/// It also allows calls to set the required number of positional parameters.
- CommonOptionsParser(int &argc, const char **argv,
- llvm::cl::OptionCategory &Category,
- llvm::cl::NumOccurrencesFlag OccurrencesFlag,
- const char *Overview = nullptr);
+ CommonOptionsParser(
+ int &argc, const char **argv, llvm::cl::OptionCategory &Category,
+ llvm::cl::NumOccurrencesFlag OccurrencesFlag = llvm::cl::OneOrMore,
+ const char *Overview = nullptr);
+public:
/// A factory method that is similar to the above constructor, except
/// this returns an error instead exiting the program on error.
static llvm::Expected<CommonOptionsParser>
create(int &argc, const char **argv, llvm::cl::OptionCategory &Category,
- llvm::cl::NumOccurrencesFlag OccurrencesFlag,
+ llvm::cl::NumOccurrencesFlag OccurrencesFlag = llvm::cl::OneOrMore,
const char *Overview = nullptr);
/// Returns a reference to the loaded compilations database.
@@ -153,4 +141,4 @@ private:
} // namespace tooling
} // namespace clang
-#endif // LLVM_TOOLS_CLANG_INCLUDE_CLANG_TOOLING_COMMONOPTIONSPARSER_H
+#endif // LLVM_CLANG_TOOLING_COMMONOPTIONSPARSER_H