Mercurial > hg > CbC > CbC_llvm
diff lib/Option/Option.cpp @ 120:1172e4bd9c6f
update 4.0.0
author | mir3636 |
---|---|
date | Fri, 25 Nov 2016 19:14:25 +0900 |
parents | 7d135dc70f03 |
children | 803732b1fca8 |
line wrap: on
line diff
--- a/lib/Option/Option.cpp Tue Jan 26 22:56:36 2016 +0900 +++ b/lib/Option/Option.cpp Fri Nov 25 19:14:25 2016 +0900 @@ -51,6 +51,7 @@ P(JoinedOrSeparateClass); P(JoinedAndSeparateClass); P(RemainingArgsClass); + P(RemainingArgsJoinedClass); #undef P } @@ -82,7 +83,7 @@ O << ">\n"; } -void Option::dump() const { print(dbgs()); } +LLVM_DUMP_METHOD void Option::dump() const { print(dbgs()); } bool Option::matches(OptSpecifier Opt) const { // Aliases are never considered in matching, look through them. @@ -234,6 +235,19 @@ A->getValues().push_back(Args.getArgString(Index++)); return A; } + case RemainingArgsJoinedClass: { + Arg *A = new Arg(UnaliasedOption, Spelling, Index); + if (ArgSize != strlen(Args.getArgString(Index))) { + // An inexact match means there is a joined arg. + A->getValues().push_back(Args.getArgString(Index) + ArgSize); + } + Index++; + while (Index < Args.getNumInputArgStrings() && + Args.getArgString(Index) != nullptr) + A->getValues().push_back(Args.getArgString(Index++)); + return A; + } + default: llvm_unreachable("Invalid option kind!"); }