[Object] Replace TimeValue with std::chrono
Summary:
Most of the changes are very straight-forward. The only choice I had to make was
to use second-precision time points in the Archive classes. I did this because
the archive files use that precision in the on-disk representation anyway.
Reviewers: rafael, zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25773
llvm-svn: 284974
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp
index 9a83f69..4684c18 100644
--- a/llvm/lib/Object/Archive.cpp
+++ b/llvm/lib/Object/Archive.cpp
@@ -239,7 +239,8 @@
return static_cast<sys::fs::perms>(Ret);
}
-Expected<sys::TimeValue> ArchiveMemberHeader::getLastModified() const {
+Expected<sys::TimePoint<std::chrono::seconds>>
+ArchiveMemberHeader::getLastModified() const {
unsigned Seconds;
if (StringRef(ArMemHdr->LastModified,
sizeof(ArMemHdr->LastModified)).rtrim(' ')
@@ -256,9 +257,7 @@
"archive member header at offset " + Twine(Offset));
}
- sys::TimeValue Ret;
- Ret.fromEpochTime(Seconds);
- return Ret;
+ return sys::toTimePoint(Seconds);
}
Expected<unsigned> ArchiveMemberHeader::getUID() const {