Skip to content

Commit

Permalink
[libObject][NFC] Use sys::path::convert_to_slash.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rupprecht committed Feb 19, 2019
1 parent 0b3b942 commit d138b12
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions llvm/lib/Object/ArchiveWriter.cpp
Expand Up @@ -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,
Expand Down

0 comments on commit d138b12

Please sign in to comment.