summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-ar/ArchiveWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-19 15:45:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-19 15:45:37 +0000
commit8417a7883bf6267ced8ad5369d74ab36372d4e79 (patch)
tree3924cdf5b95d1e160495bb7ab7e6c703f555909c /llvm/tools/llvm-ar/ArchiveWriter.cpp
parent1a3dc8576e512fcf740adddc726c1f92739e98ae (diff)
downloadbcm5719-llvm-8417a7883bf6267ced8ad5369d74ab36372d4e79.tar.gz
bcm5719-llvm-8417a7883bf6267ced8ad5369d74ab36372d4e79.zip
Reduce sys::Path usage in llvm-ar.
llvm-svn: 184315
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