diff options
Diffstat (limited to 'llvm/lib/Option/OptTable.cpp')
-rw-r--r-- | llvm/lib/Option/OptTable.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp index 11439d3e56f..98e63bc2de9 100644 --- a/llvm/lib/Option/OptTable.cpp +++ b/llvm/lib/Option/OptTable.cpp @@ -253,11 +253,26 @@ InputArgList *OptTable::ParseArgs(const char *const *ArgBegin, unsigned Index = 0, End = ArgEnd - ArgBegin; while (Index < End) { // Ignore empty arguments (other things may still take them as arguments). - if (Args->getArgString(Index)[0] == '\0') { + StringRef Str = Args->getArgString(Index); + if (Str == "") { ++Index; continue; } + if (Str == "--") { + // Everything after -- is a filename. + ++Index; + + assert(TheInputOptionID != 0 && "Invalid input option ID."); + while (Index < End) { + Args->append(new Arg(getOption(TheInputOptionID), + Args->getArgString(Index), Index, + Args->getArgString(Index))); + ++Index; + } + break; + } + unsigned Prev = Index; Arg *A = ParseOneArg(*Args, Index, FlagsToInclude, FlagsToExclude); assert(Index > Prev && "Parser failed to consume argument."); |