summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Option/OptTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Option/OptTable.cpp')
-rw-r--r--llvm/lib/Option/OptTable.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index dcd1cc46d96..5956764827e 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -219,7 +219,7 @@ OptTable::suggestValueCompletions(StringRef Option, StringRef Arg) const {
std::vector<std::string> Result;
for (StringRef Val : Candidates)
- if (Val.startswith(Arg))
+ if (Val.startswith(Arg) && Arg.compare(Val))
Result.push_back(Val);
return Result;
}
@@ -240,7 +240,7 @@ OptTable::findByPrefix(StringRef Cur, unsigned short DisableFlags) const {
std::string S = std::string(In.Prefixes[I]) + std::string(In.Name) + "\t";
if (In.HelpText)
S += In.HelpText;
- if (StringRef(S).startswith(Cur))
+ if (StringRef(S).startswith(Cur) && S.compare(std::string(Cur) + "\t"))
Ret.push_back(S);
}
}
OpenPOWER on IntegriCloud