Reduce sys::Path usage in llvm-ar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184315 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-06-19 15:45:37 +00:00
parent 7c8397081c
commit 4d07abbb01
5 changed files with 39 additions and 35 deletions

View File

@@ -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<MemoryBuffer> 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;