diff options
author | Eric Liu <ioeric@google.com> | 2017-03-15 08:41:00 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2017-03-15 08:41:00 +0000 |
commit | e51ee0668c8eec639964234a1d716e30f0449399 (patch) | |
tree | 6688a3660f133e71d912313b5ed2c222166a6ede /llvm/include/llvm/Support/CommandLine.h | |
parent | 654cb8263a3c3c8ec24285e260da3ab0a0c7abf0 (diff) | |
download | bcm5719-llvm-e51ee0668c8eec639964234a1d716e30f0449399.tar.gz bcm5719-llvm-e51ee0668c8eec639964234a1d716e30f0449399.zip |
[Support][CommandLine] Make it possible to get error messages from ParseCommandLineOptions when ignoring errors.
Summary:
Previously, ParseCommandLineOptions returns false and ignores error messages
when IgnoreErrors. It would be useful to also return error messages if users
decide to check parsing result instead of having the program exit on error.
Reviewers: chandlerc, mehdi_amini, rnk
Reviewed By: rnk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D30893
llvm-svn: 297810
Diffstat (limited to 'llvm/include/llvm/Support/CommandLine.h')
-rw-r--r-- | llvm/include/llvm/Support/CommandLine.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h index d1d698400df..ae32e20d6da 100644 --- a/llvm/include/llvm/Support/CommandLine.h +++ b/llvm/include/llvm/Support/CommandLine.h @@ -50,9 +50,12 @@ namespace cl { //===----------------------------------------------------------------------===// // ParseCommandLineOptions - Command line option processing entry point. // +// Returns true on success. Otherwise, this will print the error message to +// stderr and exit if \p Errs is not set (nullptr by default), or print the +// error message to \p Errs and return false if \p Errs is provided. bool ParseCommandLineOptions(int argc, const char *const *argv, StringRef Overview = "", - bool IgnoreErrors = false); + raw_ostream *Errs = nullptr); //===----------------------------------------------------------------------===// // ParseEnvironmentOptions - Environment variable option processing alternate |