summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-03-25 07:30:21 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-03-25 07:30:21 +0000
commit1e39ef331b2b78baec84fdb577d497511cc46bd5 (patch)
treed28c8b790d98974a23b21dec1debe4fc43084070 /llvm/lib/Support/Unix
parent3db6ae035abe27aa44b19d02ed7678adf53f18d2 (diff)
downloadbcm5719-llvm-1e39ef331b2b78baec84fdb577d497511cc46bd5.tar.gz
bcm5719-llvm-1e39ef331b2b78baec84fdb577d497511cc46bd5.zip
Add lastAccessedTime to file_status
Differential Revision: http://reviews.llvm.org/D18456 This is a re-commit of r264387 and r264388 after fixing a typo. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264392
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r--llvm/lib/Support/Unix/Path.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index d5a31ca000c..a80e0ddb8a1 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -174,6 +174,12 @@ std::string getMainExecutable(const char *argv0, void *MainAddr) {
return "";
}
+TimeValue file_status::getLastAccessedTime() const {
+ TimeValue Ret;
+ Ret.fromEpochTime(fs_st_atime);
+ return Ret;
+}
+
TimeValue file_status::getLastModificationTime() const {
TimeValue Ret;
Ret.fromEpochTime(fs_st_mtime);
@@ -373,8 +379,9 @@ static std::error_code fillStatus(int StatRet, const struct stat &Status,
perms Perms = static_cast<perms>(Status.st_mode);
Result =
- file_status(Type, Perms, Status.st_dev, Status.st_ino, Status.st_mtime,
- Status.st_uid, Status.st_gid, Status.st_size);
+ file_status(Type, Perms, Status.st_dev, Status.st_ino, Status.st_atime,
+ Status.st_mtime, Status.st_uid, Status.st_gid,
+ Status.st_size);
return std::error_code();
}
OpenPOWER on IntegriCloud