diff options
author | Joel E. Denny <jdenny.ornl@gmail.com> | 2018-11-06 22:07:03 +0000 |
---|---|---|
committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2018-11-06 22:07:03 +0000 |
commit | 24994d77b8178f4c65dd4ef9c82748d337a48f2f (patch) | |
tree | 68d8d4705a00a596777be30ffc2b4649fd621ec1 /llvm/include/llvm/Support/CommandLine.h | |
parent | c3ad28d5e81ae9be0bf18b5c31065777dc2af66f (diff) | |
download | bcm5719-llvm-24994d77b8178f4c65dd4ef9c82748d337a48f2f.tar.gz bcm5719-llvm-24994d77b8178f4c65dd4ef9c82748d337a48f2f.zip |
[FileCheck] Parse command-line options from FILECHECK_OPTS
This feature makes it easy to tune FileCheck diagnostic output when
running the test suite via ninja, a bot, or an IDE. For example:
```
$ FILECHECK_OPTS='-color -v -dump-input-on-failure' \
LIT_FILTER='OpenMP/for_codegen.cpp' ninja check-clang \
| less -R
```
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D53517
llvm-svn: 346272
Diffstat (limited to 'llvm/include/llvm/Support/CommandLine.h')
-rw-r--r-- | llvm/include/llvm/Support/CommandLine.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h index 799b41fbf8b..cd3543c130e 100644 --- a/llvm/include/llvm/Support/CommandLine.h +++ b/llvm/include/llvm/Support/CommandLine.h @@ -56,9 +56,18 @@ namespace cl { // 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. +// +// If EnvVar is not nullptr, command-line options are also parsed from the +// environment variable named by EnvVar. Precedence is given to occurrences +// from argv. This precedence is currently implemented by parsing argv after +// the environment variable, so it is only implemented correctly for options +// that give precedence to later occurrences. If your program supports options +// that give precedence to earlier occurrences, you will need to extend this +// function to support it correctly. bool ParseCommandLineOptions(int argc, const char *const *argv, StringRef Overview = "", - raw_ostream *Errs = nullptr); + raw_ostream *Errs = nullptr, + const char *EnvVar = nullptr); //===----------------------------------------------------------------------===// // ParseEnvironmentOptions - Environment variable option processing alternate |