diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 18:42:04 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 18:42:04 +0000 |
commit | 29c17db6508eec1c7c9fb23f3ce863d5ed9bef0e (patch) | |
tree | 56cd6dbfb7949281db6828ba10c81c3a6c4fcf69 /lib | |
parent | a1694e578492c90c246e59ec861c1a34f8ad7b4d (diff) | |
download | llvm-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 'lib')
-rw-r--r-- | lib/Support/Unix/PathV2.inc | 7 | ||||
-rw-r--r-- | lib/Support/Windows/PathV2.inc | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc index 39b33123de..4b922da718 100644 --- a/lib/Support/Unix/PathV2.inc +++ b/lib/Support/Unix/PathV2.inc @@ -110,6 +110,12 @@ namespace llvm { namespace sys { namespace fs { +TimeValue file_status::getLastModificationTime() { + TimeValue Ret; + Ret.fromEpochTime(fs_st_mtime); + return Ret; +} + error_code current_path(SmallVectorImpl<char> &result) { #ifdef MAXPATHLEN result.reserve(MAXPATHLEN); @@ -401,6 +407,7 @@ error_code status(const Twine &path, file_status &result) { result.fs_st_dev = status.st_dev; result.fs_st_ino = status.st_ino; + result.fs_st_mtime = status.st_mtime; return error_code::success(); } diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc index 8815b0ec2f..006e31a5bd 100644 --- a/lib/Support/Windows/PathV2.inc +++ b/lib/Support/Windows/PathV2.inc @@ -128,6 +128,16 @@ namespace llvm { namespace sys { namespace fs { +TimeValue file_status::getLastModificationTime() { + ULARGE_INTEGER UI; + UI.LowPart = LastWriteTimeLow; + UI.HighPart = LastWriteTimeHigh; + + TimeValue Ret; + Ret.fromWin32Time(UI.QuadPart); + return Ret; +} + error_code current_path(SmallVectorImpl<char> &result) { SmallVector<wchar_t, 128> cur_path; cur_path.reserve(128); |