[llvm-branch-commits] [llvm] c6e341c - Revert "[dsymutil] Warn on timestmap mismatch between object file and debug map"
David Zarzycki via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jan 13 04:28:02 PST 2021
Author: David Zarzycki
Date: 2021-01-13T07:23:34-05:00
New Revision: c6e341c89957db31432baffb72ee015f37d8c48d
URL: https://github.com/llvm/llvm-project/commit/c6e341c89957db31432baffb72ee015f37d8c48d
DIFF: https://github.com/llvm/llvm-project/commit/c6e341c89957db31432baffb72ee015f37d8c48d.diff
LOG: Revert "[dsymutil] Warn on timestmap mismatch between object file and debug map"
This reverts commit e5553b9a6ab9f02f382a31cc5117b52c3bfaf77a.
Tests are not allowed to modify the source. Please figure out a way to
use %t rather than dynamically modifying the inputs.
Added:
Modified:
llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
llvm/test/tools/dsymutil/debug-map-parsing.test
llvm/tools/dsymutil/BinaryHolder.cpp
llvm/tools/dsymutil/BinaryHolder.h
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
Removed:
llvm/test/tools/dsymutil/Inputs/basic.macho.x86_64.o
################################################################################
diff --git a/llvm/test/tools/dsymutil/Inputs/basic.macho.x86_64.o b/llvm/test/tools/dsymutil/Inputs/basic.macho.x86_64.o
deleted file mode 100644
index e69de29bb2d1..000000000000
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 43d930af7128..626208ff3496 100644
--- a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
+++ b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
@@ -20,7 +20,7 @@ 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 ({{.*}})
+TIMESTAMP: warning: Timestamp mismatch
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/test/tools/dsymutil/debug-map-parsing.test b/llvm/test/tools/dsymutil/debug-map-parsing.test
index 703934d38503..fb4226093da1 100644
--- a/llvm/test/tools/dsymutil/debug-map-parsing.test
+++ b/llvm/test/tools/dsymutil/debug-map-parsing.test
@@ -1,4 +1,3 @@
-RUN: touch %p/Inputs/basic.macho.x86_64.o
RUN: dsymutil -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
RUN: dsymutil -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
RUN: dsymutil -verbose -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 2>&1 | FileCheck %s --check-prefix=CHECK-ARCHIVE
@@ -47,7 +46,6 @@ opening the archive once if mulitple of its members are used).
CHECK-ARCHIVE: trying to open {{.*}}basic-archive.macho.x86_64'
CHECK-ARCHIVE-NEXT: loaded object.
CHECK-ARCHIVE-NEXT: trying to open {{.*}}/Inputs/basic1.macho.x86_64.o'
-CHECK-ARCHIVE-NEXT: warning: {{.*}}/Inputs/basic1.macho.x86_64.o: timestamp mismatch between object file ({{.*}}) and debug map ({{.*}})
CHECK-ARCHIVE-NEXT: loaded object.
CHECK-ARCHIVE-NEXT: trying to open {{.*}}/libbasic.a(basic2.macho.x86_64.o)'
CHECK-ARCHIVE-NEXT: loaded archive {{.*}}/libbasic.a'
diff --git a/llvm/tools/dsymutil/BinaryHolder.cpp b/llvm/tools/dsymutil/BinaryHolder.cpp
index b401d519718c..df3cb7161a81 100644
--- a/llvm/tools/dsymutil/BinaryHolder.cpp
+++ b/llvm/tools/dsymutil/BinaryHolder.cpp
@@ -87,8 +87,7 @@ Error BinaryHolder::ArchiveEntry::load(IntrusiveRefCntPtr<vfs::FileSystem> VFS,
}
Error BinaryHolder::ObjectEntry::load(IntrusiveRefCntPtr<vfs::FileSystem> VFS,
- StringRef Filename, TimestampTy Timestamp,
- bool Verbose) {
+ StringRef Filename, bool Verbose) {
// Try to load regular binary and force it to be memory mapped.
auto ErrOrBuff = (Filename == "-")
? MemoryBuffer::getSTDIN()
@@ -96,17 +95,6 @@ Error BinaryHolder::ObjectEntry::load(IntrusiveRefCntPtr<vfs::FileSystem> VFS,
if (auto Err = ErrOrBuff.getError())
return errorCodeToError(Err);
- if (Filename != "-" && Timestamp != sys::TimePoint<>()) {
- llvm::ErrorOr<vfs::Status> Stat = VFS->status(Filename);
- if (!Stat)
- return errorCodeToError(Stat.getError());
- if (Timestamp != Stat->getLastModificationTime())
- WithColor::warning() << Filename
- << ": timestamp mismatch between object file ("
- << Stat->getLastModificationTime()
- << ") and debug map (" << Timestamp << ")\n";
- }
-
MemBuffer = std::move(*ErrOrBuff);
if (Verbose)
@@ -194,11 +182,7 @@ BinaryHolder::ArchiveEntry::getObjectEntry(StringRef Filename,
if (Timestamp != sys::TimePoint<>() &&
Timestamp != ModTimeOrErr.get()) {
if (Verbose)
- WithColor::warning()
- << *NameOrErr
- << ": timestamp mismatch between archive member ("
- << ModTimeOrErr.get() << ") and debug map (" << Timestamp
- << ")\n";
+ WithColor::warning() << "member has timestamp mismatch.\n";
continue;
}
@@ -262,7 +246,7 @@ BinaryHolder::getObjectEntry(StringRef Filename, TimestampTy Timestamp) {
std::lock_guard<std::mutex> Lock(ObjectCacheMutex);
if (!ObjectCache.count(Filename)) {
ObjectEntry &OE = ObjectCache[Filename];
- auto Err = OE.load(VFS, Filename, Timestamp, Verbose);
+ auto Err = OE.load(VFS, Filename, Verbose);
if (Err) {
ObjectCache.erase(Filename);
return std::move(Err);
diff --git a/llvm/tools/dsymutil/BinaryHolder.h b/llvm/tools/dsymutil/BinaryHolder.h
index 5e81fe4b93b1..dee944d826a1 100644
--- a/llvm/tools/dsymutil/BinaryHolder.h
+++ b/llvm/tools/dsymutil/BinaryHolder.h
@@ -58,7 +58,7 @@ class BinaryHolder {
public:
/// Load the given object binary in memory.
Error load(IntrusiveRefCntPtr<vfs::FileSystem> VFS, StringRef Filename,
- TimestampTy Timestamp, bool Verbose = false);
+ bool Verbose = false);
/// Access all owned ObjectFiles.
std::vector<const object::ObjectFile *> getObjects() const;
diff --git a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
index 29408e7c4946..fe57629bade1 100644
--- a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+++ b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
@@ -412,10 +412,9 @@ bool DwarfLinkerForBinary::link(const DebugMap &Map) {
Stat.getLastModificationTime());
if (ModificationTime != Obj->getTimestamp()) {
// Not using the helper here as we can easily stream TimePoint<>.
- WithColor::warning()
- << File << ": timestamp mismatch between swift interface file ("
- << sys::TimePoint<>(Obj->getTimestamp()) << ") and debug map ("
- << sys::TimePoint<>(Obj->getTimestamp()) << ")\n";
+ WithColor::warning() << "Timestamp mismatch for " << File << ": "
+ << Stat.getLastModificationTime() << " and "
+ << sys::TimePoint<>(Obj->getTimestamp()) << "\n";
continue;
}
}
More information about the llvm-branch-commits
mailing list