Index: llvm/trunk/lib/Object/ArchiveWriter.cpp =================================================================== --- llvm/trunk/lib/Object/ArchiveWriter.cpp +++ llvm/trunk/lib/Object/ArchiveWriter.cpp @@ -514,13 +514,9 @@ 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,