summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/MachOYAML.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-12-07 18:52:59 +0000
committerChris Bieneman <beanz@apple.com>2016-12-07 18:52:59 +0000
commitc6c0e54d3d69ac297f0a0bb03bc0b5e792f85e12 (patch)
treeb7b5e96c7e0b6713d6c1551cf2935159ab942a8d /llvm/lib/ObjectYAML/MachOYAML.cpp
parenta913f7ddbe4f920b52da988cf068595510d62e3d (diff)
downloadbcm5719-llvm-c6c0e54d3d69ac297f0a0bb03bc0b5e792f85e12.tar.gz
bcm5719-llvm-c6c0e54d3d69ac297f0a0bb03bc0b5e792f85e12.zip
[ObjectYAML] Support for DWARF __debug_abbrev section
This patch adds support for round-tripping DWARF debug abbreviations through the obj<->yaml tools. llvm-svn: 288955
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/MachOYAML.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp
index d3f8ea47e59..45554304d10 100644
--- a/llvm/lib/ObjectYAML/MachOYAML.cpp
+++ b/llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -30,7 +30,7 @@ bool MachOYAML::LinkEditData::isEmpty() const {
}
bool MachOYAML::DWARFData::isEmpty() const {
- return 0 == DebugStrings.size();
+ return 0 == DebugStrings.size() + AbbrevDecls.size();
}
namespace yaml {
@@ -559,7 +559,22 @@ void MappingTraits<MachO::version_min_command>::mapping(
void MappingTraits<MachOYAML::DWARFData>::mapping(
IO &IO, MachOYAML::DWARFData &DWARF) {
- IO.mapRequired("DebugStrings", DWARF.DebugStrings);
+ IO.mapOptional("DebugStrings", DWARF.DebugStrings);
+ IO.mapOptional("AbbrevDecls", DWARF.AbbrevDecls);
+}
+
+void MappingTraits<MachOYAML::DWARFAbbrev>::mapping(
+ IO &IO, MachOYAML::DWARFAbbrev &Abbrev) {
+ IO.mapRequired("Code", Abbrev.Code);
+ IO.mapRequired("Tag", Abbrev.Tag);
+ IO.mapRequired("Children", Abbrev.Children);
+ IO.mapRequired("Attributes", Abbrev.Attributes);
+}
+
+void MappingTraits<MachOYAML::DWARFAttributeAbbrev>::mapping(
+ IO &IO, MachOYAML::DWARFAttributeAbbrev &AttAbbrev) {
+ IO.mapRequired("Attribute", AttAbbrev.Attribute);
+ IO.mapRequired("Form", AttAbbrev.Form);
}
} // namespace llvm::yaml
OpenPOWER on IntegriCloud