summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-12-04 17:15:23 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-12-04 17:15:23 +0000
commite35f48f62282af8a83a0cae0e285f92f24ad3407 (patch)
tree60406de3ec2f4e5a8af665f4cf7fd18af673f858 /llvm/tools
parent07843640d5824e007cfc40da70ed65007410e30e (diff)
downloadbcm5719-llvm-e35f48f62282af8a83a0cae0e285f92f24ad3407.tar.gz
bcm5719-llvm-e35f48f62282af8a83a0cae0e285f92f24ad3407.zip
[dsymutil] Ensure we're comparing time stamps with the same precision.
After TimePoint's precision was increased in LLVM we started seeing failures because the modification times didn't match. This adds a time cast to ensure that we're comparing TimePoints with the same amount of precision. llvm-svn: 348283
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/dsymutil/DwarfLinker.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp
index 2c5cce50132..2862739fd73 100644
--- a/llvm/tools/dsymutil/DwarfLinker.cpp
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp
@@ -2417,15 +2417,20 @@ bool DwarfLinker::link(const DebugMap &Map) {
warn(Err.message());
continue;
}
- if (!Options.NoTimestamp &&
- Stat.getLastModificationTime() !=
- sys::TimePoint<>(LinkContext.DMO.getTimestamp())) {
- // Not using the helper here as we can easily stream TimePoint<>.
- WithColor::warning()
- << "Timestamp mismatch for " << File << ": "
- << Stat.getLastModificationTime() << " and "
- << sys::TimePoint<>(LinkContext.DMO.getTimestamp()) << "\n";
- continue;
+ if (!Options.NoTimestamp) {
+ // The modification can have sub-second precision so we need to cast
+ // away the extra precision that's not present in the debug map.
+ auto ModificationTime =
+ std::chrono::time_point_cast<std::chrono::seconds>(
+ Stat.getLastModificationTime());
+ if (ModificationTime != LinkContext.DMO.getTimestamp()) {
+ // Not using the helper here as we can easily stream TimePoint<>.
+ WithColor::warning()
+ << "Timestamp mismatch for " << File << ": "
+ << Stat.getLastModificationTime() << " and "
+ << sys::TimePoint<>(LinkContext.DMO.getTimestamp()) << "\n";
+ continue;
+ }
}
// Copy the module into the .swift_ast section.
OpenPOWER on IntegriCloud