summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/DebugMap.cpp
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2015-07-24 06:41:11 +0000
committerFrederic Riss <friss@apple.com>2015-07-24 06:41:11 +0000
commiteb85c8fb099ec65b47467d15b9ea1018ca201f6b (patch)
treecb3f6944d5153d5eedfc710456ea8d7dc30b0fc2 /llvm/tools/dsymutil/DebugMap.cpp
parent65f0abf275ccc1eb249bb12ce4ac826c9df37986 (diff)
downloadbcm5719-llvm-eb85c8fb099ec65b47467d15b9ea1018ca201f6b.tar.gz
bcm5719-llvm-eb85c8fb099ec65b47467d15b9ea1018ca201f6b.zip
[dsymutil] Implement support for universal mach-o object files.
This patch allows llvm-dsymutil to read universal (aka fat) macho object files and archives. The patch touches nearly everything in the BinaryHolder, but it is fairly mechinical: the methods that returned MemoryBufferRefs or ObjectFiles now return a vector of those, and the high-level access function takes a triple argument to select the architecture. There is no support yet for handling fat executables and thus no support for writing fat object files. llvm-svn: 243096
Diffstat (limited to 'llvm/tools/dsymutil/DebugMap.cpp')
-rw-r--r--llvm/tools/dsymutil/DebugMap.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/tools/dsymutil/DebugMap.cpp b/llvm/tools/dsymutil/DebugMap.cpp
index 24dedfcb673..e29c885b5ac 100644
--- a/llvm/tools/dsymutil/DebugMap.cpp
+++ b/llvm/tools/dsymutil/DebugMap.cpp
@@ -178,9 +178,9 @@ SequenceTraits<std::vector<std::unique_ptr<dsymutil::DebugMapObject>>>::element(
void MappingTraits<dsymutil::DebugMap>::mapping(IO &io,
dsymutil::DebugMap &DM) {
io.mapRequired("triple", DM.BinaryTriple);
- io.mapOptional("objects", DM.Objects);
if (void *Ctxt = io.getContext())
reinterpret_cast<YAMLContext *>(Ctxt)->BinaryTriple = DM.BinaryTriple;
+ io.mapOptional("objects", DM.Objects);
}
void MappingTraits<std::unique_ptr<dsymutil::DebugMap>>::mapping(
@@ -188,9 +188,9 @@ void MappingTraits<std::unique_ptr<dsymutil::DebugMap>>::mapping(
if (!DM)
DM.reset(new DebugMap());
io.mapRequired("triple", DM->BinaryTriple);
- io.mapOptional("objects", DM->Objects);
if (void *Ctxt = io.getContext())
reinterpret_cast<YAMLContext *>(Ctxt)->BinaryTriple = DM->BinaryTriple;
+ io.mapOptional("objects", DM->Objects);
}
MappingTraits<dsymutil::DebugMapObject>::YamlDMO::YamlDMO(
@@ -210,11 +210,11 @@ MappingTraits<dsymutil::DebugMapObject>::YamlDMO::denormalize(IO &IO) {
StringMap<uint64_t> SymbolAddresses;
sys::path::append(Path, Filename);
- auto ErrOrObjectFile = BinHolder.GetObjectFile(Path);
- if (auto EC = ErrOrObjectFile.getError()) {
+ auto ErrOrObjectFiles = BinHolder.GetObjectFiles(Path);
+ if (auto EC = ErrOrObjectFiles.getError()) {
llvm::errs() << "warning: Unable to open " << Path << " " << EC.message()
<< '\n';
- } else {
+ } else if (auto ErrOrObjectFile = BinHolder.Get(Ctxt.BinaryTriple)) {
// Rewrite the object file symbol addresses in the debug map. The
// YAML input is mainly used to test llvm-dsymutil without
// requiring binaries checked-in. If we generate the object files
OpenPOWER on IntegriCloud