[libObject][NFC] Use sys::path::convert_to_slash.

Summary: As suggested in rL353995

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58298

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jordan Rupprecht
2019-02-19 18:14:44 +00:00
parent 049e568f3c
commit 463cb21190
+1 -5
View File
@@ -514,13 +514,9 @@ std::string computeArchiveRelativePath(StringRef From, StringRef To) {
for (auto ToE = sys::path::end(To); ToI != ToE; ++ToI)
sys::path::append(Relative, *ToI);
#ifdef _WIN32
// Replace backslashes with slashes so that the path is portable between *nix
// and Windows.
std::replace(Relative.begin(), Relative.end(), '\\', '/');
#endif
return Relative.str();
return sys::path::convert_to_slash(Relative);
}
Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,