diff options
| author | Chris Bieneman <beanz@apple.com> | 2017-01-12 21:35:21 +0000 |
|---|---|---|
| committer | Chris Bieneman <beanz@apple.com> | 2017-01-12 21:35:21 +0000 |
| commit | 07088c10606068fa8bdf7c5ce1693d179752810e (patch) | |
| tree | a0e169b4dad89e8ccc29da2c8d02a062d22c7deb /llvm/tools/yaml2obj/yaml2macho.cpp | |
| parent | 6d9e2c4a9c7c677a1c1ce250d14834b8f5841f16 (diff) | |
| download | bcm5719-llvm-07088c10606068fa8bdf7c5ce1693d179752810e.tar.gz bcm5719-llvm-07088c10606068fa8bdf7c5ce1693d179752810e.zip | |
[ObjectYAML] Pull yaml2dwarf out of yaml2obj for reuse
This patch pulls the yaml2dwarf code out of yaml2obj into a new set of DWARF emitter functions in the DWARFYAML namespace. This will enable the YAML->DWARF code to be used inside DWARF tests by populating the DWARFYAML structs and calling the Emitter functions.
llvm-svn: 291828
Diffstat (limited to 'llvm/tools/yaml2obj/yaml2macho.cpp')
| -rw-r--r-- | llvm/tools/yaml2obj/yaml2macho.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/tools/yaml2obj/yaml2macho.cpp b/llvm/tools/yaml2obj/yaml2macho.cpp index cbc4d7ff50d..6a27a7f64c0 100644 --- a/llvm/tools/yaml2obj/yaml2macho.cpp +++ b/llvm/tools/yaml2obj/yaml2macho.cpp @@ -14,6 +14,7 @@ #include "yaml2obj.h" #include "llvm/ObjectYAML/ObjectYAML.h" +#include "llvm/ObjectYAML/DWARFEmitter.h" #include "llvm/Support/Error.h" #include "llvm/Support/LEB128.h" #include "llvm/Support/MachO.h" @@ -269,19 +270,21 @@ Error MachOWriter::writeSectionData(raw_ostream &OS) { "Wrote too much data somewhere, section offsets don't line up."); if (0 == strncmp(&Sec.segname[0], "__DWARF", 16)) { if (0 == strncmp(&Sec.sectname[0], "__debug_str", 16)) { - yaml2debug_str(OS, Obj.DWARF); + DWARFYAML::EmitDebugStr(OS, Obj.DWARF); } else if (0 == strncmp(&Sec.sectname[0], "__debug_abbrev", 16)) { - yaml2debug_abbrev(OS, Obj.DWARF); + DWARFYAML::EmitDebugAbbrev(OS, Obj.DWARF); } else if (0 == strncmp(&Sec.sectname[0], "__debug_aranges", 16)) { - yaml2debug_aranges(OS, Obj.DWARF); + DWARFYAML::EmitDebugAranges(OS, Obj.DWARF); } else if (0 == strncmp(&Sec.sectname[0], "__debug_pubnames", 16)) { - yaml2pubsection(OS, Obj.DWARF.PubNames, Obj.IsLittleEndian); + DWARFYAML::EmitPubSection(OS, Obj.DWARF.PubNames, + Obj.IsLittleEndian); } else if (0 == strncmp(&Sec.sectname[0], "__debug_pubtypes", 16)) { - yaml2pubsection(OS, Obj.DWARF.PubTypes, Obj.IsLittleEndian); + DWARFYAML::EmitPubSection(OS, Obj.DWARF.PubTypes, + Obj.IsLittleEndian); } else if (0 == strncmp(&Sec.sectname[0], "__debug_info", 16)) { - yaml2debug_info(OS, Obj.DWARF); + DWARFYAML::EmitDebugInfo(OS, Obj.DWARF); } else if (0 == strncmp(&Sec.sectname[0], "__debug_line", 16)) { - yaml2debug_line(OS, Obj.DWARF); + DWARFYAML::EmitDebugLine(OS, Obj.DWARF); } } else { // Fills section data with 0xDEADBEEF |

