diff options
| author | Chris Bieneman <beanz@apple.com> | 2016-12-07 22:30:15 +0000 |
|---|---|---|
| committer | Chris Bieneman <beanz@apple.com> | 2016-12-07 22:30:15 +0000 |
| commit | 7d7364ab4fecfd8cdf6f129df518922dacb53047 (patch) | |
| tree | 1dde94cac23d7339dd89a84158f4b0e8e61375f7 /llvm/tools/yaml2obj/yaml2macho.cpp | |
| parent | 9408c6183054d824780fa4eaf5e67b9f640b78fd (diff) | |
| download | bcm5719-llvm-7d7364ab4fecfd8cdf6f129df518922dacb53047.tar.gz bcm5719-llvm-7d7364ab4fecfd8cdf6f129df518922dacb53047.zip | |
[yaml2obj] Refactor and abstract yaml2dwarf functions
This abstracts the code for emitting DWARF binary from the DWARFYAML types into reusable interfaces that could be used by ELF and COFF.
llvm-svn: 288990
Diffstat (limited to 'llvm/tools/yaml2obj/yaml2macho.cpp')
| -rw-r--r-- | llvm/tools/yaml2obj/yaml2macho.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/llvm/tools/yaml2obj/yaml2macho.cpp b/llvm/tools/yaml2obj/yaml2macho.cpp index 48bd9e83ad3..a6d56ef8501 100644 --- a/llvm/tools/yaml2obj/yaml2macho.cpp +++ b/llvm/tools/yaml2obj/yaml2macho.cpp @@ -389,22 +389,9 @@ Error MachOWriter::writeDWARFData(raw_ostream &OS, for(auto Section : Sections) { ZeroToOffset(OS, Section.offset); if (0 == strncmp(&Section.sectname[0], "__debug_str", 16)) { - for (auto Str : Obj.DWARF.DebugStrings) { - OS.write(Str.data(), Str.size()); - OS.write('\0'); - } + yaml2debug_str(OS, Obj.DWARF); } else if (0 == strncmp(&Section.sectname[0], "__debug_abbrev", 16)) { - for (auto AbbrevDecl : Obj.DWARF.AbbrevDecls) { - encodeULEB128(AbbrevDecl.Code, OS); - encodeULEB128(AbbrevDecl.Tag, OS); - OS.write(AbbrevDecl.Children); - for (auto Attr : AbbrevDecl.Attributes) { - encodeULEB128(Attr.Attribute, OS); - encodeULEB128(Attr.Form, OS); - } - encodeULEB128(0, OS); - encodeULEB128(0, OS); - } + yaml2debug_abbrev(OS, Obj.DWARF); } } return Error::success(); |

