46void ScalarEnumerationTraits<ELFYAML::ELF_ET>::enumeration(
47 IO &IO, ELFYAML::ELF_ET &
Value) {
48#define ECase(X) IO.enumCase(Value, #X, ELF::X)
55 IO.enumFallback<Hex16>(
Value);
58void ScalarEnumerationTraits<ELFYAML::ELF_PT>::enumeration(
59 IO &IO, ELFYAML::ELF_PT &Value) {
60#define ECase(X) IO.enumCase(Value, #X, ELF::X)
69 ECase(PT_GNU_EH_FRAME);
72 ECase(PT_GNU_PROPERTY);
74 IO.enumFallback<Hex32>(Value);
77void ScalarEnumerationTraits<ELFYAML::ELF_NT>::enumeration(
78 IO &IO, ELFYAML::ELF_NT &Value) {
79#define ECase(X) IO.enumCase(Value, #X, ELF::X)
83 ECase(NT_GNU_BUILD_ATTRIBUTE_OPEN);
84 ECase(NT_GNU_BUILD_ATTRIBUTE_FUNC);
96 ECase(NT_WIN32PSTATUS);
104 ECase(NT_PPC_TM_CGPR);
105 ECase(NT_PPC_TM_CFPR);
106 ECase(NT_PPC_TM_CVMX);
107 ECase(NT_PPC_TM_CVSX);
108 ECase(NT_PPC_TM_SPR);
109 ECase(NT_PPC_TM_CTAR);
110 ECase(NT_PPC_TM_CPPR);
111 ECase(NT_PPC_TM_CDSCR);
113 ECase(NT_386_IOPERM);
114 ECase(NT_X86_XSTATE);
115 ECase(NT_S390_HIGH_GPRS);
116 ECase(NT_S390_TIMER);
117 ECase(NT_S390_TODCMP);
118 ECase(NT_S390_TODPREG);
120 ECase(NT_S390_PREFIX);
121 ECase(NT_S390_LAST_BREAK);
122 ECase(NT_S390_SYSTEM_CALL);
124 ECase(NT_S390_VXRS_LOW);
125 ECase(NT_S390_VXRS_HIGH);
126 ECase(NT_S390_GS_CB);
127 ECase(NT_S390_GS_BC);
130 ECase(NT_ARM_HW_BREAK);
131 ECase(NT_ARM_HW_WATCH);
133 ECase(NT_ARM_PAC_MASK);
134 ECase(NT_ARM_TAGGED_ADDR_CTRL);
144 ECase(NT_LLVM_HWASAN_GLOBALS);
146 ECase(NT_GNU_ABI_TAG);
148 ECase(NT_GNU_BUILD_ID);
149 ECase(NT_GNU_GOLD_VERSION);
150 ECase(NT_GNU_PROPERTY_TYPE_0);
152 ECase(NT_FREEBSD_ABI_TAG);
153 ECase(NT_FREEBSD_NOINIT_TAG);
154 ECase(NT_FREEBSD_ARCH_TAG);
155 ECase(NT_FREEBSD_FEATURE_CTL);
157 ECase(NT_FREEBSD_THRMISC);
158 ECase(NT_FREEBSD_PROCSTAT_PROC);
159 ECase(NT_FREEBSD_PROCSTAT_FILES);
160 ECase(NT_FREEBSD_PROCSTAT_VMMAP);
161 ECase(NT_FREEBSD_PROCSTAT_GROUPS);
162 ECase(NT_FREEBSD_PROCSTAT_UMASK);
163 ECase(NT_FREEBSD_PROCSTAT_RLIMIT);
164 ECase(NT_FREEBSD_PROCSTAT_OSREL);
165 ECase(NT_FREEBSD_PROCSTAT_PSSTRINGS);
166 ECase(NT_FREEBSD_PROCSTAT_AUXV);
168 ECase(NT_NETBSDCORE_PROCINFO);
169 ECase(NT_NETBSDCORE_AUXV);
170 ECase(NT_NETBSDCORE_LWPSTATUS);
172 ECase(NT_OPENBSD_PROCINFO);
173 ECase(NT_OPENBSD_AUXV);
174 ECase(NT_OPENBSD_REGS);
175 ECase(NT_OPENBSD_FPREGS);
176 ECase(NT_OPENBSD_XFPREGS);
177 ECase(NT_OPENBSD_WCOOKIE);
179 ECase(NT_AMD_HSA_CODE_OBJECT_VERSION);
180 ECase(NT_AMD_HSA_HSAIL);
181 ECase(NT_AMD_HSA_ISA_VERSION);
182 ECase(NT_AMD_HSA_METADATA);
183 ECase(NT_AMD_HSA_ISA_NAME);
184 ECase(NT_AMD_PAL_METADATA);
186 ECase(NT_AMDGPU_METADATA);
188 ECase(NT_ANDROID_TYPE_IDENT);
189 ECase(NT_ANDROID_TYPE_KUSER);
190 ECase(NT_ANDROID_TYPE_MEMTAG);
192 IO.enumFallback<Hex32>(
Value);
195void ScalarEnumerationTraits<ELFYAML::ELF_EM>::enumeration(
196 IO &IO, ELFYAML::ELF_EM &Value) {
197#define ECase(X) IO.enumCase(Value, #X, ELF::X)
208 ECase(EM_MIPS_RS3_LE);
211 ECase(EM_SPARC32PLUS);
274 ECase(EM_ARC_COMPACT);
294 ECase(EM_ALTERA_NIOS2);
308 ECase(EM_VIDEOCORE3);
309 ECase(EM_LATTICEMICO32);
314 ECase(EM_MMDSP_PLUS);
315 ECase(EM_CYPRESS_M8C);
330 ECase(EM_MCST_ELBRUS);
342 ECase(EM_MICROBLAZE);
345 ECase(EM_CLOUDSHIELD);
348 ECase(EM_ARC_COMPACT2);
351 ECase(EM_VIDEOCORE5);
362 IO.enumFallback<Hex16>(
Value);
365void ScalarEnumerationTraits<ELFYAML::ELF_ELFCLASS>::enumeration(
366 IO &IO, ELFYAML::ELF_ELFCLASS &Value) {
367#define ECase(X) IO.enumCase(Value, #X, ELF::X)
375void ScalarEnumerationTraits<ELFYAML::ELF_ELFDATA>::enumeration(
376 IO &IO, ELFYAML::ELF_ELFDATA &Value) {
377#define ECase(X) IO.enumCase(Value, #X, ELF::X)
386void ScalarEnumerationTraits<ELFYAML::ELF_ELFOSABI>::enumeration(
387 IO &IO, ELFYAML::ELF_ELFOSABI &Value) {
388#define ECase(X) IO.enumCase(Value, #X, ELF::X)
389 ECase(ELFOSABI_NONE);
390 ECase(ELFOSABI_HPUX);
391 ECase(ELFOSABI_NETBSD);
393 ECase(ELFOSABI_LINUX);
394 ECase(ELFOSABI_HURD);
395 ECase(ELFOSABI_SOLARIS);
397 ECase(ELFOSABI_IRIX);
398 ECase(ELFOSABI_FREEBSD);
399 ECase(ELFOSABI_TRU64);
400 ECase(ELFOSABI_MODESTO);
401 ECase(ELFOSABI_OPENBSD);
402 ECase(ELFOSABI_OPENVMS);
404 ECase(ELFOSABI_AROS);
405 ECase(ELFOSABI_FENIXOS);
406 ECase(ELFOSABI_CLOUDABI);
407 ECase(ELFOSABI_AMDGPU_HSA);
408 ECase(ELFOSABI_AMDGPU_PAL);
409 ECase(ELFOSABI_AMDGPU_MESA3D);
411 ECase(ELFOSABI_ARM_FDPIC);
412 ECase(ELFOSABI_C6000_ELFABI);
413 ECase(ELFOSABI_C6000_LINUX);
414 ECase(ELFOSABI_STANDALONE);
416 IO.enumFallback<Hex8>(
Value);
419void ScalarBitSetTraits<ELFYAML::ELF_EF>::bitset(IO &IO,
420 ELFYAML::ELF_EF &Value) {
421 const auto *
Object =
static_cast<ELFYAML::Object *
>(IO.getContext());
422 assert(Object &&
"The IO context is not initialized");
423#define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
424#define BCaseMask(X, M) IO.maskedBitSetCase(Value, #X, ELF::X, ELF::M)
425 switch (
Object->getMachine()) {
427 BCase(EF_ARM_SOFT_FLOAT);
428 BCase(EF_ARM_VFP_FLOAT);
429 BCaseMask(EF_ARM_EABI_UNKNOWN, EF_ARM_EABIMASK);
430 BCaseMask(EF_ARM_EABI_VER1, EF_ARM_EABIMASK);
431 BCaseMask(EF_ARM_EABI_VER2, EF_ARM_EABIMASK);
432 BCaseMask(EF_ARM_EABI_VER3, EF_ARM_EABIMASK);
433 BCaseMask(EF_ARM_EABI_VER4, EF_ARM_EABIMASK);
434 BCaseMask(EF_ARM_EABI_VER5, EF_ARM_EABIMASK);
438 BCase(EF_MIPS_NOREORDER);
442 BCase(EF_MIPS_32BITMODE);
444 BCase(EF_MIPS_NAN2008);
445 BCase(EF_MIPS_MICROMIPS);
446 BCase(EF_MIPS_ARCH_ASE_M16);
447 BCase(EF_MIPS_ARCH_ASE_MDMX);
450 BCaseMask(EF_MIPS_ABI_EABI32, EF_MIPS_ABI);
451 BCaseMask(EF_MIPS_ABI_EABI64, EF_MIPS_ABI);
452 BCaseMask(EF_MIPS_MACH_3900, EF_MIPS_MACH);
453 BCaseMask(EF_MIPS_MACH_4010, EF_MIPS_MACH);
454 BCaseMask(EF_MIPS_MACH_4100, EF_MIPS_MACH);
455 BCaseMask(EF_MIPS_MACH_4650, EF_MIPS_MACH);
456 BCaseMask(EF_MIPS_MACH_4120, EF_MIPS_MACH);
457 BCaseMask(EF_MIPS_MACH_4111, EF_MIPS_MACH);
458 BCaseMask(EF_MIPS_MACH_SB1, EF_MIPS_MACH);
459 BCaseMask(EF_MIPS_MACH_OCTEON, EF_MIPS_MACH);
460 BCaseMask(EF_MIPS_MACH_XLR, EF_MIPS_MACH);
461 BCaseMask(EF_MIPS_MACH_OCTEON2, EF_MIPS_MACH);
462 BCaseMask(EF_MIPS_MACH_OCTEON3, EF_MIPS_MACH);
463 BCaseMask(EF_MIPS_MACH_5400, EF_MIPS_MACH);
464 BCaseMask(EF_MIPS_MACH_5900, EF_MIPS_MACH);
465 BCaseMask(EF_MIPS_MACH_5500, EF_MIPS_MACH);
466 BCaseMask(EF_MIPS_MACH_9000, EF_MIPS_MACH);
467 BCaseMask(EF_MIPS_MACH_LS2E, EF_MIPS_MACH);
468 BCaseMask(EF_MIPS_MACH_LS2F, EF_MIPS_MACH);
469 BCaseMask(EF_MIPS_MACH_LS3A, EF_MIPS_MACH);
475 BCaseMask(EF_MIPS_ARCH_32, EF_MIPS_ARCH);
476 BCaseMask(EF_MIPS_ARCH_64, EF_MIPS_ARCH);
477 BCaseMask(EF_MIPS_ARCH_32R2, EF_MIPS_ARCH);
478 BCaseMask(EF_MIPS_ARCH_64R2, EF_MIPS_ARCH);
479 BCaseMask(EF_MIPS_ARCH_32R6, EF_MIPS_ARCH);
480 BCaseMask(EF_MIPS_ARCH_64R6, EF_MIPS_ARCH);
483 BCaseMask(EF_HEXAGON_MACH_V2, EF_HEXAGON_MACH);
484 BCaseMask(EF_HEXAGON_MACH_V3, EF_HEXAGON_MACH);
485 BCaseMask(EF_HEXAGON_MACH_V4, EF_HEXAGON_MACH);
486 BCaseMask(EF_HEXAGON_MACH_V5, EF_HEXAGON_MACH);
487 BCaseMask(EF_HEXAGON_MACH_V55, EF_HEXAGON_MACH);
488 BCaseMask(EF_HEXAGON_MACH_V60, EF_HEXAGON_MACH);
489 BCaseMask(EF_HEXAGON_MACH_V62, EF_HEXAGON_MACH);
490 BCaseMask(EF_HEXAGON_MACH_V65, EF_HEXAGON_MACH);
491 BCaseMask(EF_HEXAGON_MACH_V66, EF_HEXAGON_MACH);
492 BCaseMask(EF_HEXAGON_MACH_V67, EF_HEXAGON_MACH);
493 BCaseMask(EF_HEXAGON_MACH_V67T, EF_HEXAGON_MACH);
494 BCaseMask(EF_HEXAGON_MACH_V68, EF_HEXAGON_MACH);
495 BCaseMask(EF_HEXAGON_MACH_V69, EF_HEXAGON_MACH);
496 BCaseMask(EF_HEXAGON_MACH_V71, EF_HEXAGON_MACH);
497 BCaseMask(EF_HEXAGON_MACH_V71T, EF_HEXAGON_MACH);
498 BCaseMask(EF_HEXAGON_MACH_V73, EF_HEXAGON_MACH);
499 BCaseMask(EF_HEXAGON_MACH_V75, EF_HEXAGON_MACH);
500 BCaseMask(EF_HEXAGON_ISA_V2, EF_HEXAGON_ISA);
501 BCaseMask(EF_HEXAGON_ISA_V3, EF_HEXAGON_ISA);
502 BCaseMask(EF_HEXAGON_ISA_V4, EF_HEXAGON_ISA);
503 BCaseMask(EF_HEXAGON_ISA_V5, EF_HEXAGON_ISA);
504 BCaseMask(EF_HEXAGON_ISA_V55, EF_HEXAGON_ISA);
505 BCaseMask(EF_HEXAGON_ISA_V60, EF_HEXAGON_ISA);
506 BCaseMask(EF_HEXAGON_ISA_V62, EF_HEXAGON_ISA);
507 BCaseMask(EF_HEXAGON_ISA_V65, EF_HEXAGON_ISA);
508 BCaseMask(EF_HEXAGON_ISA_V66, EF_HEXAGON_ISA);
509 BCaseMask(EF_HEXAGON_ISA_V67, EF_HEXAGON_ISA);
510 BCaseMask(EF_HEXAGON_ISA_V68, EF_HEXAGON_ISA);
511 BCaseMask(EF_HEXAGON_ISA_V69, EF_HEXAGON_ISA);
512 BCaseMask(EF_HEXAGON_ISA_V71, EF_HEXAGON_ISA);
513 BCaseMask(EF_HEXAGON_ISA_V73, EF_HEXAGON_ISA);
514 BCaseMask(EF_HEXAGON_ISA_V75, EF_HEXAGON_ISA);
517 BCaseMask(EF_AVR_ARCH_AVR1, EF_AVR_ARCH_MASK);
518 BCaseMask(EF_AVR_ARCH_AVR2, EF_AVR_ARCH_MASK);
519 BCaseMask(EF_AVR_ARCH_AVR25, EF_AVR_ARCH_MASK);
520 BCaseMask(EF_AVR_ARCH_AVR3, EF_AVR_ARCH_MASK);
521 BCaseMask(EF_AVR_ARCH_AVR31, EF_AVR_ARCH_MASK);
522 BCaseMask(EF_AVR_ARCH_AVR35, EF_AVR_ARCH_MASK);
523 BCaseMask(EF_AVR_ARCH_AVR4, EF_AVR_ARCH_MASK);
524 BCaseMask(EF_AVR_ARCH_AVR5, EF_AVR_ARCH_MASK);
525 BCaseMask(EF_AVR_ARCH_AVR51, EF_AVR_ARCH_MASK);
526 BCaseMask(EF_AVR_ARCH_AVR6, EF_AVR_ARCH_MASK);
527 BCaseMask(EF_AVR_ARCH_AVRTINY, EF_AVR_ARCH_MASK);
528 BCaseMask(EF_AVR_ARCH_XMEGA1, EF_AVR_ARCH_MASK);
529 BCaseMask(EF_AVR_ARCH_XMEGA2, EF_AVR_ARCH_MASK);
530 BCaseMask(EF_AVR_ARCH_XMEGA3, EF_AVR_ARCH_MASK);
531 BCaseMask(EF_AVR_ARCH_XMEGA4, EF_AVR_ARCH_MASK);
532 BCaseMask(EF_AVR_ARCH_XMEGA5, EF_AVR_ARCH_MASK);
533 BCaseMask(EF_AVR_ARCH_XMEGA6, EF_AVR_ARCH_MASK);
534 BCaseMask(EF_AVR_ARCH_XMEGA7, EF_AVR_ARCH_MASK);
535 BCase(EF_AVR_LINKRELAX_PREPARED);
538 BCaseMask(EF_LOONGARCH_ABI_SOFT_FLOAT, EF_LOONGARCH_ABI_MODIFIER_MASK);
539 BCaseMask(EF_LOONGARCH_ABI_SINGLE_FLOAT, EF_LOONGARCH_ABI_MODIFIER_MASK);
540 BCaseMask(EF_LOONGARCH_ABI_DOUBLE_FLOAT, EF_LOONGARCH_ABI_MODIFIER_MASK);
541 BCaseMask(EF_LOONGARCH_OBJABI_V0, EF_LOONGARCH_OBJABI_MASK);
542 BCaseMask(EF_LOONGARCH_OBJABI_V1, EF_LOONGARCH_OBJABI_MASK);
546 BCaseMask(EF_RISCV_FLOAT_ABI_SOFT, EF_RISCV_FLOAT_ABI);
547 BCaseMask(EF_RISCV_FLOAT_ABI_SINGLE, EF_RISCV_FLOAT_ABI);
548 BCaseMask(EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_FLOAT_ABI);
549 BCaseMask(EF_RISCV_FLOAT_ABI_QUAD, EF_RISCV_FLOAT_ABI);
554 BCase(EF_SPARC_32PLUS);
555 BCase(EF_SPARC_SUN_US1);
556 BCase(EF_SPARC_SUN_US3);
557 BCase(EF_SPARC_HAL_R1);
560 BCase(EF_SPARC_SUN_US1);
561 BCase(EF_SPARC_SUN_US3);
562 BCase(EF_SPARC_HAL_R1);
563 BCaseMask(EF_SPARCV9_RMO, EF_SPARCV9_MM);
564 BCaseMask(EF_SPARCV9_PSO, EF_SPARCV9_MM);
565 BCaseMask(EF_SPARCV9_TSO, EF_SPARCV9_MM);
568 BCase(EF_XTENSA_XT_INSN);
569 BCaseMask(EF_XTENSA_MACH_NONE, EF_XTENSA_MACH);
570 BCase(EF_XTENSA_XT_LIT);
573 BCaseMask(EF_AMDGPU_MACH_NONE, EF_AMDGPU_MACH);
574 BCaseMask(EF_AMDGPU_MACH_R600_R600, EF_AMDGPU_MACH);
575 BCaseMask(EF_AMDGPU_MACH_R600_R630, EF_AMDGPU_MACH);
576 BCaseMask(EF_AMDGPU_MACH_R600_RS880, EF_AMDGPU_MACH);
577 BCaseMask(EF_AMDGPU_MACH_R600_RV670, EF_AMDGPU_MACH);
578 BCaseMask(EF_AMDGPU_MACH_R600_RV710, EF_AMDGPU_MACH);
579 BCaseMask(EF_AMDGPU_MACH_R600_RV730, EF_AMDGPU_MACH);
580 BCaseMask(EF_AMDGPU_MACH_R600_RV770, EF_AMDGPU_MACH);
581 BCaseMask(EF_AMDGPU_MACH_R600_CEDAR, EF_AMDGPU_MACH);
582 BCaseMask(EF_AMDGPU_MACH_R600_CYPRESS, EF_AMDGPU_MACH);
583 BCaseMask(EF_AMDGPU_MACH_R600_JUNIPER, EF_AMDGPU_MACH);
584 BCaseMask(EF_AMDGPU_MACH_R600_REDWOOD, EF_AMDGPU_MACH);
585 BCaseMask(EF_AMDGPU_MACH_R600_SUMO, EF_AMDGPU_MACH);
586 BCaseMask(EF_AMDGPU_MACH_R600_BARTS, EF_AMDGPU_MACH);
587 BCaseMask(EF_AMDGPU_MACH_R600_CAICOS, EF_AMDGPU_MACH);
588 BCaseMask(EF_AMDGPU_MACH_R600_CAYMAN, EF_AMDGPU_MACH);
589 BCaseMask(EF_AMDGPU_MACH_R600_TURKS, EF_AMDGPU_MACH);
590 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX600, EF_AMDGPU_MACH);
591 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX601, EF_AMDGPU_MACH);
592 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX602, EF_AMDGPU_MACH);
593 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX700, EF_AMDGPU_MACH);
594 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX701, EF_AMDGPU_MACH);
595 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX702, EF_AMDGPU_MACH);
596 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX703, EF_AMDGPU_MACH);
597 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX704, EF_AMDGPU_MACH);
598 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX705, EF_AMDGPU_MACH);
599 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX801, EF_AMDGPU_MACH);
600 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX802, EF_AMDGPU_MACH);
601 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX803, EF_AMDGPU_MACH);
602 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX805, EF_AMDGPU_MACH);
603 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX810, EF_AMDGPU_MACH);
604 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX900, EF_AMDGPU_MACH);
605 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX902, EF_AMDGPU_MACH);
606 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX904, EF_AMDGPU_MACH);
607 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX906, EF_AMDGPU_MACH);
608 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX908, EF_AMDGPU_MACH);
609 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX909, EF_AMDGPU_MACH);
610 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX90A, EF_AMDGPU_MACH);
611 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX90C, EF_AMDGPU_MACH);
612 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX940, EF_AMDGPU_MACH);
613 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX941, EF_AMDGPU_MACH);
614 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX942, EF_AMDGPU_MACH);
615 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX950, EF_AMDGPU_MACH);
616 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1010, EF_AMDGPU_MACH);
617 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1011, EF_AMDGPU_MACH);
618 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1012, EF_AMDGPU_MACH);
619 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1013, EF_AMDGPU_MACH);
620 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1030, EF_AMDGPU_MACH);
621 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1031, EF_AMDGPU_MACH);
622 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1032, EF_AMDGPU_MACH);
623 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1033, EF_AMDGPU_MACH);
624 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1034, EF_AMDGPU_MACH);
625 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1035, EF_AMDGPU_MACH);
626 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1036, EF_AMDGPU_MACH);
627 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1100, EF_AMDGPU_MACH);
628 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1101, EF_AMDGPU_MACH);
629 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1102, EF_AMDGPU_MACH);
630 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1103, EF_AMDGPU_MACH);
631 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1150, EF_AMDGPU_MACH);
632 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1151, EF_AMDGPU_MACH);
633 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1152, EF_AMDGPU_MACH);
634 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1153, EF_AMDGPU_MACH);
635 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1200, EF_AMDGPU_MACH);
636 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1201, EF_AMDGPU_MACH);
637 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX9_GENERIC, EF_AMDGPU_MACH);
638 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX9_4_GENERIC, EF_AMDGPU_MACH);
639 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX10_1_GENERIC, EF_AMDGPU_MACH);
640 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX10_3_GENERIC, EF_AMDGPU_MACH);
641 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX11_GENERIC, EF_AMDGPU_MACH);
642 BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX12_GENERIC, EF_AMDGPU_MACH);
643 switch (
Object->Header.ABIVersion) {
648 BCase(EF_AMDGPU_FEATURE_XNACK_V3);
649 BCase(EF_AMDGPU_FEATURE_SRAMECC_V3);
654 std::string
Key =
"EF_AMDGPU_GENERIC_VERSION_V" + std::to_string(K);
655 IO.maskedBitSetCase(Value,
Key.c_str(),
662 BCaseMask(EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4,
663 EF_AMDGPU_FEATURE_XNACK_V4);
664 BCaseMask(EF_AMDGPU_FEATURE_XNACK_ANY_V4,
665 EF_AMDGPU_FEATURE_XNACK_V4);
666 BCaseMask(EF_AMDGPU_FEATURE_XNACK_OFF_V4,
667 EF_AMDGPU_FEATURE_XNACK_V4);
669 EF_AMDGPU_FEATURE_XNACK_V4);
670 BCaseMask(EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4,
671 EF_AMDGPU_FEATURE_SRAMECC_V4);
672 BCaseMask(EF_AMDGPU_FEATURE_SRAMECC_ANY_V4,
673 EF_AMDGPU_FEATURE_SRAMECC_V4);
674 BCaseMask(EF_AMDGPU_FEATURE_SRAMECC_OFF_V4,
675 EF_AMDGPU_FEATURE_SRAMECC_V4);
676 BCaseMask(EF_AMDGPU_FEATURE_SRAMECC_ON_V4,
677 EF_AMDGPU_FEATURE_SRAMECC_V4);
688void ScalarEnumerationTraits<ELFYAML::ELF_SHT>::enumeration(
689 IO &IO, ELFYAML::ELF_SHT &Value) {
690 const auto *
Object =
static_cast<ELFYAML::Object *
>(IO.getContext());
691 assert(Object &&
"The IO context is not initialized");
692#define ECase(X) IO.enumCase(Value, #X, ELF::X)
706 ECase(SHT_INIT_ARRAY);
707 ECase(SHT_FINI_ARRAY);
708 ECase(SHT_PREINIT_ARRAY);
710 ECase(SHT_SYMTAB_SHNDX);
713 ECase(SHT_ANDROID_REL);
714 ECase(SHT_ANDROID_RELA);
715 ECase(SHT_ANDROID_RELR);
716 ECase(SHT_LLVM_ODRTAB);
717 ECase(SHT_LLVM_LINKER_OPTIONS);
718 ECase(SHT_LLVM_CALL_GRAPH_PROFILE);
719 ECase(SHT_LLVM_ADDRSIG);
720 ECase(SHT_LLVM_DEPENDENT_LIBRARIES);
721 ECase(SHT_LLVM_SYMPART);
722 ECase(SHT_LLVM_PART_EHDR);
723 ECase(SHT_LLVM_PART_PHDR);
724 ECase(SHT_LLVM_BB_ADDR_MAP_V0);
725 ECase(SHT_LLVM_BB_ADDR_MAP);
726 ECase(SHT_LLVM_OFFLOADING);
728 ECase(SHT_GNU_ATTRIBUTES);
730 ECase(SHT_GNU_verdef);
731 ECase(SHT_GNU_verneed);
732 ECase(SHT_GNU_versym);
733 switch (
Object->getMachine()) {
735 ECase(SHT_ARM_EXIDX);
736 ECase(SHT_ARM_PREEMPTMAP);
737 ECase(SHT_ARM_ATTRIBUTES);
738 ECase(SHT_ARM_DEBUGOVERLAY);
739 ECase(SHT_ARM_OVERLAYSECTION);
742 ECase(SHT_HEX_ORDERED);
743 ECase(SHT_HEXAGON_ATTRIBUTES);
746 ECase(SHT_X86_64_UNWIND);
749 ECase(SHT_MIPS_REGINFO);
750 ECase(SHT_MIPS_OPTIONS);
751 ECase(SHT_MIPS_DWARF);
752 ECase(SHT_MIPS_ABIFLAGS);
755 ECase(SHT_RISCV_ATTRIBUTES);
758 ECase(SHT_MSP430_ATTRIBUTES);
761 ECase(SHT_AARCH64_AUTH_RELR);
762 ECase(SHT_AARCH64_MEMTAG_GLOBALS_STATIC);
763 ECase(SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC);
770 IO.enumFallback<Hex32>(
Value);
773void ScalarBitSetTraits<ELFYAML::ELF_PF>::bitset(IO &IO,
774 ELFYAML::ELF_PF &Value) {
775#define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
781void ScalarBitSetTraits<ELFYAML::ELF_SHF>::bitset(IO &IO,
782 ELFYAML::ELF_SHF &Value) {
783 const auto *
Object =
static_cast<ELFYAML::Object *
>(IO.getContext());
784#define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
788 BCase(SHF_EXECINSTR);
791 BCase(SHF_INFO_LINK);
792 BCase(SHF_LINK_ORDER);
793 BCase(SHF_OS_NONCONFORMING);
796 BCase(SHF_COMPRESSED);
797 switch (
Object->getOSAbi()) {
799 BCase(SHF_SUNW_NODISCARD);
802 BCase(SHF_GNU_RETAIN);
805 switch (
Object->getMachine()) {
807 BCase(SHF_ARM_PURECODE);
810 BCase(SHF_HEX_GPREL);
813 BCase(SHF_MIPS_NODUPES);
814 BCase(SHF_MIPS_NAMES);
815 BCase(SHF_MIPS_LOCAL);
816 BCase(SHF_MIPS_NOSTRIP);
817 BCase(SHF_MIPS_GPREL);
818 BCase(SHF_MIPS_MERGE);
819 BCase(SHF_MIPS_ADDR);
820 BCase(SHF_MIPS_STRING);
823 BCase(SHF_X86_64_LARGE);
832void ScalarEnumerationTraits<ELFYAML::ELF_SHN>::enumeration(
833 IO &IO, ELFYAML::ELF_SHN &Value) {
834 const auto *
Object =
static_cast<ELFYAML::Object *
>(IO.getContext());
835 assert(Object &&
"The IO context is not initialized");
836#define ECase(X) IO.enumCase(Value, #X, ELF::X)
838 ECase(SHN_LORESERVE);
846 ECase(SHN_HIRESERVE);
847 ECase(SHN_AMDGPU_LDS);
850 ECase(SHN_MIPS_ACOMMON);
851 ECase(SHN_MIPS_TEXT);
852 ECase(SHN_MIPS_DATA);
853 ECase(SHN_MIPS_SCOMMON);
854 ECase(SHN_MIPS_SUNDEFINED);
857 ECase(SHN_HEXAGON_SCOMMON);
858 ECase(SHN_HEXAGON_SCOMMON_1);
859 ECase(SHN_HEXAGON_SCOMMON_2);
860 ECase(SHN_HEXAGON_SCOMMON_4);
861 ECase(SHN_HEXAGON_SCOMMON_8);
863 IO.enumFallback<Hex16>(
Value);
866void ScalarEnumerationTraits<ELFYAML::ELF_STB>::enumeration(
867 IO &IO, ELFYAML::ELF_STB &Value) {
868#define ECase(X) IO.enumCase(Value, #X, ELF::X)
872 ECase(STB_GNU_UNIQUE);
874 IO.enumFallback<Hex8>(
Value);
877void ScalarEnumerationTraits<ELFYAML::ELF_STT>::enumeration(
878 IO &IO, ELFYAML::ELF_STT &Value) {
879#define ECase(X) IO.enumCase(Value, #X, ELF::X)
887 ECase(STT_GNU_IFUNC);
889 IO.enumFallback<Hex8>(
Value);
893void ScalarEnumerationTraits<ELFYAML::ELF_RSS>::enumeration(
894 IO &IO, ELFYAML::ELF_RSS &Value) {
895#define ECase(X) IO.enumCase(Value, #X, ELF::X)
903void ScalarEnumerationTraits<ELFYAML::ELF_REL>::enumeration(
904 IO &IO, ELFYAML::ELF_REL &Value) {
905 const auto *
Object =
static_cast<ELFYAML::Object *
>(IO.getContext());
906 assert(Object &&
"The IO context is not initialized");
907#define ELF_RELOC(X, Y) IO.enumCase(Value, #X, ELF::X);
908 switch (
Object->getMachine()) {
910#include "llvm/BinaryFormat/ELFRelocs/x86_64.def"
913#include "llvm/BinaryFormat/ELFRelocs/Mips.def"
916#include "llvm/BinaryFormat/ELFRelocs/Hexagon.def"
920#include "llvm/BinaryFormat/ELFRelocs/i386.def"
923#include "llvm/BinaryFormat/ELFRelocs/AArch64.def"
926#include "llvm/BinaryFormat/ELFRelocs/ARM.def"
929#include "llvm/BinaryFormat/ELFRelocs/ARC.def"
932#include "llvm/BinaryFormat/ELFRelocs/RISCV.def"
935#include "llvm/BinaryFormat/ELFRelocs/Lanai.def"
938#include "llvm/BinaryFormat/ELFRelocs/AMDGPU.def"
941#include "llvm/BinaryFormat/ELFRelocs/BPF.def"
944#include "llvm/BinaryFormat/ELFRelocs/VE.def"
947#include "llvm/BinaryFormat/ELFRelocs/CSKY.def"
950#include "llvm/BinaryFormat/ELFRelocs/PowerPC.def"
953#include "llvm/BinaryFormat/ELFRelocs/PowerPC64.def"
956#include "llvm/BinaryFormat/ELFRelocs/M68k.def"
959#include "llvm/BinaryFormat/ELFRelocs/LoongArch.def"
962#include "llvm/BinaryFormat/ELFRelocs/Xtensa.def"
969 IO.enumFallback<Hex32>(
Value);
972void ScalarEnumerationTraits<ELFYAML::ELF_DYNTAG>::enumeration(
973 IO &IO, ELFYAML::ELF_DYNTAG &Value) {
974 const auto *
Object =
static_cast<ELFYAML::Object *
>(IO.getContext());
975 assert(Object &&
"The IO context is not initialized");
978#define AARCH64_DYNAMIC_TAG(name, value)
979#define MIPS_DYNAMIC_TAG(name, value)
980#define HEXAGON_DYNAMIC_TAG(name, value)
981#define PPC_DYNAMIC_TAG(name, value)
982#define PPC64_DYNAMIC_TAG(name, value)
984#define DYNAMIC_TAG_MARKER(name, value)
986#define STRINGIFY(X) (#X)
987#define DYNAMIC_TAG(X, Y) IO.enumCase(Value, STRINGIFY(DT_##X), ELF::DT_##X);
988 switch (
Object->getMachine()) {
990#undef AARCH64_DYNAMIC_TAG
991#define AARCH64_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
992#include "llvm/BinaryFormat/DynamicTags.def"
993#undef AARCH64_DYNAMIC_TAG
994#define AARCH64_DYNAMIC_TAG(name, value)
997#undef MIPS_DYNAMIC_TAG
998#define MIPS_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
999#include "llvm/BinaryFormat/DynamicTags.def"
1000#undef MIPS_DYNAMIC_TAG
1001#define MIPS_DYNAMIC_TAG(name, value)
1004#undef HEXAGON_DYNAMIC_TAG
1005#define HEXAGON_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
1006#include "llvm/BinaryFormat/DynamicTags.def"
1007#undef HEXAGON_DYNAMIC_TAG
1008#define HEXAGON_DYNAMIC_TAG(name, value)
1011#undef PPC_DYNAMIC_TAG
1012#define PPC_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
1013#include "llvm/BinaryFormat/DynamicTags.def"
1014#undef PPC_DYNAMIC_TAG
1015#define PPC_DYNAMIC_TAG(name, value)
1018#undef PPC64_DYNAMIC_TAG
1019#define PPC64_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
1020#include "llvm/BinaryFormat/DynamicTags.def"
1021#undef PPC64_DYNAMIC_TAG
1022#define PPC64_DYNAMIC_TAG(name, value)
1025#undef RISCV_DYNAMIC_TAG
1026#define RISCV_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
1027#include "llvm/BinaryFormat/DynamicTags.def"
1028#undef RISCV_DYNAMIC_TAG
1029#define RISCV_DYNAMIC_TAG(name, value)
1032#include "llvm/BinaryFormat/DynamicTags.def"
1035#undef AARCH64_DYNAMIC_TAG
1036#undef MIPS_DYNAMIC_TAG
1037#undef HEXAGON_DYNAMIC_TAG
1038#undef PPC_DYNAMIC_TAG
1039#undef PPC64_DYNAMIC_TAG
1040#undef DYNAMIC_TAG_MARKER
1044 IO.enumFallback<Hex64>(
Value);
1047void ScalarEnumerationTraits<ELFYAML::MIPS_AFL_REG>::enumeration(
1048 IO &IO, ELFYAML::MIPS_AFL_REG &Value) {
1049#define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X)
1057void ScalarEnumerationTraits<ELFYAML::MIPS_ABI_FP>::enumeration(
1058 IO &IO, ELFYAML::MIPS_ABI_FP &Value) {
1059#define ECase(X) IO.enumCase(Value, #X, Mips::Val_GNU_MIPS_ABI_##X)
1071void ScalarEnumerationTraits<ELFYAML::MIPS_AFL_EXT>::enumeration(
1072 IO &IO, ELFYAML::MIPS_AFL_EXT &Value) {
1073#define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X)
1078 ECase(EXT_LOONGSON_3A);
1091 ECase(EXT_LOONGSON_2E);
1092 ECase(EXT_LOONGSON_2F);
1097void ScalarEnumerationTraits<ELFYAML::MIPS_ISA>::enumeration(
1098 IO &IO, ELFYAML::MIPS_ISA &Value) {
1099 IO.enumCase(Value,
"MIPS1", 1);
1100 IO.enumCase(Value,
"MIPS2", 2);
1101 IO.enumCase(Value,
"MIPS3", 3);
1102 IO.enumCase(Value,
"MIPS4", 4);
1103 IO.enumCase(Value,
"MIPS5", 5);
1104 IO.enumCase(Value,
"MIPS32", 32);
1105 IO.enumCase(Value,
"MIPS64", 64);
1106 IO.enumFallback<Hex32>(
Value);
1109void ScalarBitSetTraits<ELFYAML::MIPS_AFL_ASE>::bitset(
1110 IO &IO, ELFYAML::MIPS_AFL_ASE &Value) {
1111#define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_ASE_##X)
1130void ScalarBitSetTraits<ELFYAML::MIPS_AFL_FLAGS1>::bitset(
1131 IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &Value) {
1132#define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_FLAGS1_##X)
1137void MappingTraits<ELFYAML::SectionHeader>::mapping(
1138 IO &IO, ELFYAML::SectionHeader &SHdr) {
1139 IO.mapRequired(
"Name", SHdr.Name);
1142void MappingTraits<ELFYAML::FileHeader>::mapping(IO &IO,
1143 ELFYAML::FileHeader &FileHdr) {
1144 IO.mapRequired(
"Class", FileHdr.Class);
1145 IO.mapRequired(
"Data", FileHdr.Data);
1146 IO.mapOptional(
"OSABI", FileHdr.OSABI, ELFYAML::ELF_ELFOSABI(0));
1147 IO.mapOptional(
"ABIVersion", FileHdr.ABIVersion, Hex8(0));
1148 IO.mapRequired(
"Type", FileHdr.Type);
1149 IO.mapOptional(
"Machine", FileHdr.Machine);
1150 IO.mapOptional(
"Flags", FileHdr.Flags, ELFYAML::ELF_EF(0));
1151 IO.mapOptional(
"Entry", FileHdr.Entry, Hex64(0));
1152 IO.mapOptional(
"SectionHeaderStringTable", FileHdr.SectionHeaderStringTable);
1155 assert(!IO.outputting() ||
1156 (!FileHdr.EPhOff && !FileHdr.EPhEntSize && !FileHdr.EPhNum));
1157 IO.mapOptional(
"EPhOff", FileHdr.EPhOff);
1158 IO.mapOptional(
"EPhEntSize", FileHdr.EPhEntSize);
1159 IO.mapOptional(
"EPhNum", FileHdr.EPhNum);
1160 IO.mapOptional(
"EShEntSize", FileHdr.EShEntSize);
1161 IO.mapOptional(
"EShOff", FileHdr.EShOff);
1162 IO.mapOptional(
"EShNum", FileHdr.EShNum);
1163 IO.mapOptional(
"EShStrNdx", FileHdr.EShStrNdx);
1166void MappingTraits<ELFYAML::ProgramHeader>::mapping(
1167 IO &IO, ELFYAML::ProgramHeader &Phdr) {
1168 IO.mapRequired(
"Type", Phdr.Type);
1169 IO.mapOptional(
"Flags", Phdr.Flags, ELFYAML::ELF_PF(0));
1170 IO.mapOptional(
"FirstSec", Phdr.FirstSec);
1171 IO.mapOptional(
"LastSec", Phdr.LastSec);
1172 IO.mapOptional(
"VAddr", Phdr.VAddr, Hex64(0));
1173 IO.mapOptional(
"PAddr", Phdr.PAddr, Phdr.VAddr);
1174 IO.mapOptional(
"Align", Phdr.Align);
1175 IO.mapOptional(
"FileSize", Phdr.FileSize);
1176 IO.mapOptional(
"MemSize", Phdr.MemSize);
1177 IO.mapOptional(
"Offset", Phdr.Offset);
1180std::string MappingTraits<ELFYAML::ProgramHeader>::validate(
1181 IO &IO, ELFYAML::ProgramHeader &FileHdr) {
1182 if (!FileHdr.FirstSec && FileHdr.LastSec)
1183 return "the \"LastSec\" key can't be used without the \"FirstSec\" key";
1184 if (FileHdr.FirstSec && !FileHdr.LastSec)
1185 return "the \"FirstSec\" key can't be used without the \"LastSec\" key";
1191template <> struct ScalarTraits<StOtherPiece> {
1201template <>
struct SequenceElementTraits<StOtherPiece> {
1202 static const bool flow =
true;
1205template <>
struct ScalarTraits<ELFYAML::YAMLFlowString> {
1206 static void output(
const ELFYAML::YAMLFlowString &Val,
void *,
1211 ELFYAML::YAMLFlowString &Val) {
1216 return ScalarTraits<StringRef>::mustQuote(S);
1219template <>
struct SequenceElementTraits<ELFYAML::YAMLFlowString> {
1220 static const bool flow =
true;
1225struct NormalizedOther {
1226 NormalizedOther(IO &IO) :
YamlIO(IO) {}
1227 NormalizedOther(IO &IO, std::optional<uint8_t> Original) :
YamlIO(IO) {
1228 assert(Original &&
"This constructor is only used for outputting YAML and "
1229 "assumes a non-empty Original");
1230 std::vector<StOtherPiece> Ret;
1232 for (std::pair<StringRef, uint8_t> &
P :
1233 getFlags(Object->getMachine()).takeVector()) {
1235 if ((*Original & FlagValue) != FlagValue)
1237 *Original &= ~FlagValue;
1238 Ret.push_back({
P.first});
1241 if (*Original != 0) {
1247 Other = std::move(Ret);
1254 auto It = Flags.find(
Name);
1255 if (It != Flags.end())
1259 if (to_integer(
Name, Val))
1262 YamlIO.setError(
"an unknown value is used for symbol's 'Other' field: " +
1267 std::optional<uint8_t> denormalize(IO &) {
1269 return std::nullopt;
1271 for (StOtherPiece &Val : *
Other)
1272 Ret |= toValue(Val);
1292 if (!
YamlIO.outputting())
1315 std::optional<std::vector<StOtherPiece>>
Other;
1321void ScalarTraits<ELFYAML::YAMLIntUInt>::output(
const ELFYAML::YAMLIntUInt &Val,
1322 void *Ctx, raw_ostream &Out) {
1326StringRef ScalarTraits<ELFYAML::YAMLIntUInt>::input(StringRef Scalar,
void *Ctx,
1327 ELFYAML::YAMLIntUInt &Val) {
1328 const bool Is64 =
static_cast<ELFYAML::Object *
>(Ctx)->Header.Class ==
1330 StringRef ErrMsg =
"invalid number";
1336 if (
Scalar.starts_with(
"-")) {
1337 const int64_t MinVal = Is64 ?
INT64_MIN : INT32_MIN;
1346 unsigned long long UInt;
1353void MappingTraits<ELFYAML::Symbol>::mapping(IO &IO, ELFYAML::Symbol &Symbol) {
1354 IO.mapOptional(
"Name",
Symbol.Name, StringRef());
1355 IO.mapOptional(
"StName",
Symbol.StName);
1356 IO.mapOptional(
"Type",
Symbol.Type, ELFYAML::ELF_STT(0));
1357 IO.mapOptional(
"Section",
Symbol.Section);
1358 IO.mapOptional(
"Index",
Symbol.Index);
1359 IO.mapOptional(
"Binding",
Symbol.Binding, ELFYAML::ELF_STB(0));
1360 IO.mapOptional(
"Value",
Symbol.Value);
1361 IO.mapOptional(
"Size",
Symbol.Size);
1368 MappingNormalization<NormalizedOther, std::optional<uint8_t>> Keys(
1370 IO.mapOptional(
"Other", Keys->Other);
1373std::string MappingTraits<ELFYAML::Symbol>::validate(IO &IO,
1374 ELFYAML::Symbol &Symbol) {
1376 return "Index and Section cannot both be specified for Symbol";
1381 IO.mapOptional(
"Name", Section.Name,
StringRef());
1382 IO.mapRequired(
"Type", Section.Type);
1383 IO.mapOptional(
"Flags", Section.Flags);
1384 IO.mapOptional(
"Address", Section.Address);
1385 IO.mapOptional(
"Link", Section.Link);
1386 IO.mapOptional(
"AddressAlign", Section.AddressAlign, Hex64(0));
1387 IO.mapOptional(
"EntSize", Section.EntSize);
1388 IO.mapOptional(
"Offset", Section.Offset);
1390 IO.mapOptional(
"Content", Section.Content);
1391 IO.mapOptional(
"Size", Section.Size);
1396 assert(!IO.outputting() ||
1397 (!Section.ShOffset && !Section.ShSize && !Section.ShName &&
1398 !Section.ShFlags && !Section.ShType && !Section.ShAddrAlign));
1399 IO.mapOptional(
"ShAddrAlign", Section.ShAddrAlign);
1400 IO.mapOptional(
"ShName", Section.ShName);
1401 IO.mapOptional(
"ShOffset", Section.ShOffset);
1402 IO.mapOptional(
"ShSize", Section.ShSize);
1403 IO.mapOptional(
"ShFlags", Section.ShFlags);
1404 IO.mapOptional(
"ShType", Section.ShType);
1409 IO.mapOptional(
"Entries", Section.Entries);
1417 assert(!IO.outputting() || !Section.ContentBuf);
1418 IO.mapOptional(
"ContentArray", Section.ContentBuf);
1419 if (Section.ContentBuf) {
1420 if (Section.Content)
1421 IO.setError(
"Content and ContentArray can't be used together");
1425 IO.mapOptional(
"Info", Section.Info);
1430 IO.mapOptional(
"Content", Section.Content);
1431 IO.mapOptional(
"Entries", Section.Entries);
1432 IO.mapOptional(
"PGOAnalyses", Section.PGOAnalyses);
1437 IO.mapOptional(
"Entries", Section.Entries);
1442 IO.mapOptional(
"Bucket", Section.Bucket);
1443 IO.mapOptional(
"Chain", Section.Chain);
1447 assert(!IO.outputting() || (!Section.NBucket && !Section.NChain));
1448 IO.mapOptional(
"NChain", Section.NChain);
1449 IO.mapOptional(
"NBucket", Section.NBucket);
1454 IO.mapOptional(
"Notes", Section.Notes);
1460 IO.mapOptional(
"Header", Section.Header);
1461 IO.mapOptional(
"BloomFilter", Section.BloomFilter);
1462 IO.mapOptional(
"HashBuckets", Section.HashBuckets);
1463 IO.mapOptional(
"HashValues", Section.HashValues);
1471 IO.mapOptional(
"Info", Section.Info);
1472 IO.mapOptional(
"Entries", Section.Entries);
1477 IO.mapOptional(
"Entries", Section.Entries);
1482 IO.mapOptional(
"Info", Section.Info);
1483 IO.mapOptional(
"Dependencies", Section.VerneedV);
1488 IO.mapOptional(
"Info", Section.RelocatableSec,
StringRef());
1489 IO.mapOptional(
"Relocations", Section.Relocations);
1494 IO.mapOptional(
"Entries", Section.Entries);
1499 IO.mapOptional(
"Info", Group.
Signature);
1500 IO.mapOptional(
"Members", Group.
Members);
1505 IO.mapOptional(
"Entries", Section.Entries);
1510 IO.mapOptional(
"Symbols", Section.Symbols);
1515 IO.mapOptional(
"Pattern", Fill.
Pattern);
1516 IO.mapOptional(
"Offset", Fill.
Offset);
1517 IO.mapRequired(
"Size", Fill.
Size);
1522 IO.mapOptional(
"Offset", SHT.
Offset);
1523 IO.mapOptional(
"Sections", SHT.
Sections);
1524 IO.mapOptional(
"Excluded", SHT.
Excluded);
1525 IO.mapOptional(
"NoHeaders", SHT.
NoHeaders);
1530 IO.mapOptional(
"Options", Section.Options);
1536 IO.mapOptional(
"Libraries", Section.Libs);
1541 IO.mapOptional(
"Entries", Section.Entries);
1544void MappingTraits<ELFYAML::SectionOrType>::mapping(
1551 IO.mapOptional(
"Entries", Section.Entries);
1556 IO.mapOptional(
"Version", Section.Version, Hex16(0));
1557 IO.mapRequired(
"ISA", Section.ISALevel);
1558 IO.mapOptional(
"ISARevision", Section.ISARevision, Hex8(0));
1559 IO.mapOptional(
"ISAExtension", Section.ISAExtension,
1561 IO.mapOptional(
"ASEs", Section.ASEs, ELFYAML::MIPS_AFL_ASE(0));
1562 IO.mapOptional(
"FpABI", Section.FpABI,
1564 IO.mapOptional(
"GPRSize", Section.GPRSize,
1566 IO.mapOptional(
"CPR1Size", Section.CPR1Size,
1568 IO.mapOptional(
"CPR2Size", Section.CPR2Size,
1570 IO.mapOptional(
"Flags1", Section.Flags1, ELFYAML::MIPS_AFL_FLAGS1(0));
1571 IO.mapOptional(
"Flags2", Section.Flags2, Hex32(0));
1576 IO.mapRequired(Key, Val);
1581 IO.mapRequired(Key, Val);
1589void MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::mapping(
1590 IO &IO, std::unique_ptr<ELFYAML::Chunk> &Section) {
1591 ELFYAML::ELF_SHT
Type;
1593 if (IO.outputting()) {
1594 if (
auto *S = dyn_cast<ELFYAML::Section>(Section.get()))
1596 else if (
auto *SHT = dyn_cast<ELFYAML::SectionHeaderTable>(Section.get()))
1597 TypeStr = SHT->TypeStr;
1603 IO.mapRequired(
"Type", Type);
1606 if (TypeStr ==
"Fill") {
1607 assert(!IO.outputting());
1608 Section.reset(
new ELFYAML::Fill());
1614 if (IO.outputting())
1617 Section.reset(
new ELFYAML::SectionHeaderTable(
false));
1620 IO, *cast<ELFYAML::SectionHeaderTable>(
Section.get()));
1624 const auto &Obj = *
static_cast<ELFYAML::Object *
>(IO.getContext());
1626 if (!IO.outputting())
1627 Section.reset(
new ELFYAML::MipsABIFlags());
1633 if (!IO.outputting())
1634 Section.reset(
new ELFYAML::ARMIndexTableSection());
1641 if (!IO.outputting())
1642 Section.reset(
new ELFYAML::DynamicSection());
1648 if (!IO.outputting())
1649 Section.reset(
new ELFYAML::RelocationSection());
1653 if (!IO.outputting())
1654 Section.reset(
new ELFYAML::RelrSection());
1658 if (!IO.outputting())
1659 Section.reset(
new ELFYAML::GroupSection());
1663 if (!IO.outputting())
1664 Section.reset(
new ELFYAML::NoBitsSection());
1668 if (!IO.outputting())
1669 Section.reset(
new ELFYAML::HashSection());
1673 if (!IO.outputting())
1674 Section.reset(
new ELFYAML::NoteSection());
1678 if (!IO.outputting())
1679 Section.reset(
new ELFYAML::GnuHashSection());
1683 if (!IO.outputting())
1684 Section.reset(
new ELFYAML::VerdefSection());
1688 if (!IO.outputting())
1689 Section.reset(
new ELFYAML::SymverSection());
1693 if (!IO.outputting())
1694 Section.reset(
new ELFYAML::VerneedSection());
1698 if (!IO.outputting())
1699 Section.reset(
new ELFYAML::SymtabShndxSection());
1703 if (!IO.outputting())
1704 Section.reset(
new ELFYAML::AddrsigSection());
1708 if (!IO.outputting())
1709 Section.reset(
new ELFYAML::LinkerOptionsSection());
1713 if (!IO.outputting())
1714 Section.reset(
new ELFYAML::DependentLibrariesSection());
1716 *cast<ELFYAML::DependentLibrariesSection>(
Section.get()));
1719 if (!IO.outputting())
1720 Section.reset(
new ELFYAML::CallGraphProfileSection());
1724 if (!IO.outputting())
1725 Section.reset(
new ELFYAML::BBAddrMapSection());
1729 if (!IO.outputting()) {
1731 IO.mapOptional(
"Name",
Name, StringRef());
1735 Section = std::make_unique<ELFYAML::StackSizesSection>();
1737 Section = std::make_unique<ELFYAML::RawContentSection>();
1740 if (
auto S = dyn_cast<ELFYAML::RawContentSection>(
Section.get()))
1747std::string MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::validate(
1748 IO &io, std::unique_ptr<ELFYAML::Chunk> &
C) {
1749 if (
const auto *
F = dyn_cast<ELFYAML::Fill>(
C.get())) {
1750 if (
F->Pattern &&
F->Pattern->binary_size() != 0 && !
F->Size)
1751 return "\"Size\" can't be 0 when \"Pattern\" is not empty";
1755 if (
const auto *SHT = dyn_cast<ELFYAML::SectionHeaderTable>(
C.get())) {
1756 if (SHT->NoHeaders && (SHT->Sections || SHT->Excluded || SHT->Offset))
1757 return "NoHeaders can't be used together with Offset/Sections/Excluded";
1761 const ELFYAML::Section &Sec = *cast<ELFYAML::Section>(
C.get());
1762 if (Sec.Size && Sec.Content &&
1763 (
uint64_t)(*Sec.Size) < Sec.Content->binary_size())
1764 return "Section size must be greater than or equal to the content size";
1766 auto BuildErrPrefix = [](ArrayRef<std::pair<StringRef, bool>> EntV) {
1768 for (
size_t I = 0,
E = EntV.size();
I !=
E; ++
I) {
1769 StringRef
Name = EntV[
I].first;
1771 Msg =
"\"" +
Name.str() +
"\"";
1774 if (
I != EntV.size() - 1)
1775 Msg +=
", \"" +
Name.str() +
"\"";
1777 Msg +=
" and \"" +
Name.str() +
"\"";
1782 std::vector<std::pair<StringRef, bool>> Entries = Sec.getEntries();
1784 Entries, [](
const std::pair<StringRef, bool> &
P) {
return P.second; });
1786 if ((Sec.Size || Sec.Content) && NumUsedEntries > 0)
1787 return BuildErrPrefix(Entries) +
1788 " cannot be used with \"Content\" or \"Size\"";
1790 if (NumUsedEntries > 0 && Entries.size() != NumUsedEntries)
1791 return BuildErrPrefix(Entries) +
" must be used together";
1793 if (
const auto *RawSection = dyn_cast<ELFYAML::RawContentSection>(
C.get())) {
1794 if (RawSection->Flags && RawSection->ShFlags)
1795 return "ShFlags and Flags cannot be used together";
1799 if (
const auto *NB = dyn_cast<ELFYAML::NoBitsSection>(
C.get())) {
1801 return "SHT_NOBITS section cannot have \"Content\"";
1805 if (
const auto *MF = dyn_cast<ELFYAML::MipsABIFlags>(
C.get())) {
1807 return "\"Content\" key is not implemented for SHT_MIPS_ABIFLAGS "
1810 return "\"Size\" key is not implemented for SHT_MIPS_ABIFLAGS sections";
1819struct NormalizedMips64RelType {
1820 NormalizedMips64RelType(IO &)
1821 :
Type(ELFYAML::ELF_REL(
ELF::R_MIPS_NONE)),
1822 Type2(ELFYAML::ELF_REL(
ELF::R_MIPS_NONE)),
1823 Type3(ELFYAML::ELF_REL(
ELF::R_MIPS_NONE)),
1825 NormalizedMips64RelType(IO &, ELFYAML::ELF_REL Original)
1826 :
Type(Original & 0xFF),
Type2(Original >> 8 & 0xFF),
1827 Type3(Original >> 16 & 0xFF),
SpecSym(Original >> 24 & 0xFF) {}
1829 ELFYAML::ELF_REL denormalize(IO &) {
1834 ELFYAML::ELF_REL Type;
1842void MappingTraits<ELFYAML::StackSizeEntry>::mapping(
1843 IO &IO, ELFYAML::StackSizeEntry &
E) {
1844 assert(IO.getContext() &&
"The IO context is not initialized");
1845 IO.mapOptional(
"Address",
E.Address, Hex64(0));
1846 IO.mapRequired(
"Size",
E.Size);
1849void MappingTraits<ELFYAML::BBAddrMapEntry>::mapping(
1850 IO &IO, ELFYAML::BBAddrMapEntry &
E) {
1851 assert(IO.getContext() &&
"The IO context is not initialized");
1852 IO.mapRequired(
"Version",
E.Version);
1853 IO.mapOptional(
"Feature",
E.Feature, Hex8(0));
1854 IO.mapOptional(
"NumBBRanges",
E.NumBBRanges);
1855 IO.mapOptional(
"BBRanges",
E.BBRanges);
1858void MappingTraits<ELFYAML::BBAddrMapEntry::BBRangeEntry>::mapping(
1859 IO &IO, ELFYAML::BBAddrMapEntry::BBRangeEntry &
E) {
1860 IO.mapOptional(
"BaseAddress",
E.BaseAddress, Hex64(0));
1861 IO.mapOptional(
"NumBlocks",
E.NumBlocks);
1862 IO.mapOptional(
"BBEntries",
E.BBEntries);
1865void MappingTraits<ELFYAML::BBAddrMapEntry::BBEntry>::mapping(
1866 IO &IO, ELFYAML::BBAddrMapEntry::BBEntry &
E) {
1867 assert(IO.getContext() &&
"The IO context is not initialized");
1868 IO.mapOptional(
"ID",
E.ID);
1869 IO.mapRequired(
"AddressOffset",
E.AddressOffset);
1870 IO.mapRequired(
"Size",
E.Size);
1871 IO.mapRequired(
"Metadata",
E.Metadata);
1874void MappingTraits<ELFYAML::PGOAnalysisMapEntry>::mapping(
1875 IO &IO, ELFYAML::PGOAnalysisMapEntry &
E) {
1876 assert(IO.getContext() &&
"The IO context is not initialized");
1877 IO.mapOptional(
"FuncEntryCount",
E.FuncEntryCount);
1878 IO.mapOptional(
"PGOBBEntries",
E.PGOBBEntries);
1881void MappingTraits<ELFYAML::PGOAnalysisMapEntry::PGOBBEntry>::mapping(
1882 IO &IO, ELFYAML::PGOAnalysisMapEntry::PGOBBEntry &
E) {
1883 assert(IO.getContext() &&
"The IO context is not initialized");
1884 IO.mapOptional(
"BBFreq",
E.BBFreq);
1885 IO.mapOptional(
"Successors",
E.Successors);
1888void MappingTraits<ELFYAML::PGOAnalysisMapEntry::PGOBBEntry::SuccessorEntry>::
1890 ELFYAML::PGOAnalysisMapEntry::PGOBBEntry::SuccessorEntry &
E) {
1891 assert(IO.getContext() &&
"The IO context is not initialized");
1892 IO.mapRequired(
"ID",
E.ID);
1893 IO.mapRequired(
"BrProb",
E.BrProb);
1896void MappingTraits<ELFYAML::GnuHashHeader>::mapping(IO &IO,
1897 ELFYAML::GnuHashHeader &
E) {
1898 assert(IO.getContext() &&
"The IO context is not initialized");
1899 IO.mapOptional(
"NBuckets",
E.NBuckets);
1900 IO.mapRequired(
"SymNdx",
E.SymNdx);
1901 IO.mapOptional(
"MaskWords",
E.MaskWords);
1902 IO.mapRequired(
"Shift2",
E.Shift2);
1905void MappingTraits<ELFYAML::DynamicEntry>::mapping(IO &IO,
1906 ELFYAML::DynamicEntry &Rel) {
1907 assert(IO.getContext() &&
"The IO context is not initialized");
1909 IO.mapRequired(
"Tag", Rel.Tag);
1910 IO.mapRequired(
"Value", Rel.Val);
1913void MappingTraits<ELFYAML::NoteEntry>::mapping(IO &IO, ELFYAML::NoteEntry &
N) {
1914 assert(IO.getContext() &&
"The IO context is not initialized");
1916 IO.mapOptional(
"Name",
N.Name);
1917 IO.mapOptional(
"Desc",
N.Desc);
1918 IO.mapRequired(
"Type",
N.Type);
1921void MappingTraits<ELFYAML::VerdefEntry>::mapping(IO &IO,
1922 ELFYAML::VerdefEntry &
E) {
1923 assert(IO.getContext() &&
"The IO context is not initialized");
1925 IO.mapOptional(
"Version",
E.Version);
1926 IO.mapOptional(
"Flags",
E.Flags);
1927 IO.mapOptional(
"VersionNdx",
E.VersionNdx);
1928 IO.mapOptional(
"Hash",
E.Hash);
1929 IO.mapOptional(
"VDAux",
E.VDAux);
1930 IO.mapRequired(
"Names",
E.VerNames);
1933void MappingTraits<ELFYAML::VerneedEntry>::mapping(IO &IO,
1934 ELFYAML::VerneedEntry &
E) {
1935 assert(IO.getContext() &&
"The IO context is not initialized");
1937 IO.mapRequired(
"Version",
E.Version);
1938 IO.mapRequired(
"File",
E.File);
1939 IO.mapRequired(
"Entries",
E.AuxV);
1942void MappingTraits<ELFYAML::VernauxEntry>::mapping(IO &IO,
1943 ELFYAML::VernauxEntry &
E) {
1944 assert(IO.getContext() &&
"The IO context is not initialized");
1946 IO.mapRequired(
"Name",
E.Name);
1947 IO.mapRequired(
"Hash",
E.Hash);
1948 IO.mapRequired(
"Flags",
E.Flags);
1949 IO.mapRequired(
"Other",
E.Other);
1952void MappingTraits<ELFYAML::Relocation>::mapping(IO &IO,
1953 ELFYAML::Relocation &Rel) {
1954 const auto *
Object =
static_cast<ELFYAML::Object *
>(IO.getContext());
1955 assert(Object &&
"The IO context is not initialized");
1957 IO.mapOptional(
"Offset", Rel.Offset, (Hex64)0);
1958 IO.mapOptional(
"Symbol", Rel.Symbol);
1962 MappingNormalization<NormalizedMips64RelType, ELFYAML::ELF_REL>
Key(
1964 IO.mapRequired(
"Type",
Key->Type);
1965 IO.mapOptional(
"Type2",
Key->Type2, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
1966 IO.mapOptional(
"Type3",
Key->Type3, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
1969 IO.mapRequired(
"Type", Rel.Type);
1971 IO.mapOptional(
"Addend", Rel.Addend, (ELFYAML::YAMLIntUInt)0);
1974void MappingTraits<ELFYAML::ARMIndexTableEntry>::mapping(
1975 IO &IO, ELFYAML::ARMIndexTableEntry &
E) {
1976 assert(IO.getContext() &&
"The IO context is not initialized");
1977 IO.mapRequired(
"Offset",
E.Offset);
1979 StringRef CantUnwind =
"EXIDX_CANTUNWIND";
1981 IO.mapRequired(
"Value", CantUnwind);
1982 else if (!IO.outputting() &&
getStringValue(IO,
"Value") == CantUnwind)
1985 IO.mapRequired(
"Value",
E.Value);
1988void MappingTraits<ELFYAML::Object>::mapping(IO &IO, ELFYAML::Object &Object) {
1989 assert(!IO.getContext() &&
"The IO context is initialized already");
1990 IO.setContext(&Object);
1991 IO.mapTag(
"!ELF",
true);
1992 IO.mapRequired(
"FileHeader",
Object.Header);
1993 IO.mapOptional(
"ProgramHeaders",
Object.ProgramHeaders);
1994 IO.mapOptional(
"Sections",
Object.Chunks);
1995 IO.mapOptional(
"Symbols",
Object.Symbols);
1996 IO.mapOptional(
"DynamicSymbols",
Object.DynamicSymbols);
1997 IO.mapOptional(
"DWARF",
Object.DWARF);
1999 Object.DWARF->IsLittleEndian =
2001 Object.DWARF->Is64BitAddrSize =
2004 IO.setContext(
nullptr);
2007void MappingTraits<ELFYAML::LinkerOption>::mapping(IO &IO,
2008 ELFYAML::LinkerOption &Opt) {
2009 assert(IO.getContext() &&
"The IO context is not initialized");
2010 IO.mapRequired(
"Name", Opt.Key);
2011 IO.mapRequired(
"Value", Opt.Value);
2014void MappingTraits<ELFYAML::CallGraphEntryWeight>::mapping(
2015 IO &IO, ELFYAML::CallGraphEntryWeight &
E) {
2016 assert(IO.getContext() &&
"The IO context is not initialized");
2017 IO.mapRequired(
"Weight",
E.Weight);
This file implements a class to represent arbitrary precision integral constant values and operations...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
std::string UnknownFlagsHolder
std::optional< std::vector< StOtherPiece > > Other
This file declares classes for handling the YAML representation of ELF.
This file implements a map that provides insertion order iteration.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static uint32_t getFlags(const Symbol *Sym)
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
Class for arbitrary precision integers.
This class implements a map that also provides access to all stored values in a deterministic order.
StringRef - Represent a constant reference to a string, i.e.
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
The instances of the Type class are immutable: once they are created, they are never changed.
Type(LLVMContext &C, TypeID tid)
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
Specialized YAMLIO scalar type for representing a binary blob.
@ EXIDX_CANTUNWIND
Special entry for the function never unwind.
@ C
The default llvm calling convention, compatible with C.
StringRef dropUniqueSuffix(StringRef S)
@ STO_AARCH64_VARIANT_PCS
@ SHT_LLVM_DEPENDENT_LIBRARIES
@ SHT_LLVM_LINKER_OPTIONS
@ SHT_LLVM_CALL_GRAPH_PROFILE
@ EF_AMDGPU_GENERIC_VERSION_MAX
@ EF_AMDGPU_GENERIC_VERSION_OFFSET
@ EF_AMDGPU_GENERIC_VERSION_MIN
@ EF_AMDGPU_GENERIC_VERSION
@ ELFABIVERSION_AMDGPU_HSA_V4
@ ELFABIVERSION_AMDGPU_HSA_V5
@ ELFABIVERSION_AMDGPU_HSA_V3
@ ELFABIVERSION_AMDGPU_HSA_V6
@ Val_GNU_MIPS_ABI_FP_ANY
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
static void sectionMapping(IO &IO, ELFYAML::DynamicSection &Section)
static void groupSectionMapping(IO &IO, ELFYAML::GroupSection &Group)
static StringRef getStringValue(IO &IO, const char *Key)
static void sectionHeaderTableMapping(IO &IO, ELFYAML::SectionHeaderTable &SHT)
static void commonSectionMapping(IO &IO, ELFYAML::Section &Section)
static bool isInteger(StringRef Val)
static void fillMapping(IO &IO, ELFYAML::Fill &Fill)
static void setStringValue(IO &IO, const char *Key, StringRef Val)
This is an optimization pass for GlobalISel generic memory operations.
bool getAsSignedInteger(StringRef Str, unsigned Radix, long long &Result)
auto count_if(R &&Range, UnaryPredicate P)
Wrapper function around std::count_if to count the number of times an element satisfying a given pred...
bool getAsUnsignedInteger(StringRef Str, unsigned Radix, unsigned long long &Result)
Helper functions for StringRef::getAsInteger.
std::optional< llvm::yaml::Hex64 > Offset
std::optional< yaml::BinaryRef > Pattern
std::optional< std::vector< SectionOrType > > Members
std::optional< StringRef > Signature
unsigned getMachine() const
ELF_ELFOSABI getOSAbi() const
StringRef sectionNameOrType
static bool nameMatches(StringRef Name)
static StringRef input(StringRef Scalar, void *, ELFYAML::YAMLFlowString &Val)
static void output(const ELFYAML::YAMLFlowString &Val, void *, raw_ostream &Out)
static QuotingType mustQuote(StringRef S)
static StringRef input(StringRef Scalar, void *, StOtherPiece &Val)
static QuotingType mustQuote(StringRef)
static void output(const StOtherPiece &Val, void *, raw_ostream &Out)