[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

llvm-svn: 354364
This commit is contained in:
Jordan Rupprecht 2019-02-19 18:14:44 +00:00
parent 0b3b9424ca
commit d138b1266a
1 changed files with 1 additions and 5 deletions

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,