summaryrefslogtreecommitdiffstats
path: root/lib/Driver/Option.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-07-17 15:40:56 +0000
committerdim <dim@FreeBSD.org>2011-07-17 15:40:56 +0000
commit611ba3ea3300b71eb95dc4e45f20eee5dddd32e1 (patch)
tree2097d084eb235c0b12c0bff3445f4ec7bbaa8a12 /lib/Driver/Option.cpp
parentc49018d9cce52d8c9f34b44865ec3ba8e89a1488 (diff)
downloadFreeBSD-src-611ba3ea3300b71eb95dc4e45f20eee5dddd32e1.zip
FreeBSD-src-611ba3ea3300b71eb95dc4e45f20eee5dddd32e1.tar.gz
Vendor import of clang trunk r135360:
http://llvm.org/svn/llvm-project/cfe/trunk@135360
Diffstat (limited to 'lib/Driver/Option.cpp')
-rw-r--r--lib/Driver/Option.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp
index a992cef..90d21a3 100644
--- a/lib/Driver/Option.cpp
+++ b/lib/Driver/Option.cpp
@@ -144,7 +144,7 @@ FlagOption::FlagOption(OptSpecifier ID, const char *Name,
Arg *FlagOption::accept(const ArgList &Args, unsigned &Index) const {
// Matches iff this is an exact match.
// FIXME: Avoid strlen.
- if (strlen(getName()) != strlen(Args.getArgString(Index)))
+ if (getName().size() != strlen(Args.getArgString(Index)))
return 0;
return new Arg(getUnaliasedOption(), Index++);
@@ -157,7 +157,7 @@ JoinedOption::JoinedOption(OptSpecifier ID, const char *Name,
Arg *JoinedOption::accept(const ArgList &Args, unsigned &Index) const {
// Always matches.
- const char *Value = Args.getArgString(Index) + strlen(getName());
+ const char *Value = Args.getArgString(Index) + getName().size();
return new Arg(getUnaliasedOption(), Index++, Value);
}
@@ -170,7 +170,7 @@ CommaJoinedOption::CommaJoinedOption(OptSpecifier ID, const char *Name,
Arg *CommaJoinedOption::accept(const ArgList &Args,
unsigned &Index) const {
// Always matches.
- const char *Str = Args.getArgString(Index) + strlen(getName());
+ const char *Str = Args.getArgString(Index) + getName().size();
Arg *A = new Arg(getUnaliasedOption(), Index++);
// Parse out the comma separated values.
@@ -205,7 +205,7 @@ SeparateOption::SeparateOption(OptSpecifier ID, const char *Name,
Arg *SeparateOption::accept(const ArgList &Args, unsigned &Index) const {
// Matches iff this is an exact match.
// FIXME: Avoid strlen.
- if (strlen(getName()) != strlen(Args.getArgString(Index)))
+ if (getName().size() != strlen(Args.getArgString(Index)))
return 0;
Index += 2;
@@ -225,7 +225,7 @@ MultiArgOption::MultiArgOption(OptSpecifier ID, const char *Name,
Arg *MultiArgOption::accept(const ArgList &Args, unsigned &Index) const {
// Matches iff this is an exact match.
// FIXME: Avoid strlen.
- if (strlen(getName()) != strlen(Args.getArgString(Index)))
+ if (getName().size() != strlen(Args.getArgString(Index)))
return 0;
Index += 1 + NumArgs;
@@ -250,8 +250,8 @@ Arg *JoinedOrSeparateOption::accept(const ArgList &Args,
unsigned &Index) const {
// If this is not an exact match, it is a joined arg.
// FIXME: Avoid strlen.
- if (strlen(getName()) != strlen(Args.getArgString(Index))) {
- const char *Value = Args.getArgString(Index) + strlen(getName());
+ if (getName().size() != strlen(Args.getArgString(Index))) {
+ const char *Value = Args.getArgString(Index) + getName().size();
return new Arg(this, Index++, Value);
}
@@ -279,6 +279,6 @@ Arg *JoinedAndSeparateOption::accept(const ArgList &Args,
return 0;
return new Arg(getUnaliasedOption(), Index - 2,
- Args.getArgString(Index-2)+strlen(getName()),
+ Args.getArgString(Index-2)+getName().size(),
Args.getArgString(Index-1));
}
OpenPOWER on IntegriCloud