diff options
Diffstat (limited to 'contrib/llvm-project/llvm/tools/llvm-lto/llvm-lto.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/tools/llvm-lto/llvm-lto.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/tools/llvm-lto/llvm-lto.cpp b/contrib/llvm-project/llvm/tools/llvm-lto/llvm-lto.cpp index 79e9d93061a2..51921d44d748 100644 --- a/contrib/llvm-project/llvm/tools/llvm-lto/llvm-lto.cpp +++ b/contrib/llvm-project/llvm/tools/llvm-lto/llvm-lto.cpp @@ -516,11 +516,10 @@ static void getThinLTOOldAndNewPrefix(std::string &OldPrefix, /// Given the original \p Path to an output file, replace any path /// prefix matching \p OldPrefix with \p NewPrefix. Also, create the /// resulting directory if it does not yet exist. -static std::string getThinLTOOutputFile(const std::string &Path, - const std::string &OldPrefix, - const std::string &NewPrefix) { +static std::string getThinLTOOutputFile(StringRef Path, StringRef OldPrefix, + StringRef NewPrefix) { if (OldPrefix.empty() && NewPrefix.empty()) - return Path; + return std::string(Path); SmallString<128> NewPath(Path); llvm::sys::path::replace_path_prefix(NewPath, OldPrefix, NewPrefix); StringRef ParentPath = llvm::sys::path::parent_path(NewPath.str()); |