[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
This commit is contained in:
Pavel Labath
2016-10-24 13:38:27 +00:00
parent 504bf334b0
commit bff47b51b6
5 changed files with 32 additions and 30 deletions

View File

@@ -239,7 +239,8 @@ Expected<sys::fs::perms> ArchiveMemberHeader::getAccessMode() const {
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 @@ Expected<sys::TimeValue> ArchiveMemberHeader::getLastModified() const {
"archive member header at offset " + Twine(Offset));
}
sys::TimeValue Ret;
Ret.fromEpochTime(Seconds);
return Ret;
return sys::toTimePoint(Seconds);
}
Expected<unsigned> ArchiveMemberHeader::getUID() const {