diff options
Diffstat (limited to 'llvm/lib/Option/Option.cpp')
| -rw-r--r-- | llvm/lib/Option/Option.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Option/Option.cpp b/llvm/lib/Option/Option.cpp index 9abc9fdce4c7..68d074b2702e 100644 --- a/llvm/lib/Option/Option.cpp +++ b/llvm/lib/Option/Option.cpp @@ -106,9 +106,9 @@ bool Option::matches(OptSpecifier Opt) const { return false; } -Arg *Option::acceptInternal(const ArgList &Args, unsigned &Index, - unsigned ArgSize) const { - StringRef Spelling = StringRef(Args.getArgString(Index), ArgSize); +Arg *Option::acceptInternal(const ArgList &Args, StringRef Spelling, + unsigned &Index) const { + size_t ArgSize = Spelling.size(); switch (getKind()) { case FlagClass: { if (ArgSize != strlen(Args.getArgString(Index))) @@ -230,10 +230,11 @@ Arg *Option::acceptInternal(const ArgList &Args, unsigned &Index, } } -Arg *Option::accept(const ArgList &Args, - unsigned &Index, - unsigned ArgSize) const { - std::unique_ptr<Arg> A(acceptInternal(Args, Index, ArgSize)); +Arg *Option::accept(const ArgList &Args, StringRef CurArg, + bool GroupedShortOption, unsigned &Index) const { + std::unique_ptr<Arg> A(GroupedShortOption && getKind() == FlagClass + ? new Arg(*this, CurArg, Index) + : acceptInternal(Args, CurArg, Index)); if (!A) return nullptr; |
