summaryrefslogtreecommitdiff
path: root/tools/dsymutil/DebugMap.h
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2015-07-22 23:24:00 +0000
committerFrederic Riss <friss@apple.com>2015-07-22 23:24:00 +0000
commit00d14ddf9da369ebfad4b83e5cf13ba1048fc9ba (patch)
treedcdf2e0860bb29112f3f35552ceabbe5fa45c3bf /tools/dsymutil/DebugMap.h
parente2b5bcf7810839316c84f06450001feb238082ab (diff)
[dsymutil] Check archive members timestamps.
The debug map contains the timestamp of the object files in references. We do not check these in the general case, but it's really useful if you have archives where different versions of an object file have been appended. This allows llvm-dsymutil to find the right one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242965 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/dsymutil/DebugMap.h')
-rw-r--r--tools/dsymutil/DebugMap.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/dsymutil/DebugMap.h b/tools/dsymutil/DebugMap.h
index d0edbabb404..29347ed0f50 100644
--- a/tools/dsymutil/DebugMap.h
+++ b/tools/dsymutil/DebugMap.h
@@ -29,6 +29,7 @@
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Path.h"
+#include "llvm/Support/TimeValue.h"
#include "llvm/Support/YAMLTraits.h"
#include <vector>
@@ -89,7 +90,8 @@ public:
/// This function adds an DebugMapObject to the list owned by this
/// debug map.
- DebugMapObject &addDebugMapObject(StringRef ObjectFilePath);
+ DebugMapObject &addDebugMapObject(StringRef ObjectFilePath,
+ sys::TimeValue Timestamp);
const Triple &getTriple() const { return BinaryTriple; }
@@ -139,6 +141,8 @@ public:
llvm::StringRef getObjectFilename() const { return Filename; }
+ sys::TimeValue getTimestamp() const { return Timestamp; }
+
iterator_range<StringMap<SymbolMapping>::const_iterator> symbols() const {
return make_range(Symbols.begin(), Symbols.end());
}
@@ -150,9 +154,10 @@ public:
private:
friend class DebugMap;
/// DebugMapObjects can only be constructed by the owning DebugMap.
- DebugMapObject(StringRef ObjectFilename);
+ DebugMapObject(StringRef ObjectFilename, sys::TimeValue Timestamp);
std::string Filename;
+ sys::TimeValue Timestamp;
StringMap<SymbolMapping> Symbols;
DenseMap<uint64_t, DebugMapEntry *> AddressToMapping;
@@ -167,12 +172,14 @@ private:
public:
DebugMapObject &operator=(DebugMapObject RHS) {
std::swap(Filename, RHS.Filename);
+ std::swap(Timestamp, RHS.Timestamp);
std::swap(Symbols, RHS.Symbols);
std::swap(AddressToMapping, RHS.AddressToMapping);
return *this;
}
DebugMapObject(DebugMapObject &&RHS) {
Filename = std::move(RHS.Filename);
+ Timestamp = std::move(RHS.Timestamp);
Symbols = std::move(RHS.Symbols);
AddressToMapping = std::move(RHS.AddressToMapping);
}