summaryrefslogtreecommitdiff
path: root/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
commitaf9e3557552c341615052a05d4eeb36d7fd5c33f (patch)
tree4849f2d2fea5491ad0421600d01edbd9cd2e05c5 /lib/Option/OptTable.cpp
parent3f70e908c3d9de7acea462719ebf36dca1560f9c (diff)
downloadllvm-af9e3557552c341615052a05d4eeb36d7fd5c33f.tar.gz
llvm-af9e3557552c341615052a05d4eeb36d7fd5c33f.tar.bz2
llvm-af9e3557552c341615052a05d4eeb36d7fd5c33f.tar.xz
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Option/OptTable.cpp')
-rw-r--r--lib/Option/OptTable.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Option/OptTable.cpp b/lib/Option/OptTable.cpp
index 98e63bc2de..650aec8a67 100644
--- a/lib/Option/OptTable.cpp
+++ b/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: