From 8417a7883bf6267ced8ad5369d74ab36372d4e79 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 19 Jun 2013 15:45:37 +0000 Subject: Reduce sys::Path usage in llvm-ar. llvm-svn: 184315 --- llvm/tools/llvm-ar/ArchiveWriter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'llvm/tools/llvm-ar/ArchiveWriter.cpp') diff --git a/llvm/tools/llvm-ar/ArchiveWriter.cpp b/llvm/tools/llvm-ar/ArchiveWriter.cpp index 24f5dbc0dc1..16e748469f0 100644 --- a/llvm/tools/llvm-ar/ArchiveWriter.cpp +++ b/llvm/tools/llvm-ar/ArchiveWriter.cpp @@ -166,8 +166,9 @@ Archive::addFileBefore(const sys::Path& filePath, iterator where, ArchiveMember* mbr = new ArchiveMember(this); mbr->data = 0; - mbr->path = filePath; - const sys::FileStatus *FSInfo = mbr->path.getFileStatus(false, ErrMsg); + mbr->path = filePath.str(); + sys::PathWithStatus PWS(mbr->path); + const sys::FileStatus *FSInfo = PWS.getFileStatus(false, ErrMsg); if (!FSInfo) { delete mbr; return true; @@ -182,7 +183,7 @@ Archive::addFileBefore(const sys::Path& filePath, iterator where, flags |= ArchiveMember::HasLongFilenameFlag; sys::fs::file_magic type; - if (sys::fs::identify_magic(mbr->path.str(), type)) + if (sys::fs::identify_magic(mbr->path, type)) type = sys::fs::file_magic::unknown; switch (type) { case sys::fs::file_magic::bitcode: @@ -216,7 +217,7 @@ Archive::writeMember( MemoryBuffer *mFile = 0; if (!data) { OwningPtr File; - if (error_code ec = MemoryBuffer::getFile(member.getPath().c_str(), File)) { + if (error_code ec = MemoryBuffer::getFile(member.getPath(), File)) { if (ErrMsg) *ErrMsg = ec.message(); return true; -- cgit v1.2.3