• Home
  • Raw
  • Download

Lines Matching full:io

56   static size_t size(IO &io, std::vector<Section> &seq) {  in size()
59 static Section& element(IO &io, std::vector<Section> &seq, size_t index) { in element()
68 static size_t size(IO &io, std::vector<Symbol> &seq) { in size()
71 static Symbol& element(IO &io, std::vector<Symbol> &seq, size_t index) { in element()
81 static size_t size(IO &io, Relocations &seq) { in size()
84 static Relocation& element(IO &io, Relocations &seq, size_t index) { in element()
94 static size_t size(IO &io, ContentBytes &seq) { in size()
97 static Hex8& element(IO &io, ContentBytes &seq, size_t index) { in element()
109 static size_t size(IO &io, IndirectSymbols &seq) { in size()
112 static uint32_t& element(IO &io, IndirectSymbols &seq, size_t index) { in element()
122 static void enumeration(IO &io, lld::MachOLinkingContext::Arch &value) { in enumeration()
123 io.enumCase(value, "unknown",lld::MachOLinkingContext::arch_unknown); in enumeration()
124 io.enumCase(value, "ppc", lld::MachOLinkingContext::arch_ppc); in enumeration()
125 io.enumCase(value, "x86", lld::MachOLinkingContext::arch_x86); in enumeration()
126 io.enumCase(value, "x86_64", lld::MachOLinkingContext::arch_x86_64); in enumeration()
127 io.enumCase(value, "armv6", lld::MachOLinkingContext::arch_armv6); in enumeration()
128 io.enumCase(value, "armv7", lld::MachOLinkingContext::arch_armv7); in enumeration()
129 io.enumCase(value, "armv7s", lld::MachOLinkingContext::arch_armv7s); in enumeration()
130 io.enumCase(value, "arm64", lld::MachOLinkingContext::arch_arm64); in enumeration()
136 static void enumeration(IO &io, lld::MachOLinkingContext::OS &value) { in enumeration()
137 io.enumCase(value, "unknown", in enumeration()
139 io.enumCase(value, "Mac OS X", in enumeration()
141 io.enumCase(value, "iOS", in enumeration()
143 io.enumCase(value, "iOS Simulator", in enumeration()
151 static void enumeration(IO &io, HeaderFileType &value) { in enumeration()
152 io.enumCase(value, "MH_OBJECT", llvm::MachO::MH_OBJECT); in enumeration()
153 io.enumCase(value, "MH_DYLIB", llvm::MachO::MH_DYLIB); in enumeration()
154 io.enumCase(value, "MH_EXECUTE", llvm::MachO::MH_EXECUTE); in enumeration()
155 io.enumCase(value, "MH_BUNDLE", llvm::MachO::MH_BUNDLE); in enumeration()
162 static void bitset(IO &io, FileFlags &value) { in bitset()
163 io.bitSetCase(value, "MH_TWOLEVEL", in bitset()
165 io.bitSetCase(value, "MH_SUBSECTIONS_VIA_SYMBOLS", in bitset()
173 static void enumeration(IO &io, SectionType &value) { in enumeration()
174 io.enumCase(value, "S_REGULAR", in enumeration()
176 io.enumCase(value, "S_ZEROFILL", in enumeration()
178 io.enumCase(value, "S_CSTRING_LITERALS", in enumeration()
180 io.enumCase(value, "S_4BYTE_LITERALS", in enumeration()
182 io.enumCase(value, "S_8BYTE_LITERALS", in enumeration()
184 io.enumCase(value, "S_LITERAL_POINTERS", in enumeration()
186 io.enumCase(value, "S_NON_LAZY_SYMBOL_POINTERS", in enumeration()
188 io.enumCase(value, "S_LAZY_SYMBOL_POINTERS", in enumeration()
190 io.enumCase(value, "S_SYMBOL_STUBS", in enumeration()
192 io.enumCase(value, "S_MOD_INIT_FUNC_POINTERS", in enumeration()
194 io.enumCase(value, "S_MOD_TERM_FUNC_POINTERS", in enumeration()
196 io.enumCase(value, "S_COALESCED", in enumeration()
198 io.enumCase(value, "S_GB_ZEROFILL", in enumeration()
200 io.enumCase(value, "S_INTERPOSING", in enumeration()
202 io.enumCase(value, "S_16BYTE_LITERALS", in enumeration()
204 io.enumCase(value, "S_DTRACE_DOF", in enumeration()
206 io.enumCase(value, "S_LAZY_DYLIB_SYMBOL_POINTERS", in enumeration()
208 io.enumCase(value, "S_THREAD_LOCAL_REGULAR", in enumeration()
210 io.enumCase(value, "S_THREAD_LOCAL_ZEROFILL", in enumeration()
212 io.enumCase(value, "S_THREAD_LOCAL_VARIABLES", in enumeration()
214 io.enumCase(value, "S_THREAD_LOCAL_VARIABLE_POINTERS", in enumeration()
216 io.enumCase(value, "S_THREAD_LOCAL_INIT_FUNCTION_POINTERS", in enumeration()
223 static void bitset(IO &io, SectionAttr &value) { in bitset()
224 io.bitSetCase(value, "S_ATTR_PURE_INSTRUCTIONS", in bitset()
226 io.bitSetCase(value, "S_ATTR_SOME_INSTRUCTIONS", in bitset()
228 io.bitSetCase(value, "S_ATTR_NO_DEAD_STRIP", in bitset()
230 io.bitSetCase(value, "S_ATTR_EXT_RELOC", in bitset()
232 io.bitSetCase(value, "S_ATTR_LOC_RELOC", in bitset()
234 io.bitSetCase(value, "S_ATTR_DEBUG", in bitset()
264 static void enumeration(IO &io, NListType &value) { in enumeration()
265 io.enumCase(value, "N_UNDF", llvm::MachO::N_UNDF); in enumeration()
266 io.enumCase(value, "N_ABS", llvm::MachO::N_ABS); in enumeration()
267 io.enumCase(value, "N_SECT", llvm::MachO::N_SECT); in enumeration()
268 io.enumCase(value, "N_PBUD", llvm::MachO::N_PBUD); in enumeration()
269 io.enumCase(value, "N_INDR", llvm::MachO::N_INDR); in enumeration()
275 static void bitset(IO &io, SymbolScope &value) { in bitset()
276 io.bitSetCase(value, "N_EXT", llvm::MachO::N_EXT); in bitset()
277 io.bitSetCase(value, "N_PEXT", llvm::MachO::N_PEXT); in bitset()
283 static void bitset(IO &io, SymbolDesc &value) { in bitset()
284 io.bitSetCase(value, "N_NO_DEAD_STRIP", llvm::MachO::N_NO_DEAD_STRIP); in bitset()
285 io.bitSetCase(value, "N_WEAK_REF", llvm::MachO::N_WEAK_REF); in bitset()
286 io.bitSetCase(value, "N_WEAK_DEF", llvm::MachO::N_WEAK_DEF); in bitset()
287 io.bitSetCase(value, "N_ARM_THUMB_DEF", llvm::MachO::N_ARM_THUMB_DEF); in bitset()
288 io.bitSetCase(value, "N_SYMBOL_RESOLVER", llvm::MachO::N_SYMBOL_RESOLVER); in bitset()
296 static void mapping(IO &io, Section &sect) { in mapping()
297 io.mapRequired("segment", sect.segmentName); in mapping()
298 io.mapRequired("section", sect.sectionName); in mapping()
299 io.mapRequired("type", sect.type); in mapping()
300 io.mapOptional("attributes", sect.attributes); in mapping()
301 io.mapOptional("alignment", sect.alignment, (SectionAlignment)1); in mapping()
302 io.mapRequired("address", sect.address); in mapping()
306 io.mapOptional("size", size); in mapping()
307 if (!io.outputting()) { in mapping()
313 io, sect.content); in mapping()
314 io.mapOptional("content", content->_normalizedContent); in mapping()
316 io.mapOptional("relocations", sect.relocations); in mapping()
317 io.mapOptional("indirect-syms", sect.indirectSymbols); in mapping()
321 NormalizedContent(IO &io) : _io(io) {} in NormalizedContent()
322 NormalizedContent(IO &io, ArrayRef<uint8_t> content) : _io(io) { in NormalizedContent()
328 ArrayRef<uint8_t> denormalize(IO &io) { in denormalize()
331 YamlContext *info = reinterpret_cast<YamlContext *>(io.getContext()); in denormalize()
343 IO &_io;
351 static void mapping(IO &io, Relocation &reloc) { in mapping()
352 io.mapRequired("offset", reloc.offset); in mapping()
353 io.mapOptional("scattered", reloc.scattered, false); in mapping()
354 io.mapRequired("type", reloc.type); in mapping()
355 io.mapRequired("length", reloc.length); in mapping()
356 io.mapRequired("pc-rel", reloc.pcRel); in mapping()
358 io.mapRequired("extern", reloc.isExtern); in mapping()
360 io.mapRequired("value", reloc.value); in mapping()
362 io.mapRequired("symbol", reloc.symbol); in mapping()
369 static void enumeration(IO &io, RelocationInfoType &value) { in enumeration()
370 YamlContext *info = reinterpret_cast<YamlContext *>(io.getContext()); in enumeration()
376 io.enumCase(value, "X86_64_RELOC_UNSIGNED", in enumeration()
378 io.enumCase(value, "X86_64_RELOC_SIGNED", in enumeration()
380 io.enumCase(value, "X86_64_RELOC_BRANCH", in enumeration()
382 io.enumCase(value, "X86_64_RELOC_GOT_LOAD", in enumeration()
384 io.enumCase(value, "X86_64_RELOC_GOT", in enumeration()
386 io.enumCase(value, "X86_64_RELOC_SUBTRACTOR", in enumeration()
388 io.enumCase(value, "X86_64_RELOC_SIGNED_1", in enumeration()
390 io.enumCase(value, "X86_64_RELOC_SIGNED_2", in enumeration()
392 io.enumCase(value, "X86_64_RELOC_SIGNED_4", in enumeration()
394 io.enumCase(value, "X86_64_RELOC_TLV", in enumeration()
398 io.enumCase(value, "GENERIC_RELOC_VANILLA", in enumeration()
400 io.enumCase(value, "GENERIC_RELOC_PAIR", in enumeration()
402 io.enumCase(value, "GENERIC_RELOC_SECTDIFF", in enumeration()
404 io.enumCase(value, "GENERIC_RELOC_LOCAL_SECTDIFF", in enumeration()
406 io.enumCase(value, "GENERIC_RELOC_TLV", in enumeration()
412 io.enumCase(value, "ARM_RELOC_VANILLA", in enumeration()
414 io.enumCase(value, "ARM_RELOC_PAIR", in enumeration()
416 io.enumCase(value, "ARM_RELOC_SECTDIFF", in enumeration()
418 io.enumCase(value, "ARM_RELOC_LOCAL_SECTDIFF", in enumeration()
420 io.enumCase(value, "ARM_RELOC_BR24", in enumeration()
422 io.enumCase(value, "ARM_THUMB_RELOC_BR22", in enumeration()
424 io.enumCase(value, "ARM_RELOC_HALF", in enumeration()
426 io.enumCase(value, "ARM_RELOC_HALF_SECTDIFF", in enumeration()
430 io.enumCase(value, "ARM64_RELOC_UNSIGNED", in enumeration()
432 io.enumCase(value, "ARM64_RELOC_SUBTRACTOR", in enumeration()
434 io.enumCase(value, "ARM64_RELOC_BRANCH26", in enumeration()
436 io.enumCase(value, "ARM64_RELOC_PAGE21", in enumeration()
438 io.enumCase(value, "ARM64_RELOC_PAGEOFF12", in enumeration()
440 io.enumCase(value, "ARM64_RELOC_GOT_LOAD_PAGE21", in enumeration()
442 io.enumCase(value, "ARM64_RELOC_GOT_LOAD_PAGEOFF12", in enumeration()
444 io.enumCase(value, "ARM64_RELOC_POINTER_TO_GOT", in enumeration()
446 io.enumCase(value, "ARM64_RELOC_TLVP_LOAD_PAGE21", in enumeration()
448 io.enumCase(value, "ARM64_RELOC_TLVP_LOAD_PAGEOFF12", in enumeration()
450 io.enumCase(value, "ARM64_RELOC_ADDEND", in enumeration()
462 static void mapping(IO &io, Symbol& sym) { in mapping()
463 io.mapRequired("name", sym.name); in mapping()
464 io.mapRequired("type", sym.type); in mapping()
465 io.mapOptional("scope", sym.scope, SymbolScope(0)); in mapping()
466 io.mapOptional("sect", sym.sect, (uint8_t)0); in mapping()
472 io.mapOptional("desc", t2, Hex16(0)); in mapping()
476 io.mapOptional("desc", sym.desc, SymbolDesc(0)); in mapping()
478 io.mapRequired("value", sym.value); in mapping()
530 static void mapping(IO &io, Segment& seg) { in mapping()
531 io.mapRequired("name", seg.name); in mapping()
532 io.mapRequired("address", seg.address); in mapping()
533 io.mapRequired("size", seg.size); in mapping()
534 io.mapRequired("init-access", seg.init_access); in mapping()
535 io.mapRequired("max-access", seg.max_access); in mapping()
541 static void enumeration(IO &io, LoadCommandType &value) { in enumeration()
542 io.enumCase(value, "LC_LOAD_DYLIB", in enumeration()
544 io.enumCase(value, "LC_LOAD_WEAK_DYLIB", in enumeration()
546 io.enumCase(value, "LC_REEXPORT_DYLIB", in enumeration()
548 io.enumCase(value, "LC_LOAD_UPWARD_DYLIB", in enumeration()
550 io.enumCase(value, "LC_LAZY_LOAD_DYLIB", in enumeration()
552 io.enumCase(value, "LC_VERSION_MIN_MACOSX", in enumeration()
554 io.enumCase(value, "LC_VERSION_MIN_IPHONEOS", in enumeration()
556 io.enumCase(value, "LC_VERSION_MIN_TVOS", in enumeration()
558 io.enumCase(value, "LC_VERSION_MIN_WATCHOS", in enumeration()
565 static void mapping(IO &io, DependentDylib& dylib) { in mapping()
566 io.mapRequired("path", dylib.path); in mapping()
567 io.mapOptional("kind", dylib.kind, in mapping()
569 io.mapOptional("compat-version", dylib.compatVersion, in mapping()
571 io.mapOptional("current-version", dylib.currentVersion, in mapping()
578 static void enumeration(IO &io, RebaseType &value) { in enumeration()
579 io.enumCase(value, "REBASE_TYPE_POINTER", in enumeration()
581 io.enumCase(value, "REBASE_TYPE_TEXT_PCREL32", in enumeration()
583 io.enumCase(value, "REBASE_TYPE_TEXT_ABSOLUTE32", in enumeration()
591 static void mapping(IO &io, RebaseLocation& rebase) { in mapping()
592 io.mapRequired("segment-index", rebase.segIndex); in mapping()
593 io.mapRequired("segment-offset", rebase.segOffset); in mapping()
594 io.mapOptional("kind", rebase.kind, in mapping()
603 static void enumeration(IO &io, BindType &value) { in enumeration()
604 io.enumCase(value, "BIND_TYPE_POINTER", in enumeration()
606 io.enumCase(value, "BIND_TYPE_TEXT_ABSOLUTE32", in enumeration()
608 io.enumCase(value, "BIND_TYPE_TEXT_PCREL32", in enumeration()
615 static void mapping(IO &io, BindLocation &bind) { in mapping()
616 io.mapRequired("segment-index", bind.segIndex); in mapping()
617 io.mapRequired("segment-offset", bind.segOffset); in mapping()
618 io.mapOptional("kind", bind.kind, in mapping()
620 io.mapOptional("can-be-null", bind.canBeNull, false); in mapping()
621 io.mapRequired("ordinal", bind.ordinal); in mapping()
622 io.mapRequired("symbol-name", bind.symbolName); in mapping()
623 io.mapOptional("addend", bind.addend, Hex64(0)); in mapping()
630 static void enumeration(IO &io, ExportSymbolKind &value) { in enumeration()
631 io.enumCase(value, "EXPORT_SYMBOL_FLAGS_KIND_REGULAR", in enumeration()
633 io.enumCase(value, "EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL", in enumeration()
635 io.enumCase(value, "EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE", in enumeration()
642 static void bitset(IO &io, ExportFlags &value) { in bitset()
643 io.bitSetCase(value, "EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION", in bitset()
645 io.bitSetCase(value, "EXPORT_SYMBOL_FLAGS_REEXPORT", in bitset()
647 io.bitSetCase(value, "EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER", in bitset()
655 static void mapping(IO &io, Export &exp) { in mapping()
656 io.mapRequired("name", exp.name); in mapping()
657 io.mapOptional("offset", exp.offset); in mapping()
658 io.mapOptional("kind", exp.kind, in mapping()
660 if (!io.outputting() || exp.flags) in mapping()
661 io.mapOptional("flags", exp.flags); in mapping()
662 io.mapOptional("other", exp.otherOffset, Hex32(0)); in mapping()
663 io.mapOptional("other-name", exp.otherName, StringRef()); in mapping()
669 static void enumeration(IO &io, DataRegionType &value) { in enumeration()
670 io.enumCase(value, "DICE_KIND_DATA", in enumeration()
672 io.enumCase(value, "DICE_KIND_JUMP_TABLE8", in enumeration()
674 io.enumCase(value, "DICE_KIND_JUMP_TABLE16", in enumeration()
676 io.enumCase(value, "DICE_KIND_JUMP_TABLE32", in enumeration()
678 io.enumCase(value, "DICE_KIND_ABS_JUMP_TABLE32", in enumeration()
685 static void mapping(IO &io, DataInCode &entry) { in mapping()
686 io.mapRequired("offset", entry.offset); in mapping()
687 io.mapRequired("length", entry.length); in mapping()
688 io.mapRequired("kind", entry.kind); in mapping()
713 static void mapping(IO &io, NormalizedFile &file) { in mapping()
714 io.mapRequired("arch", file.arch); in mapping()
715 io.mapRequired("file-type", file.fileType); in mapping()
716 io.mapOptional("flags", file.flags); in mapping()
717 io.mapOptional("dependents", file.dependentDylibs); in mapping()
718 io.mapOptional("install-name", file.installName, StringRef()); in mapping()
719 io.mapOptional("compat-version", file.compatVersion, PackedVersion(0x10000)); in mapping()
720 io.mapOptional("current-version", file.currentVersion, PackedVersion(0x10000)); in mapping()
721 io.mapOptional("has-UUID", file.hasUUID, true); in mapping()
722 io.mapOptional("rpaths", file.rpaths); in mapping()
723 io.mapOptional("entry-point", file.entryAddress, Hex64(0)); in mapping()
724 io.mapOptional("stack-size", file.stackSize, Hex64(0)); in mapping()
725 io.mapOptional("source-version", file.sourceVersion, Hex64(0)); in mapping()
726 io.mapOptional("OS", file.os); in mapping()
727 io.mapOptional("min-os-version", file.minOSverson, PackedVersion(0)); in mapping()
728 io.mapOptional("min-os-version-kind", file.minOSVersionKind, (LoadCommandType)0); in mapping()
729 io.mapOptional("sdk-version", file.sdkVersion, PackedVersion(0)); in mapping()
730 io.mapOptional("segments", file.segments); in mapping()
731 io.mapOptional("sections", file.sections); in mapping()
732 io.mapOptional("local-symbols", file.localSymbols); in mapping()
733 io.mapOptional("global-symbols", file.globalSymbols); in mapping()
734 io.mapOptional("undefined-symbols",file.undefinedSymbols); in mapping()
735 io.mapOptional("page-size", file.pageSize, Hex32(4096)); in mapping()
736 io.mapOptional("rebasings", file.rebasingInfo); in mapping()
737 io.mapOptional("bindings", file.bindingInfo); in mapping()
738 io.mapOptional("weak-bindings", file.weakBindingInfo); in mapping()
739 io.mapOptional("lazy-bindings", file.lazyBindingInfo); in mapping()
740 io.mapOptional("exports", file.exportInfo); in mapping()
741 io.mapOptional("dataInCode", file.dataInCode); in mapping()
743 static std::string validate(IO &io, NormalizedFile &file) { return {}; } in validate()
754 bool MachOYamlIOTaggedDocumentHandler::handledDocTag(llvm::yaml::IO &io, in handledDocTag() argument
756 if (!io.mapTag("!mach-o")) in handledDocTag()
760 YamlContext *info = reinterpret_cast<YamlContext *>(io.getContext()); in handledDocTag()
764 MappingTraits<NormalizedFile>::mapping(io, nf); in handledDocTag()
777 io.setError(stream.str()); in handledDocTag()
782 io.setError(Twine("file is wrong architecture. Expected (" in handledDocTag()