From 79e60eb94880f5beac5c69fb2e42393fec6c279b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 7 Dec 2016 21:26:32 +0000 Subject: [ObjectYAML] Pull DWARF support into DWARFYAML namespace Since DWARF formatting is agnostic to the object file it is stored in, it doesn't make sense for this to be in the MachOYAML implementation. Pulling it into its own namespace means we could modify the ELF and COFF YAML tools to emit DWARF as well. In a follow-up patch I will better abstract this in obj2yaml and yaml2obj so that the DWARF bits in the tools can be re-used too. llvm-svn: 288984 --- llvm/lib/ObjectYAML/MachOYAML.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp') diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp index 41bbf9d0571..7ebb1bed088 100644 --- a/llvm/lib/ObjectYAML/MachOYAML.cpp +++ b/llvm/lib/ObjectYAML/MachOYAML.cpp @@ -29,10 +29,6 @@ bool MachOYAML::LinkEditData::isEmpty() const { NameList.size() + StringTable.size(); } -bool MachOYAML::DWARFData::isEmpty() const { - return 0 == DebugStrings.size() + AbbrevDecls.size(); -} - namespace yaml { void ScalarTraits::output(const char_16 &Val, void *, @@ -557,26 +553,6 @@ void MappingTraits::mapping( IO.mapRequired("sdk", LoadCommand.sdk); } -void MappingTraits::mapping( - IO &IO, MachOYAML::DWARFData &DWARF) { - IO.mapOptional("debug_str", DWARF.DebugStrings); - IO.mapOptional("debug_abbrev", DWARF.AbbrevDecls); -} - -void MappingTraits::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::mapping( - IO &IO, MachOYAML::DWARFAttributeAbbrev &AttAbbrev) { - IO.mapRequired("Attribute", AttAbbrev.Attribute); - IO.mapRequired("Form", AttAbbrev.Form); -} - } // namespace llvm::yaml } // namespace llvm -- cgit v1.2.3