1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[dsymutil] Compare object modification times using second precision

The modification time in the debug map is expressed using second
precision, while the modification time returned by the filesystem could
be more precise. Avoid spurious warnings about timestamp mismatches by
truncating the modification time reported by the system to seconds.
This commit is contained in:
Jonas Devlieghere 2021-01-20 18:38:56 -08:00
parent 4abb9aaecc
commit 0ca2ad5bbe

View File

@ -100,7 +100,8 @@ Error BinaryHolder::ObjectEntry::load(IntrusiveRefCntPtr<vfs::FileSystem> VFS,
llvm::ErrorOr<vfs::Status> Stat = VFS->status(Filename);
if (!Stat)
return errorCodeToError(Stat.getError());
if (Timestamp != Stat->getLastModificationTime())
if (Timestamp != std::chrono::time_point_cast<std::chrono::seconds>(
Stat->getLastModificationTime()))
WithColor::warning() << Filename
<< ": timestamp mismatch between object file ("
<< Stat->getLastModificationTime()
@ -192,7 +193,8 @@ BinaryHolder::ArchiveEntry::getObjectEntry(StringRef Filename,
return ModTimeOrErr.takeError();
if (Timestamp != sys::TimePoint<>() &&
Timestamp != ModTimeOrErr.get()) {
Timestamp != std::chrono::time_point_cast<std::chrono::seconds>(
ModTimeOrErr.get())) {
if (Verbose)
WithColor::warning()
<< *NameOrErr