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 | db5d8feeead5b191051e2f4703952a004a19768a (patch) | |
| tree | 82b6a7de78b8d2799b8994196b92ef525ca53c16 /llvm/lib/Support | |
| parent | 120c9288258be97a57c057aa1f9539f2a406bae7 (diff) | |
| download | bcm5719-llvm-db5d8feeead5b191051e2f4703952a004a19768a.tar.gz bcm5719-llvm-db5d8feeead5b191051e2f4703952a004a19768a.zip | |
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.
llvm-svn: 184450
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/Unix/PathV2.inc | 7 | ||||
| -rw-r--r-- | llvm/lib/Support/Windows/PathV2.inc | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/PathV2.inc b/llvm/lib/Support/Unix/PathV2.inc index 39b33123de8..4b922da7186 100644 --- a/llvm/lib/Support/Unix/PathV2.inc +++ b/llvm/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/llvm/lib/Support/Windows/PathV2.inc b/llvm/lib/Support/Windows/PathV2.inc index 8815b0ec2f7..006e31a5bd2 100644 --- a/llvm/lib/Support/Windows/PathV2.inc +++ b/llvm/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); |

