summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-12-06 06:00:49 +0000
committerChris Bieneman <beanz@apple.com>2016-12-06 06:00:49 +0000
commit8b058aec1d9499015e4a3fd2e5a503273a5d384b (patch)
treecbfeaee4b164bac6bc4ebe7d8c32261d3b612774 /llvm/lib/ObjectYAML
parent31150cbdc93040d294b563b4a5475775f5599236 (diff)
downloadbcm5719-llvm-8b058aec1d9499015e4a3fd2e5a503273a5d384b.tar.gz
bcm5719-llvm-8b058aec1d9499015e4a3fd2e5a503273a5d384b.zip
[ObjectYAML] First bit of support for encoding DWARF in MachO
This patch adds the starting support for encoding data from the MachO __DWARF segment. The first section supported is the __debug_str section because it is the simplest. llvm-svn: 288774
Diffstat (limited to 'llvm/lib/ObjectYAML')
-rw-r--r--llvm/lib/ObjectYAML/MachOYAML.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp
index 984ca0b9d01..d3f8ea47e59 100644
--- a/llvm/lib/ObjectYAML/MachOYAML.cpp
+++ b/llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -23,7 +23,14 @@ namespace llvm {
MachOYAML::LoadCommand::~LoadCommand() {}
bool MachOYAML::LinkEditData::isEmpty() const {
- return 0 == RebaseOpcodes.size() + BindOpcodes.size() + WeakBindOpcodes.size() + LazyBindOpcodes.size() + ExportTrie.Children.size() + NameList.size() + StringTable.size();
+ return 0 ==
+ RebaseOpcodes.size() + BindOpcodes.size() + WeakBindOpcodes.size() +
+ LazyBindOpcodes.size() + ExportTrie.Children.size() +
+ NameList.size() + StringTable.size();
+}
+
+bool MachOYAML::DWARFData::isEmpty() const {
+ return 0 == DebugStrings.size();
}
namespace yaml {
@@ -102,6 +109,9 @@ void MappingTraits<MachOYAML::Object>::mapping(IO &IO,
if(!Object.LinkEdit.isEmpty() || !IO.outputting())
IO.mapOptional("LinkEditData", Object.LinkEdit);
+ if(!Object.DWARF.isEmpty() || !IO.outputting())
+ IO.mapOptional("DWARF", Object.DWARF);
+
if (IO.getContext() == &Object)
IO.setContext(nullptr);
}
@@ -547,6 +557,11 @@ void MappingTraits<MachO::version_min_command>::mapping(
IO.mapRequired("sdk", LoadCommand.sdk);
}
+void MappingTraits<MachOYAML::DWARFData>::mapping(
+ IO &IO, MachOYAML::DWARFData &DWARF) {
+ IO.mapRequired("DebugStrings", DWARF.DebugStrings);
+}
+
} // namespace llvm::yaml
} // namespace llvm
OpenPOWER on IntegriCloud