aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/OptTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Driver/OptTable.cpp')
-rw-r--r--lib/Driver/OptTable.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp
index 257f3537a1..e108106fa7 100644
--- a/lib/Driver/OptTable.cpp
+++ b/lib/Driver/OptTable.cpp
@@ -159,10 +159,11 @@ Arg *OptTable::ParseOneArg(const ArgList &Args, unsigned &Index) const {
// FIXME: This is searching much more than necessary, but I am
// blanking on the simplest way to make it fast. We can solve this
// problem when we move to TableGen.
+ StringRef StrRef(Str);
for (; Start != End; ++Start) {
// Scan for first option which is a proper prefix.
for (; Start != End; ++Start)
- if (strncmp(Str, Start->Name, strlen(Start->Name)) == 0)
+ if (StrRef.startswith(Start->Name))
break;
if (Start == End)
break;