diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 |
commit | 5ffd83dbcc34f10e07f6d3e968ae6365869615f4 (patch) | |
tree | 0e9f5cf729dde39f949698fddef45a34e2bc7f44 /contrib/llvm-project/llvm/lib/Option/OptTable.cpp | |
parent | 1799696096df87b52968b8996d00c91e0a5de8d9 (diff) | |
parent | cfca06d7963fa0909f90483b42a6d7d194d01e08 (diff) |
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Option/OptTable.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Option/OptTable.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/llvm-project/llvm/lib/Option/OptTable.cpp b/contrib/llvm-project/llvm/lib/Option/OptTable.cpp index 5833d03069f8..926eb8e0437f 100644 --- a/contrib/llvm-project/llvm/lib/Option/OptTable.cpp +++ b/contrib/llvm-project/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) && Arg.compare(Val)) - Result.push_back(Val); + Result.push_back(std::string(Val)); return Result; } return {}; @@ -283,10 +283,10 @@ unsigned OptTable::findNearest(StringRef Option, std::string &NearestString, StringRef LHS, RHS; char Last = CandidateName.back(); bool CandidateHasDelimiter = Last == '=' || Last == ':'; - std::string NormalizedName = Option; + std::string NormalizedName = std::string(Option); if (CandidateHasDelimiter) { std::tie(LHS, RHS) = Option.split(Last); - NormalizedName = LHS; + NormalizedName = std::string(LHS); if (Option.find(Last) == LHS.size()) NormalizedName += Last; } |