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.
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()
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