summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML
diff options
context:
space:
mode:
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