summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-ar/ArchiveWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-ar/ArchiveWriter.cpp')
-rw-r--r--llvm/tools/llvm-ar/ArchiveWriter.cpp9
1 files changed, 5 insertions, 4 deletions
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<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;
OpenPOWER on IntegriCloud