[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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user