summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Option/OptTable.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2013-08-13 21:09:50 +0000
committerHans Wennborg <hans@hanshq.net>2013-08-13 21:09:50 +0000
commitd505fbf40376dd7ace0ef50e794a840f54091586 (patch)
tree9a547901540e3b2ccf0e03a4788fdb87ab590673 /llvm/lib/Option/OptTable.cpp
parent3a2c2d42b85b657535dfb39e811045403ccdd195 (diff)
downloadbcm5719-llvm-d505fbf40376dd7ace0ef50e794a840f54091586.tar.gz
bcm5719-llvm-d505fbf40376dd7ace0ef50e794a840f54091586.zip
Options: Add new option kind that consumes remaining arguments
This adds KIND_REMAINING_ARGS, a class of options that consume all remaining arguments on the command line. This will be used to support /link in clang-cl, which is used to forward all remaining arguments to the linker. It also allows us to remove the hard-coded handling of "--", allowing clients (clang and lld) to implement that functionality themselves with this new option class. Differential Revision: http://llvm-reviews.chandlerc.com/D1387 llvm-svn: 188314
Diffstat (limited to 'llvm/lib/Option/OptTable.cpp')
-rw-r--r--llvm/lib/Option/OptTable.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index 98e63bc2de9..650aec8a678 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -259,6 +259,8 @@ InputArgList *OptTable::ParseArgs(const char *const *ArgBegin,
continue;
}
+ // FIXME: Remove once clients are updated to use a KIND_REMAINING_ARGS
+ // option to handle this explicitly instead.
if (Str == "--") {
// Everything after -- is a filename.
++Index;
@@ -308,6 +310,7 @@ static std::string getOptionHelpName(const OptTable &Opts, OptSpecifier Id) {
break;
case Option::SeparateClass: case Option::JoinedOrSeparateClass:
+ case Option::RemainingArgsClass:
Name += ' ';
// FALLTHROUGH
case Option::JoinedClass: case Option::CommaJoinedClass:
OpenPOWER on IntegriCloud