aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Option.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-09 19:19:01 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-09 19:19:01 +0000
commit22685f40dbb458c0ef18f5fec35f4f7cdb0886c9 (patch)
tree3f6e86664d7f4b117c7e23c7301c989c26e61bb8 /lib/Driver/Option.cpp
parent312a8b726e24078d3bd3b2328f9f895d1407cdb7 (diff)
Driver: Change Option parsing to always create arguments referring to unaliased
options. - This matches the intent of the .td files, and will simplify alias handling. - PR7321. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Option.cpp')
-rw-r--r--lib/Driver/Option.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp
index 5a967ea3df..d438c30b53 100644
--- a/lib/Driver/Option.cpp
+++ b/lib/Driver/Option.cpp
@@ -123,7 +123,7 @@ Arg *FlagOption::accept(const InputArgList &Args, unsigned &Index) const {
if (strlen(getName()) != strlen(Args.getArgString(Index)))
return 0;
- return new FlagArg(this, Index++);
+ return new FlagArg(getUnaliasedOption(), Index++);
}
JoinedOption::JoinedOption(OptSpecifier ID, const char *Name,
@@ -133,7 +133,7 @@ JoinedOption::JoinedOption(OptSpecifier ID, const char *Name,
Arg *JoinedOption::accept(const InputArgList &Args, unsigned &Index) const {
// Always matches.
- return new JoinedArg(this, Index++, strlen(getName()));
+ return new JoinedArg(getUnaliasedOption(), Index++, strlen(getName()));
}
CommaJoinedOption::CommaJoinedOption(OptSpecifier ID, const char *Name,
@@ -150,7 +150,7 @@ Arg *CommaJoinedOption::accept(const InputArgList &Args,
// Get the suffix string.
// FIXME: Avoid strlen, and move to helper method?
const char *Suffix = Args.getArgString(Index) + strlen(getName());
- return new CommaJoinedArg(this, Index++, Suffix);
+ return new CommaJoinedArg(getUnaliasedOption(), Index++, Suffix);
}
SeparateOption::SeparateOption(OptSpecifier ID, const char *Name,
@@ -168,7 +168,7 @@ Arg *SeparateOption::accept(const InputArgList &Args, unsigned &Index) const {
if (Index > Args.getNumInputArgStrings())
return 0;
- return new SeparateArg(this, Index - 2, 1);
+ return new SeparateArg(getUnaliasedOption(), Index - 2, 1);
}
MultiArgOption::MultiArgOption(OptSpecifier ID, const char *Name,
@@ -188,7 +188,7 @@ Arg *MultiArgOption::accept(const InputArgList &Args, unsigned &Index) const {
if (Index > Args.getNumInputArgStrings())
return 0;
- return new SeparateArg(this, Index - 1 - NumArgs, NumArgs);
+ return new SeparateArg(getUnaliasedOption(), Index - 1 - NumArgs, NumArgs);
}
JoinedOrSeparateOption::JoinedOrSeparateOption(OptSpecifier ID,
@@ -203,14 +203,14 @@ Arg *JoinedOrSeparateOption::accept(const InputArgList &Args,
// If this is not an exact match, it is a joined arg.
// FIXME: Avoid strlen.
if (strlen(getName()) != strlen(Args.getArgString(Index)))
- return new JoinedArg(this, Index++, strlen(getName()));
+ return new JoinedArg(getUnaliasedOption(), Index++, strlen(getName()));
// Otherwise it must be separate.
Index += 2;
if (Index > Args.getNumInputArgStrings())
return 0;
- return new SeparateArg(this, Index - 2, 1);
+ return new SeparateArg(getUnaliasedOption(), Index - 2, 1);
}
JoinedAndSeparateOption::JoinedAndSeparateOption(OptSpecifier ID,
@@ -228,6 +228,6 @@ Arg *JoinedAndSeparateOption::accept(const InputArgList &Args,
if (Index > Args.getNumInputArgStrings())
return 0;
- return new JoinedAndSeparateArg(this, Index - 2, strlen(getName()));
+ return new JoinedAndSeparateArg(getUnaliasedOption(), Index - 2,
+ strlen(getName()));
}
-