diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-12-07 20:22:27 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-12-07 20:22:27 +0000 |
| commit | 63d064e9d15d48648da916749f44b4c8f013755e (patch) | |
| tree | 0734fec65e5082d99ac616e6ba4021ebbf7b1763 /lld/ELF/InputFiles.cpp | |
| parent | 8b8f74f6b7f3d1d82a50b36a0257ba0af6fe2322 (diff) | |
Make convertToUnixPathSeparator return a new string instead of mutating argument.
llvm-svn: 288972
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 92b1439f9390..ac717f436d71 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -91,9 +91,8 @@ std::string elf::ObjectFile<ELFT>::getLineInfo(InputSectionBase<ELFT> *S, DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info); if (Info.Line == 0) return ""; - std::string Ret = Info.FileName + ":" + std::to_string(Info.Line); - convertToUnixPathSeparator({(char *)Ret.data(), Ret.size()}); - return Ret; + return convertToUnixPathSeparator( + Info.FileName + ":" + std::to_string(Info.Line)); } // Returns "(internal)", "foo.a(bar.o)" or "baz.o". |
