void MappingTraits<WasmYAML::Object>::mapping(IO &IO, WasmYAML::Object &Object) { IO.setContext(&Object); IO.mapTag("!WASM", true); IO.mapRequired("FileHeader", Object.Header); IO.mapOptional("Sections", Object.Sections); IO.setContext(nullptr); }
void MappingTraits<ELFYAML::Object>::mapping(IO &IO, ELFYAML::Object &Object) { assert(!IO.getContext() && "The IO context is initialized already"); IO.setContext(&Object); IO.mapRequired("FileHeader", Object.Header); IO.mapOptional("Sections", Object.Sections); IO.mapOptional("Symbols", Object.Symbols); IO.setContext(nullptr); }
void MappingTraits<MachOYAML::UniversalBinary>::mapping( IO &IO, MachOYAML::UniversalBinary &UniversalBinary) { if (!IO.getContext()) { IO.setContext(&UniversalBinary); IO.mapTag("!fat-mach-o", true); } IO.mapRequired("FatHeader", UniversalBinary.Header); IO.mapRequired("FatArchs", UniversalBinary.FatArchs); IO.mapRequired("Slices", UniversalBinary.Slices); if (IO.getContext() == &UniversalBinary) IO.setContext(nullptr); }
void MappingTraits<DWARFYAML::PubSection>::mapping( IO &IO, DWARFYAML::PubSection &Section) { auto OldContext = IO.getContext(); IO.setContext(&Section); IO.mapRequired("Length", Section.Length); IO.mapRequired("Version", Section.Version); IO.mapRequired("UnitOffset", Section.UnitOffset); IO.mapRequired("UnitSize", Section.UnitSize); IO.mapRequired("Entries", Section.Entries); IO.setContext(OldContext); }
void MappingTraits<MachOYAML::Object>::mapping(IO &IO, MachOYAML::Object &Object) { // If the context isn't already set, tag the document as !mach-o. // For Fat files there will be a different tag so they can be differentiated. if (!IO.getContext()) { IO.setContext(&Object); IO.mapTag("!mach-o", true); } IO.mapRequired("FileHeader", Object.Header); IO.mapOptional("LoadCommands", Object.LoadCommands); IO.mapOptional("LinkEditData", Object.LinkEdit); IO.setContext(nullptr); }
void MappingTraits<MachOYAML::Object>::mapping(IO &IO, MachOYAML::Object &Object) { // If the context isn't already set, tag the document as !mach-o. // For Fat files there will be a different tag so they can be differentiated. if (!IO.getContext()) { IO.setContext(&Object); } IO.mapTag("!mach-o", true); IO.mapOptional("IsLittleEndian", Object.IsLittleEndian, sys::IsLittleEndianHost); Object.DWARF.IsLittleEndian = Object.IsLittleEndian; IO.mapRequired("FileHeader", Object.Header); IO.mapOptional("LoadCommands", Object.LoadCommands); 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); }