summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/DebugMap.h
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2016-01-31 04:29:22 +0000
committerFrederic Riss <friss@apple.com>2016-01-31 04:29:22 +0000
commitd8c33dc2f60becafd0460d4e24d211316f64e521 (patch)
tree982b172f5b71cc65765bb9849e09566c2e37c515 /llvm/tools/dsymutil/DebugMap.h
parentf42e031c79678ab79e1e7c4c86c9edad764b046c (diff)
downloadbcm5719-llvm-d8c33dc2f60becafd0460d4e24d211316f64e521.tar.gz
bcm5719-llvm-d8c33dc2f60becafd0460d4e24d211316f64e521.zip
[dsymutil] Allow debug map mappings with no object file address. NFC
This change just changes the data structure that ties symbol names, object file address and linked binary addresses to accept mappings with no object file address. Such symbol mappings are not fed into the debug map yet, so this patch is NFC. A subsequent patch will make use of this functionality for common symbols. llvm-svn: 259317
Diffstat (limited to 'llvm/tools/dsymutil/DebugMap.h')
-rw-r--r--llvm/tools/dsymutil/DebugMap.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/tools/dsymutil/DebugMap.h b/llvm/tools/dsymutil/DebugMap.h
index 4907b8f1a72..1a3d62b67b7 100644
--- a/llvm/tools/dsymutil/DebugMap.h
+++ b/llvm/tools/dsymutil/DebugMap.h
@@ -117,12 +117,15 @@ public:
class DebugMapObject {
public:
struct SymbolMapping {
- yaml::Hex64 ObjectAddress;
+ Optional<yaml::Hex64> ObjectAddress;
yaml::Hex64 BinaryAddress;
yaml::Hex32 Size;
- SymbolMapping(uint64_t ObjectAddress, uint64_t BinaryAddress, uint32_t Size)
- : ObjectAddress(ObjectAddress), BinaryAddress(BinaryAddress),
- Size(Size) {}
+ SymbolMapping(Optional<uint64_t> ObjectAddr, uint64_t BinaryAddress,
+ uint32_t Size)
+ : BinaryAddress(BinaryAddress), Size(Size) {
+ if (ObjectAddr)
+ ObjectAddress = *ObjectAddr;
+ }
/// For YAML IO support
SymbolMapping() = default;
};
@@ -132,7 +135,7 @@ public:
/// \brief Adds a symbol mapping to this DebugMapObject.
/// \returns false if the symbol was already registered. The request
/// is discarded in this case.
- bool addSymbol(llvm::StringRef SymName, uint64_t ObjectAddress,
+ bool addSymbol(llvm::StringRef SymName, Optional<uint64_t> ObjectAddress,
uint64_t LinkedAddress, uint32_t Size);
/// \brief Lookup a symbol mapping.
OpenPOWER on IntegriCloud