diff options
Diffstat (limited to 'lib/Driver/Option.cpp')
-rw-r--r-- | lib/Driver/Option.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp index 6f3c24fff3..26b30de17d 100644 --- a/lib/Driver/Option.cpp +++ b/lib/Driver/Option.cpp @@ -147,7 +147,7 @@ Arg *FlagOption::accept(const InputArgList &Args, unsigned &Index) const { if (strlen(getName()) != strlen(Args.getArgString(Index))) return 0; - return new Arg(this, Index++); + return new Arg(getUnaliasedOption(), Index++); } JoinedOption::JoinedOption(OptSpecifier ID, const char *Name, @@ -158,7 +158,7 @@ JoinedOption::JoinedOption(OptSpecifier ID, const char *Name, Arg *JoinedOption::accept(const InputArgList &Args, unsigned &Index) const { // Always matches. const char *Value = Args.getArgString(Index) + strlen(getName()); - return new Arg(this, Index++, Value); + return new Arg(getUnaliasedOption(), Index++, Value); } CommaJoinedOption::CommaJoinedOption(OptSpecifier ID, const char *Name, @@ -171,7 +171,7 @@ Arg *CommaJoinedOption::accept(const InputArgList &Args, unsigned &Index) const { // Always matches. const char *Str = Args.getArgString(Index) + strlen(getName()); - Arg *A = new Arg(this, Index++); + Arg *A = new Arg(getUnaliasedOption(), Index++); // Parse out the comma separated values. const char *Prev = Str; @@ -212,7 +212,7 @@ Arg *SeparateOption::accept(const InputArgList &Args, unsigned &Index) const { if (Index > Args.getNumInputArgStrings()) return 0; - return new Arg(this, Index - 2, Args.getArgString(Index - 1)); + return new Arg(getUnaliasedOption(), Index - 2, Args.getArgString(Index - 1)); } MultiArgOption::MultiArgOption(OptSpecifier ID, const char *Name, @@ -232,8 +232,8 @@ Arg *MultiArgOption::accept(const InputArgList &Args, unsigned &Index) const { if (Index > Args.getNumInputArgStrings()) return 0; - Arg *A = new Arg(this, Index - 1 - NumArgs, - Args.getArgString(Index - NumArgs)); + Arg *A = new Arg(getUnaliasedOption(), Index - 1 - NumArgs, + Args.getArgString(Index - NumArgs)); for (unsigned i = 1; i != NumArgs; ++i) A->getValues().push_back(Args.getArgString(Index - NumArgs + i)); return A; @@ -260,7 +260,7 @@ Arg *JoinedOrSeparateOption::accept(const InputArgList &Args, if (Index > Args.getNumInputArgStrings()) return 0; - return new Arg(this, Index - 2, Args.getArgString(Index - 1)); + return new Arg(getUnaliasedOption(), Index - 2, Args.getArgString(Index - 1)); } JoinedAndSeparateOption::JoinedAndSeparateOption(OptSpecifier ID, @@ -278,6 +278,7 @@ Arg *JoinedAndSeparateOption::accept(const InputArgList &Args, if (Index > Args.getNumInputArgStrings()) return 0; - return new Arg(this, Index - 2, Args.getArgString(Index-2)+strlen(getName()) - , Args.getArgString(Index-1)); + return new Arg(getUnaliasedOption(), Index - 2, + Args.getArgString(Index-2)+strlen(getName()), + Args.getArgString(Index-1)); } |