LLVM  4.0.0
ELFYAML.cpp
Go to the documentation of this file.
1 //===- ELFYAML.cpp - ELF YAMLIO implementation ----------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines classes for handling the YAML representation of ELF.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "llvm/Support/Casting.h"
17 
18 namespace llvm {
19 
21 
22 namespace yaml {
23 
24 void
26  ELFYAML::ELF_ET &Value) {
27 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
28  ECase(ET_NONE)
29  ECase(ET_REL)
30  ECase(ET_EXEC)
31  ECase(ET_DYN)
32  ECase(ET_CORE)
33 #undef ECase
34  IO.enumFallback<Hex16>(Value);
35 }
36 
37 void
39  ELFYAML::ELF_EM &Value) {
40 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
41  ECase(EM_NONE)
42  ECase(EM_M32)
44  ECase(EM_386)
45  ECase(EM_68K)
46  ECase(EM_88K)
48  ECase(EM_860)
49  ECase(EM_MIPS)
50  ECase(EM_S370)
55  ECase(EM_960)
56  ECase(EM_PPC)
58  ECase(EM_S390)
59  ECase(EM_SPU)
60  ECase(EM_V800)
61  ECase(EM_FR20)
62  ECase(EM_RH32)
63  ECase(EM_RCE)
64  ECase(EM_ARM)
66  ECase(EM_SH)
69  ECase(EM_ARC)
72  ECase(EM_H8S)
78  ECase(EM_MMA)
79  ECase(EM_PCP)
80  ECase(EM_NCPU)
81  ECase(EM_NDR1)
83  ECase(EM_ME16)
87  ECase(EM_PDSP)
90  ECase(EM_FX66)
92  ECase(EM_ST7)
97  ECase(EM_SVX)
98  ECase(EM_ST19)
99  ECase(EM_VAX)
100  ECase(EM_CRIS)
103  ECase(EM_ZSP)
104  ECase(EM_MMIX)
105  ECase(EM_HUANY)
106  ECase(EM_PRISM)
107  ECase(EM_AVR)
108  ECase(EM_FR30)
109  ECase(EM_D10V)
110  ECase(EM_D30V)
111  ECase(EM_V850)
112  ECase(EM_M32R)
115  ECase(EM_PJ)
121  ECase(EM_NS32K)
122  ECase(EM_TPC)
123  ECase(EM_SNP1K)
124  ECase(EM_ST200)
125  ECase(EM_IP2K)
126  ECase(EM_MAX)
127  ECase(EM_CR)
132  ECase(EM_SEP)
133  ECase(EM_ARCA)
136  ECase(EM_DXP)
138  ECase(EM_CRX)
139  ECase(EM_XGATE)
140  ECase(EM_C166)
141  ECase(EM_M16C)
143  ECase(EM_CE)
144  ECase(EM_M32C)
146  ECase(EM_RS08)
147  ECase(EM_SHARC)
148  ECase(EM_ECOG2)
150  ECase(EM_DSP24)
159  ECase(EM_R32C)
162  ECase(EM_8051)
164  ECase(EM_NDS32)
165  ECase(EM_ECOG1)
169  ECase(EM_MANIK)
171  ECase(EM_RX)
172  ECase(EM_METAG)
175  ECase(EM_CR16)
176  ECase(EM_ETPU)
177  ECase(EM_SLE9X)
178  ECase(EM_L10M)
179  ECase(EM_K10M)
181  ECase(EM_AVR32)
182  ECase(EM_STM8)
185  ECase(EM_CUDA)
191  ECase(EM_OPEN8)
192  ECase(EM_RL78)
194  ECase(EM_78KOR)
197  ECase(EM_RISCV)
198  ECase(EM_LANAI)
199  ECase(EM_BPF)
200 #undef ECase
201 }
202 
204  IO &IO, ELFYAML::ELF_ELFCLASS &Value) {
205 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
206  // Since the semantics of ELFCLASSNONE is "invalid", just don't accept it
207  // here.
210 #undef ECase
211 }
212 
214  IO &IO, ELFYAML::ELF_ELFDATA &Value) {
215 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
216  // Since the semantics of ELFDATANONE is "invalid", just don't accept it
217  // here.
220 #undef ECase
221 }
222 
224  IO &IO, ELFYAML::ELF_ELFOSABI &Value) {
225 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
249 #undef ECase
250 }
251 
253  ELFYAML::ELF_EF &Value) {
254  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
255  assert(Object && "The IO context is not initialized");
256 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X);
257 #define BCaseMask(X, M) IO.maskedBitSetCase(Value, #X, ELF::X, ELF::M);
258  switch (Object->Header.Machine) {
259  case ELF::EM_ARM:
268  break;
269  case ELF::EM_MIPS:
313  break;
314  case ELF::EM_HEXAGON:
323  break;
324  case ELF::EM_AVR:
342  break;
343  case ELF::EM_AMDGPU:
344  case ELF::EM_X86_64:
345  break;
346  default:
347  llvm_unreachable("Unsupported architecture");
348  }
349 #undef BCase
350 #undef BCaseMask
351 }
352 
354  IO &IO, ELFYAML::ELF_SHT &Value) {
355  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
356  assert(Object && "The IO context is not initialized");
357 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
358  ECase(SHT_NULL)
360  // No SHT_SYMTAB. Use the top-level `Symbols` key instead.
361  // FIXME: Issue a diagnostic with this information.
363  ECase(SHT_RELA)
364  ECase(SHT_HASH)
366  ECase(SHT_NOTE)
368  ECase(SHT_REL)
376  ECase(SHT_LOOS)
382  ECase(SHT_HIOS)
384  switch (Object->Header.Machine) {
385  case ELF::EM_ARM:
391  break;
392  case ELF::EM_HEXAGON:
394  break;
395  case ELF::EM_X86_64:
397  break;
398  case ELF::EM_MIPS:
402  break;
403  default:
404  // Nothing to do.
405  break;
406  }
407 #undef ECase
408 }
409 
411  ELFYAML::ELF_SHF &Value) {
412  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
413 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X);
424  BCase(SHF_TLS)
425  switch(Object->Header.Machine) {
426  case ELF::EM_ARM:
428  break;
429  case ELF::EM_AMDGPU:
434  break;
435  case ELF::EM_HEXAGON:
437  break;
438  case ELF::EM_MIPS:
447  break;
448  case ELF::EM_X86_64:
450  break;
451  default:
452  // Nothing to do.
453  break;
454  }
455 #undef BCase
456 }
457 
459  IO &IO, ELFYAML::ELF_STT &Value) {
460 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
463  ECase(STT_FUNC)
465  ECase(STT_FILE)
467  ECase(STT_TLS)
469 #undef ECase
470 }
471 
473  IO &IO, ELFYAML::ELF_STV &Value) {
474 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
479 #undef ECase
480 }
481 
483  ELFYAML::ELF_STO &Value) {
484  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
485  assert(Object && "The IO context is not initialized");
486 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X);
487  switch (Object->Header.Machine) {
488  case ELF::EM_MIPS:
493  break;
494  default:
495  break; // Nothing to do
496  }
497 #undef BCase
498 #undef BCaseMask
499 }
500 
502  IO &IO, ELFYAML::ELF_RSS &Value) {
503 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
505  ECase(RSS_GP)
506  ECase(RSS_GP0)
507  ECase(RSS_LOC)
508 #undef ECase
509 }
510 
512  IO &IO, ELFYAML::ELF_REL &Value) {
513  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
514  assert(Object && "The IO context is not initialized");
515 #define ELF_RELOC(X, Y) IO.enumCase(Value, #X, ELF::X);
516  switch (Object->Header.Machine) {
517  case ELF::EM_X86_64:
518 #include "llvm/Support/ELFRelocs/x86_64.def"
519  break;
520  case ELF::EM_MIPS:
521 #include "llvm/Support/ELFRelocs/Mips.def"
522  break;
523  case ELF::EM_HEXAGON:
524 #include "llvm/Support/ELFRelocs/Hexagon.def"
525  break;
526  case ELF::EM_386:
527  case ELF::EM_IAMCU:
528 #include "llvm/Support/ELFRelocs/i386.def"
529  break;
530  case ELF::EM_AARCH64:
531 #include "llvm/Support/ELFRelocs/AArch64.def"
532  break;
533  case ELF::EM_ARM:
534 #include "llvm/Support/ELFRelocs/ARM.def"
535  break;
536  case ELF::EM_RISCV:
537 #include "llvm/Support/ELFRelocs/RISCV.def"
538  break;
539  case ELF::EM_LANAI:
540 #include "llvm/Support/ELFRelocs/Lanai.def"
541  break;
542  case ELF::EM_AMDGPU:
543 #include "llvm/Support/ELFRelocs/AMDGPU.def"
544  break;
545  case ELF::EM_BPF:
546 #include "llvm/Support/ELFRelocs/BPF.def"
547  break;
548  default:
549  llvm_unreachable("Unsupported architecture");
550  }
551 #undef ELF_RELOC
552 }
553 
555  IO &IO, ELFYAML::MIPS_AFL_REG &Value) {
556 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X);
557  ECase(REG_NONE)
558  ECase(REG_32)
559  ECase(REG_64)
560  ECase(REG_128)
561 #undef ECase
562 }
563 
565  IO &IO, ELFYAML::MIPS_ABI_FP &Value) {
566 #define ECase(X) IO.enumCase(Value, #X, Mips::Val_GNU_MIPS_ABI_##X);
567  ECase(FP_ANY)
568  ECase(FP_DOUBLE)
569  ECase(FP_SINGLE)
570  ECase(FP_SOFT)
571  ECase(FP_OLD_64)
572  ECase(FP_XX)
573  ECase(FP_64)
574  ECase(FP_64A)
575 #undef ECase
576 }
577 
579  IO &IO, ELFYAML::MIPS_AFL_EXT &Value) {
580 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X);
581  ECase(EXT_NONE)
582  ECase(EXT_XLR)
583  ECase(EXT_OCTEON2)
584  ECase(EXT_OCTEONP)
585  ECase(EXT_LOONGSON_3A)
586  ECase(EXT_OCTEON)
587  ECase(EXT_5900)
588  ECase(EXT_4650)
589  ECase(EXT_4010)
590  ECase(EXT_4100)
591  ECase(EXT_3900)
592  ECase(EXT_10000)
593  ECase(EXT_SB1)
594  ECase(EXT_4111)
595  ECase(EXT_4120)
596  ECase(EXT_5400)
597  ECase(EXT_5500)
598  ECase(EXT_LOONGSON_2E)
599  ECase(EXT_LOONGSON_2F)
600  ECase(EXT_OCTEON3)
601 #undef ECase
602 }
603 
605  IO &IO, ELFYAML::MIPS_ISA &Value) {
606  IO.enumCase(Value, "MIPS1", 1);
607  IO.enumCase(Value, "MIPS2", 2);
608  IO.enumCase(Value, "MIPS3", 3);
609  IO.enumCase(Value, "MIPS4", 4);
610  IO.enumCase(Value, "MIPS5", 5);
611  IO.enumCase(Value, "MIPS32", 32);
612  IO.enumCase(Value, "MIPS64", 64);
613 }
614 
616  IO &IO, ELFYAML::MIPS_AFL_ASE &Value) {
617 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_ASE_##X);
618  BCase(DSP)
619  BCase(DSPR2)
620  BCase(EVA)
621  BCase(MCU)
622  BCase(MDMX)
623  BCase(MIPS3D)
624  BCase(MT)
625  BCase(SMARTMIPS)
626  BCase(VIRT)
627  BCase(MSA)
628  BCase(MIPS16)
629  BCase(MICROMIPS)
630  BCase(XPA)
631 #undef BCase
632 }
633 
635  IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &Value) {
636 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_FLAGS1_##X);
637  BCase(ODDSPREG)
638 #undef BCase
639 }
640 
642  ELFYAML::FileHeader &FileHdr) {
643  IO.mapRequired("Class", FileHdr.Class);
644  IO.mapRequired("Data", FileHdr.Data);
645  IO.mapOptional("OSABI", FileHdr.OSABI, ELFYAML::ELF_ELFOSABI(0));
646  IO.mapRequired("Type", FileHdr.Type);
647  IO.mapRequired("Machine", FileHdr.Machine);
648  IO.mapOptional("Flags", FileHdr.Flags, ELFYAML::ELF_EF(0));
649  IO.mapOptional("Entry", FileHdr.Entry, Hex64(0));
650 }
651 
652 namespace {
653 struct NormalizedOther {
654  NormalizedOther(IO &)
655  : Visibility(ELFYAML::ELF_STV(0)), Other(ELFYAML::ELF_STO(0)) {}
656  NormalizedOther(IO &, uint8_t Original)
657  : Visibility(Original & 0x3), Other(Original & ~0x3) {}
658 
659  uint8_t denormalize(IO &) { return Visibility | Other; }
660 
661  ELFYAML::ELF_STV Visibility;
662  ELFYAML::ELF_STO Other;
663 };
664 }
665 
667  IO.mapOptional("Name", Symbol.Name, StringRef());
668  IO.mapOptional("Type", Symbol.Type, ELFYAML::ELF_STT(0));
669  IO.mapOptional("Section", Symbol.Section, StringRef());
670  IO.mapOptional("Value", Symbol.Value, Hex64(0));
671  IO.mapOptional("Size", Symbol.Size, Hex64(0));
672 
674  IO.mapOptional("Visibility", Keys->Visibility, ELFYAML::ELF_STV(0));
675  IO.mapOptional("Other", Keys->Other, ELFYAML::ELF_STO(0));
676 }
677 
680  IO.mapOptional("Local", Symbols.Local);
681  IO.mapOptional("Global", Symbols.Global);
682  IO.mapOptional("Weak", Symbols.Weak);
683 }
684 
686  IO.mapOptional("Name", Section.Name, StringRef());
687  IO.mapRequired("Type", Section.Type);
688  IO.mapOptional("Flags", Section.Flags, ELFYAML::ELF_SHF(0));
689  IO.mapOptional("Address", Section.Address, Hex64(0));
690  IO.mapOptional("Link", Section.Link, StringRef());
691  IO.mapOptional("AddressAlign", Section.AddressAlign, Hex64(0));
692  IO.mapOptional("Info", Section.Info, StringRef());
693 }
694 
696  commonSectionMapping(IO, Section);
697  IO.mapOptional("Content", Section.Content);
698  IO.mapOptional("Size", Section.Size, Hex64(Section.Content.binary_size()));
699 }
700 
702  commonSectionMapping(IO, Section);
703  IO.mapOptional("Size", Section.Size, Hex64(0));
704 }
705 
707  commonSectionMapping(IO, Section);
708  IO.mapOptional("Relocations", Section.Relocations);
709 }
710 
711 static void groupSectionMapping(IO &IO, ELFYAML::Group &group) {
712  commonSectionMapping(IO, group);
713  IO.mapRequired("Members", group.Members);
714 }
715 
717  IO &IO, ELFYAML::SectionOrType &sectionOrType) {
718  IO.mapRequired("SectionOrType", sectionOrType.sectionNameOrType);
719 }
720 
722  commonSectionMapping(IO, Section);
723  IO.mapOptional("Version", Section.Version, Hex16(0));
724  IO.mapRequired("ISA", Section.ISALevel);
725  IO.mapOptional("ISARevision", Section.ISARevision, Hex8(0));
726  IO.mapOptional("ISAExtension", Section.ISAExtension,
727  ELFYAML::MIPS_AFL_EXT(Mips::AFL_EXT_NONE));
728  IO.mapOptional("ASEs", Section.ASEs, ELFYAML::MIPS_AFL_ASE(0));
729  IO.mapOptional("FpABI", Section.FpABI,
730  ELFYAML::MIPS_ABI_FP(Mips::Val_GNU_MIPS_ABI_FP_ANY));
731  IO.mapOptional("GPRSize", Section.GPRSize,
732  ELFYAML::MIPS_AFL_REG(Mips::AFL_REG_NONE));
733  IO.mapOptional("CPR1Size", Section.CPR1Size,
734  ELFYAML::MIPS_AFL_REG(Mips::AFL_REG_NONE));
735  IO.mapOptional("CPR2Size", Section.CPR2Size,
736  ELFYAML::MIPS_AFL_REG(Mips::AFL_REG_NONE));
737  IO.mapOptional("Flags1", Section.Flags1, ELFYAML::MIPS_AFL_FLAGS1(0));
738  IO.mapOptional("Flags2", Section.Flags2, Hex32(0));
739 }
740 
742  IO &IO, std::unique_ptr<ELFYAML::Section> &Section) {
743  ELFYAML::ELF_SHT sectionType;
744  if (IO.outputting())
745  sectionType = Section->Type;
746  else
747  IO.mapRequired("Type", sectionType);
748 
749  switch (sectionType) {
750  case ELF::SHT_REL:
751  case ELF::SHT_RELA:
752  if (!IO.outputting())
753  Section.reset(new ELFYAML::RelocationSection());
754  sectionMapping(IO, *cast<ELFYAML::RelocationSection>(Section.get()));
755  break;
756  case ELF::SHT_GROUP:
757  if (!IO.outputting())
758  Section.reset(new ELFYAML::Group());
759  groupSectionMapping(IO, *cast<ELFYAML::Group>(Section.get()));
760  break;
761  case ELF::SHT_NOBITS:
762  if (!IO.outputting())
763  Section.reset(new ELFYAML::NoBitsSection());
764  sectionMapping(IO, *cast<ELFYAML::NoBitsSection>(Section.get()));
765  break;
767  if (!IO.outputting())
768  Section.reset(new ELFYAML::MipsABIFlags());
769  sectionMapping(IO, *cast<ELFYAML::MipsABIFlags>(Section.get()));
770  break;
771  default:
772  if (!IO.outputting())
773  Section.reset(new ELFYAML::RawContentSection());
774  sectionMapping(IO, *cast<ELFYAML::RawContentSection>(Section.get()));
775  }
776 }
777 
779  IO &io, std::unique_ptr<ELFYAML::Section> &Section) {
780  const auto *RawSection = dyn_cast<ELFYAML::RawContentSection>(Section.get());
781  if (!RawSection || RawSection->Size >= RawSection->Content.binary_size())
782  return StringRef();
783  return "Section size must be greater or equal to the content size";
784 }
785 
786 namespace {
787 struct NormalizedMips64RelType {
788  NormalizedMips64RelType(IO &)
789  : Type(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
790  Type2(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
791  Type3(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
792  SpecSym(ELFYAML::ELF_REL(ELF::RSS_UNDEF)) {}
793  NormalizedMips64RelType(IO &, ELFYAML::ELF_REL Original)
794  : Type(Original & 0xFF), Type2(Original >> 8 & 0xFF),
795  Type3(Original >> 16 & 0xFF), SpecSym(Original >> 24 & 0xFF) {}
796 
797  ELFYAML::ELF_REL denormalize(IO &) {
798  ELFYAML::ELF_REL Res = Type | Type2 << 8 | Type3 << 16 | SpecSym << 24;
799  return Res;
800  }
801 
802  ELFYAML::ELF_REL Type;
803  ELFYAML::ELF_REL Type2;
804  ELFYAML::ELF_REL Type3;
805  ELFYAML::ELF_RSS SpecSym;
806 };
807 }
808 
810  ELFYAML::Relocation &Rel) {
811  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
812  assert(Object && "The IO context is not initialized");
813 
814  IO.mapRequired("Offset", Rel.Offset);
815  IO.mapRequired("Symbol", Rel.Symbol);
816 
817  if (Object->Header.Machine == ELFYAML::ELF_EM(ELF::EM_MIPS) &&
818  Object->Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64)) {
820  IO, Rel.Type);
821  IO.mapRequired("Type", Key->Type);
822  IO.mapOptional("Type2", Key->Type2, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
823  IO.mapOptional("Type3", Key->Type3, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
824  IO.mapOptional("SpecSym", Key->SpecSym, ELFYAML::ELF_RSS(ELF::RSS_UNDEF));
825  } else
826  IO.mapRequired("Type", Rel.Type);
827 
828  IO.mapOptional("Addend", Rel.Addend, (int64_t)0);
829 }
830 
832  assert(!IO.getContext() && "The IO context is initialized already");
833  IO.setContext(&Object);
834  IO.mapTag("!ELF", true);
835  IO.mapRequired("FileHeader", Object.Header);
836  IO.mapOptional("Sections", Object.Sections);
837  IO.mapOptional("Symbols", Object.Symbols);
838  IO.setContext(nullptr);
839 }
840 
841 LLVM_YAML_STRONG_TYPEDEF(uint8_t, MIPS_AFL_REG)
842 LLVM_YAML_STRONG_TYPEDEF(uint8_t, MIPS_ABI_FP)
843 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_EXT)
844 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_ASE)
845 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_FLAGS1)
846 
847 } // end namespace yaml
848 } // end namespace llvm
static void sectionMapping(IO &IO, ELFYAML::MipsABIFlags &Section)
Definition: ELFYAML.cpp:721
ArrayRef< uint8_t >::size_type binary_size() const
The number of bytes that are represented by this BinaryRef.
Definition: YAML.h:73
This file declares classes for handling the YAML representation of ELF.
void mapOptional(const char *Key, T &Val)
Definition: YAMLTraits.h:646
void * getContext()
Definition: YAMLTraits.cpp:35
llvm::yaml::Hex16 Version
Definition: ELFYAML.h:149
ELFYAML::ELF_REL Type3
Definition: ELFYAML.cpp:804
llvm::yaml::Hex64 Address
Definition: ELFYAML.h:99
ELFYAML::ELF_STV Visibility
Definition: ELFYAML.cpp:661
FileHeader Header
Definition: ELFYAML.h:167
llvm::yaml::Hex64 Entry
Definition: ELFYAML.h:67
ELFYAML::ELF_REL Type
Definition: ELFYAML.cpp:802
LocalGlobalWeakSymbols Symbols
Definition: ELFYAML.h:173
llvm::yaml::Hex64 AddressAlign
Definition: ELFYAML.h:102
std::vector< Symbol > Weak
Definition: ELFYAML.h:80
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:116
StringRef Section
Definition: ELFYAML.h:72
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:74
static void groupSectionMapping(IO &IO, ELFYAML::Group &group)
Definition: ELFYAML.cpp:711
void enumFallback(T &Val)
Definition: YAMLTraits.h:596
StringRef Name
Definition: ELFYAML.h:70
ELFYAML::ELF_STO Other
Definition: ELFYAML.cpp:662
This class should be specialized by any type that needs to be converted to/from a YAML mapping...
ELFYAML::ELF_RSS SpecSym
Definition: ELFYAML.cpp:805
std::vector< Symbol > Global
Definition: ELFYAML.h:79
virtual bool mapTag(StringRef Tag, bool Default=false)=0
void enumCase(T &Val, const char *Str, const T ConstVal)
Definition: YAMLTraits.h:581
static void commonSectionMapping(IO &IO, ELFYAML::Section &Section)
Definition: ELFYAML.cpp:685
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
llvm::yaml::Hex32 Flags2
Definition: ELFYAML.h:159
#define BCase(X)
std::vector< std::unique_ptr< Section > > Sections
Definition: ELFYAML.h:168
std::vector< Symbol > Local
Definition: ELFYAML.h:78
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
llvm::yaml::Hex8 ISARevision
Definition: ELFYAML.h:151
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
Definition: YAMLTraits.h:97
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
YAML I/O does conversion based on types.
Definition: YAMLTraits.h:1327
ELF_ELFCLASS Class
Definition: ELFYAML.h:61
std::vector< SectionOrType > Members
Definition: ELFYAML.h:126
llvm::yaml::Hex64 Offset
Definition: ELFYAML.h:134
void setContext(void *)
Definition: YAMLTraits.cpp:39
#define ECase(X)
ELFYAML::ELF_REL Type2
Definition: ELFYAML.cpp:803
MIPS_AFL_EXT ISAExtension
Definition: ELFYAML.h:156
llvm::yaml::Hex64 Value
Definition: ELFYAML.h:73
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
Definition: Casting.h:287
virtual bool outputting()=0
MIPS_AFL_FLAGS1 Flags1
Definition: ELFYAML.h:158
This class should be specialized by any integer type that is a union of bit values and the YAML repre...
Definition: YAMLTraits.h:114
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Definition: Value.h:71
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:108
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
void mapRequired(const char *Key, T &Val)
Definition: YAMLTraits.h:637
ELF_ELFOSABI OSABI
Definition: ELFYAML.h:63
#define BCaseMask(X, M)
std::vector< Relocation > Relocations
Definition: ELFYAML.h:140