aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-07-16 02:43:51 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-07-16 02:43:51 +0000
commitff8f9e58ec8507b951043a367d72f2385e12cf70 (patch)
tree5f00e6e2edcad04abaf76bb5ef38066e4e2c1dda /include
parente7f0393f6d080f599f225dcdc440142e758ffe1b (diff)
downloadexternal_llvm-ff8f9e58ec8507b951043a367d72f2385e12cf70.zip
external_llvm-ff8f9e58ec8507b951043a367d72f2385e12cf70.tar.gz
external_llvm-ff8f9e58ec8507b951043a367d72f2385e12cf70.tar.bz2
Fix TimeValue::toWin32Time() to be symmetric to fromWin32Time() and compatible to Win32's FILETIME.
llvm-ar is the only user of toWin32Time() (via setLastModificationAndAccessTime), and r186298 can be reverted. It had been buggy since the initial commit. FIXME: Could we rename {from|to}Win32Time as {from|to}Win32FILETIME in TimeValue? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/TimeValue.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/Support/TimeValue.h b/include/llvm/Support/TimeValue.h
index 4b48b84..2785408 100644
--- a/include/llvm/Support/TimeValue.h
+++ b/include/llvm/Support/TimeValue.h
@@ -253,9 +253,10 @@ namespace sys {
/// Converts the TimeValue into the corresponding number of "ticks" for
/// Win32 platforms, correcting for the difference in Win32 zero time.
- /// @brief Convert to windows time (seconds since 12:00:00a Jan 1, 1601)
+ /// @brief Convert to Win32's FILETIME
+ /// (100ns intervals since 00:00:00 Jan 1, 1601 UTC)
uint64_t toWin32Time() const {
- uint64_t result = seconds_ - Win32ZeroTimeSeconds;
+ uint64_t result = (uint64_t)10000000 * (seconds_ - Win32ZeroTimeSeconds);
result += nanos_ / NANOSECONDS_PER_WIN32_TICK;
return result;
}