summaryrefslogtreecommitdiff
path: root/tools/llvm-ar
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-20 22:02:10 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-20 22:02:10 +0000
commitbdae6fa82ce92c0782dc291fb75e207398a26c68 (patch)
tree44fe2f1e5d5b13bcee91debfa34f0709456eb9b7 /tools/llvm-ar
parent4010e438100fedeacd36ecd2385adabc02b6f236 (diff)
downloadllvm-bdae6fa82ce92c0782dc291fb75e207398a26c68.tar.gz
llvm-bdae6fa82ce92c0782dc291fb75e207398a26c68.tar.bz2
llvm-bdae6fa82ce92c0782dc291fb75e207398a26c68.tar.xz
Remove last use of PathV1.h from Archive.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r--tools/llvm-ar/Archive.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/tools/llvm-ar/Archive.cpp b/tools/llvm-ar/Archive.cpp
index 520e410e1a..8d21481b57 100644
--- a/tools/llvm-ar/Archive.cpp
+++ b/tools/llvm-ar/Archive.cpp
@@ -18,7 +18,6 @@
#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PathV1.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/system_error.h"
#include <cstring>
@@ -109,15 +108,21 @@ bool ArchiveMember::replaceWith(StringRef newFile, std::string* ErrMsg) {
if (!signature) {
sys::fs::get_magic(path, magic.capacity(), magic);
signature = magic.c_str();
- sys::PathWithStatus PWS(path);
- const sys::FileStatus *FSinfo = PWS.getFileStatus(false, ErrMsg);
- if (!FSinfo)
+
+ sys::fs::file_status Status;
+ error_code EC = sys::fs::status(path, Status);
+ if (EC)
+ return true;
+
+ User = Status.getUser();
+ Group = Status.getGroup();
+ Mode = Status.permissions();
+ ModTime = Status.getLastModificationTime();
+
+ // FIXME: On posix this is a second stat.
+ EC = sys::fs::file_size(path, Size);
+ if (EC)
return true;
- User = FSinfo->getUser();
- Group = FSinfo->getGroup();
- Mode = FSinfo->getMode();
- ModTime = FSinfo->getTimestamp();
- Size = FSinfo->getSize();
}
// Determine what kind of file it is.