summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-20 18:42:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-20 18:42:04 +0000
commit29c17db6508eec1c7c9fb23f3ce863d5ed9bef0e (patch)
tree56cd6dbfb7949281db6828ba10c81c3a6c4fcf69 /tools
parenta1694e578492c90c246e59ec861c1a34f8ad7b4d (diff)
downloadllvm-29c17db6508eec1c7c9fb23f3ce863d5ed9bef0e.tar.gz
llvm-29c17db6508eec1c7c9fb23f3ce863d5ed9bef0e.tar.bz2
llvm-29c17db6508eec1c7c9fb23f3ce863d5ed9bef0e.tar.xz
Add support for getting the last modification time from a file_status.
Use that in llvm-ar.cpp to replace a use of sys::PathWithStatus. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-ar/llvm-ar.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index 4c986715ae..e422f310c6 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/tools/llvm-ar/llvm-ar.cpp
@@ -583,15 +583,14 @@ doReplaceOrInsert(std::string* ErrMsg) {
}
if (found != remaining.end()) {
- std::string Err;
- sys::PathWithStatus PwS(*found);
- const sys::FileStatus *si = PwS.getFileStatus(false, &Err);
- if (!si)
+ sys::fs::file_status Status;
+ error_code EC = sys::fs::status(*found, Status);
+ if (EC)
return true;
- if (!si->isDir) {
+ if (!sys::fs::is_directory(Status)) {
if (OnlyUpdate) {
// Replace the item only if it is newer.
- if (si->modTime > I->getModTime())
+ if (Status.getLastModificationTime() > I->getModTime())
if (I->replaceWith(*found, ErrMsg))
return true;
} else {