[llvm] 10ea731 - [dsymutil] Don't print timestamp warning if we have no timestamp
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 19 21:52:04 PST 2022
Author: Jonas Devlieghere
Date: 2022-01-19T21:51:58-08:00
New Revision: 10ea7316995dca0c9e31da5f838053885680f5f3
URL: https://github.com/llvm/llvm-project/commit/10ea7316995dca0c9e31da5f838053885680f5f3
DIFF: https://github.com/llvm/llvm-project/commit/10ea7316995dca0c9e31da5f838053885680f5f3.diff
LOG: [dsymutil] Don't print timestamp warning if we have no timestamp
If we have no timestamp (0), don't print the corresponding warning. The
binary holder already successfully ignores these cases, but the warning
for swift interface files was lacking it.
rdar://86036385
Differential revision: https://reviews.llvm.org/D117333
Added:
Modified:
llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
Removed:
################################################################################
diff --git a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
index 43d930af71280..a16330d8c1b05 100644
--- a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
+++ b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
@@ -1,4 +1,5 @@
RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -o %T/swift-ast.dSYM -verbose -no-swiftmodule-timestamp | FileCheck %s --check-prefix=DSYMUTIL
+RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -o %T/swift-ast.dSYM -verbose | FileCheck %s --check-prefix=DSYMUTIL
RUN: llvm-readobj --sections --section-data %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s --check-prefix=READOBJ
RUN: llvm-dwarfdump --show-section-sizes %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s --check-prefix=DWARFDUMP
@@ -11,6 +12,7 @@ Compiled with:
DSYMUTIL: filename:{{.*}}swift-ast.swiftmodule
DSYMUTIL-NOT: The file was not recognized as a valid object file
+DSYMUTIL-NOT: timestamp mismatch
DSYMUTIL: DEBUG MAP OBJECT:{{.*}}swift-ast.swiftmodule
READOBJ: Name:{{.*}}__swift_ast
@@ -19,8 +21,5 @@ READOBJ-NEXT: |.|
DWARFDUMP: __swift_ast
-RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -no-output -verbose 2>&1 | FileCheck %s --check-prefix=TIMESTAMP
-TIMESTAMP: warning: {{.*}}/swift-ast.swiftmodule: timestamp mismatch between swift interface file ({{.*}}) and debug map ({{.*}})
-
RUN: dsymutil -s %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s --check-prefix=NAST
NAST-NOT: N_AST
diff --git a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
index 809b5f799b068..a8dfde0865377 100644
--- a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+++ b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
@@ -414,7 +414,8 @@ bool DwarfLinkerForBinary::link(const DebugMap &Map) {
auto ModificationTime =
std::chrono::time_point_cast<std::chrono::seconds>(
Stat.getLastModificationTime());
- if (ModificationTime != Obj->getTimestamp()) {
+ if (Obj->getTimestamp() != sys::TimePoint<>() &&
+ ModificationTime != Obj->getTimestamp()) {
// Not using the helper here as we can easily stream TimePoint<>.
WithColor::warning()
<< File << ": timestamp mismatch between swift interface file ("
More information about the llvm-commits
mailing list