From d138b1266a6a8852641d7dd505900c938ee04c1f Mon Sep 17 00:00:00 2001 From: Jordan Rupprecht Date: Tue, 19 Feb 2019 18:14:44 +0000 Subject: [PATCH] [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 --- llvm/lib/Object/ArchiveWriter.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp index 4116ed4628eb..1092b9d5c2ae 100644 --- a/llvm/lib/Object/ArchiveWriter.cpp +++ b/llvm/lib/Object/ArchiveWriter.cpp @@ -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 NewMembers,