Go to the documentation of this file.
43 IO &IO, ELFYAML::ELF_ET &
Value) {
44 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
51 IO.enumFallback<Hex16>(
Value);
55 IO &IO, ELFYAML::ELF_PT &
Value) {
56 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
70 IO.enumFallback<Hex32>(
Value);
74 IO &IO, ELFYAML::ELF_NT &
Value) {
75 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
164 IO.enumFallback<Hex32>(
Value);
168 IO &IO, ELFYAML::ELF_EM &
Value) {
169 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
332 IO.enumFallback<Hex16>(
Value);
336 IO &IO, ELFYAML::ELF_ELFCLASS &
Value) {
337 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
346 IO &IO, ELFYAML::ELF_ELFDATA &
Value) {
347 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
357 IO &IO, ELFYAML::ELF_ELFOSABI &
Value) {
358 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
385 IO.enumFallback<Hex8>(
Value);
389 ELFYAML::ELF_EF &
Value) {
392 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
393 #define BCaseMask(X, M) IO.maskedBitSetCase(Value, #X, ELF::X, ELF::M)
394 switch (
Object->getMachine()) {
551 switch (
Object->Header.ABIVersion) {
587 IO &IO, ELFYAML::ELF_SHT &
Value) {
590 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
627 switch (
Object->getMachine()) {
655 IO.enumFallback<Hex32>(
Value);
659 ELFYAML::ELF_PF &
Value) {
660 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
667 ELFYAML::ELF_SHF &
Value) {
669 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
683 switch (
Object->getMachine()) {
711 IO &IO, ELFYAML::ELF_SHN &
Value) {
712 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
730 IO.enumFallback<Hex16>(
Value);
734 IO &IO, ELFYAML::ELF_STB &
Value) {
735 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
741 IO.enumFallback<Hex8>(
Value);
745 IO &IO, ELFYAML::ELF_STT &
Value) {
746 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
756 IO.enumFallback<Hex8>(
Value);
761 IO &IO, ELFYAML::ELF_RSS &
Value) {
762 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
771 IO &IO, ELFYAML::ELF_REL &
Value) {
774 #define ELF_RELOC(X, Y) IO.enumCase(Value, #X, ELF::X);
775 switch (
Object->getMachine()) {
777 #include "llvm/BinaryFormat/ELFRelocs/x86_64.def"
780 #include "llvm/BinaryFormat/ELFRelocs/Mips.def"
783 #include "llvm/BinaryFormat/ELFRelocs/Hexagon.def"
787 #include "llvm/BinaryFormat/ELFRelocs/i386.def"
790 #include "llvm/BinaryFormat/ELFRelocs/AArch64.def"
793 #include "llvm/BinaryFormat/ELFRelocs/ARM.def"
796 #include "llvm/BinaryFormat/ELFRelocs/ARC.def"
799 #include "llvm/BinaryFormat/ELFRelocs/RISCV.def"
802 #include "llvm/BinaryFormat/ELFRelocs/Lanai.def"
805 #include "llvm/BinaryFormat/ELFRelocs/AMDGPU.def"
808 #include "llvm/BinaryFormat/ELFRelocs/BPF.def"
811 #include "llvm/BinaryFormat/ELFRelocs/VE.def"
814 #include "llvm/BinaryFormat/ELFRelocs/CSKY.def"
817 #include "llvm/BinaryFormat/ELFRelocs/PowerPC64.def"
820 #include "llvm/BinaryFormat/ELFRelocs/M68k.def"
827 IO.enumFallback<Hex32>(
Value);
831 IO &IO, ELFYAML::ELF_DYNTAG &
Value) {
836 #define AARCH64_DYNAMIC_TAG(name, value)
837 #define MIPS_DYNAMIC_TAG(name, value)
838 #define HEXAGON_DYNAMIC_TAG(name, value)
839 #define PPC_DYNAMIC_TAG(name, value)
840 #define PPC64_DYNAMIC_TAG(name, value)
842 #define DYNAMIC_TAG_MARKER(name, value)
844 #define STRINGIFY(X) (#X)
845 #define DYNAMIC_TAG(X, Y) IO.enumCase(Value, STRINGIFY(DT_##X), ELF::DT_##X);
846 switch (
Object->getMachine()) {
848 #undef AARCH64_DYNAMIC_TAG
849 #define AARCH64_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
850 #include "llvm/BinaryFormat/DynamicTags.def"
851 #undef AARCH64_DYNAMIC_TAG
852 #define AARCH64_DYNAMIC_TAG(name, value)
855 #undef MIPS_DYNAMIC_TAG
856 #define MIPS_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
857 #include "llvm/BinaryFormat/DynamicTags.def"
858 #undef MIPS_DYNAMIC_TAG
859 #define MIPS_DYNAMIC_TAG(name, value)
862 #undef HEXAGON_DYNAMIC_TAG
863 #define HEXAGON_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
864 #include "llvm/BinaryFormat/DynamicTags.def"
865 #undef HEXAGON_DYNAMIC_TAG
866 #define HEXAGON_DYNAMIC_TAG(name, value)
869 #undef PPC_DYNAMIC_TAG
870 #define PPC_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
871 #include "llvm/BinaryFormat/DynamicTags.def"
872 #undef PPC_DYNAMIC_TAG
873 #define PPC_DYNAMIC_TAG(name, value)
876 #undef PPC64_DYNAMIC_TAG
877 #define PPC64_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value)
878 #include "llvm/BinaryFormat/DynamicTags.def"
879 #undef PPC64_DYNAMIC_TAG
880 #define PPC64_DYNAMIC_TAG(name, value)
883 #include "llvm/BinaryFormat/DynamicTags.def"
886 #undef AARCH64_DYNAMIC_TAG
887 #undef MIPS_DYNAMIC_TAG
888 #undef HEXAGON_DYNAMIC_TAG
889 #undef PPC_DYNAMIC_TAG
890 #undef PPC64_DYNAMIC_TAG
891 #undef DYNAMIC_TAG_MARKER
895 IO.enumFallback<Hex64>(
Value);
899 IO &IO, ELFYAML::MIPS_AFL_REG &
Value) {
900 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X)
909 IO &IO, ELFYAML::MIPS_ABI_FP &
Value) {
910 #define ECase(X) IO.enumCase(Value, #X, Mips::Val_GNU_MIPS_ABI_##X)
923 IO &IO, ELFYAML::MIPS_AFL_EXT &
Value) {
924 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X)
929 ECase(EXT_LOONGSON_3A);
942 ECase(EXT_LOONGSON_2E);
943 ECase(EXT_LOONGSON_2F);
949 IO &IO, ELFYAML::MIPS_ISA &
Value) {
950 IO.enumCase(
Value,
"MIPS1", 1);
951 IO.enumCase(
Value,
"MIPS2", 2);
952 IO.enumCase(
Value,
"MIPS3", 3);
953 IO.enumCase(
Value,
"MIPS4", 4);
954 IO.enumCase(
Value,
"MIPS5", 5);
955 IO.enumCase(
Value,
"MIPS32", 32);
956 IO.enumCase(
Value,
"MIPS64", 64);
957 IO.enumFallback<Hex32>(
Value);
961 IO &IO, ELFYAML::MIPS_AFL_ASE &
Value) {
962 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_ASE_##X)
982 IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &
Value) {
983 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_FLAGS1_##X)
990 IO.mapRequired(
"Name", SHdr.
Name);
995 IO.mapRequired(
"Class", FileHdr.
Class);
996 IO.mapRequired(
"Data", FileHdr.
Data);
997 IO.mapOptional(
"OSABI", FileHdr.
OSABI, ELFYAML::ELF_ELFOSABI(0));
998 IO.mapOptional(
"ABIVersion", FileHdr.
ABIVersion, Hex8(0));
999 IO.mapRequired(
"Type", FileHdr.
Type);
1000 IO.mapOptional(
"Machine", FileHdr.
Machine);
1001 IO.mapOptional(
"Flags", FileHdr.
Flags, ELFYAML::ELF_EF(0));
1002 IO.mapOptional(
"Entry", FileHdr.
Entry, Hex64(0));
1005 assert(!IO.outputting() ||
1007 IO.mapOptional(
"EPhOff", FileHdr.
EPhOff);
1008 IO.mapOptional(
"EPhEntSize", FileHdr.
EPhEntSize);
1009 IO.mapOptional(
"EPhNum", FileHdr.
EPhNum);
1010 IO.mapOptional(
"EShEntSize", FileHdr.
EShEntSize);
1011 IO.mapOptional(
"EShOff", FileHdr.
EShOff);
1012 IO.mapOptional(
"EShNum", FileHdr.
EShNum);
1013 IO.mapOptional(
"EShStrNdx", FileHdr.
EShStrNdx);
1018 IO.mapRequired(
"Type", Phdr.
Type);
1019 IO.mapOptional(
"Flags", Phdr.
Flags, ELFYAML::ELF_PF(0));
1020 IO.mapOptional(
"FirstSec", Phdr.
FirstSec);
1021 IO.mapOptional(
"LastSec", Phdr.
LastSec);
1022 IO.mapOptional(
"VAddr", Phdr.
VAddr, Hex64(0));
1023 IO.mapOptional(
"PAddr", Phdr.
PAddr, Phdr.
VAddr);
1024 IO.mapOptional(
"Align", Phdr.
Align);
1025 IO.mapOptional(
"FileSize", Phdr.
FileSize);
1026 IO.mapOptional(
"MemSize", Phdr.
MemSize);
1027 IO.mapOptional(
"Offset", Phdr.
Offset);
1033 return "the \"LastSec\" key can't be used without the \"FirstSec\" key";
1035 return "the \"FirstSec\" key can't be used without the \"LastSec\" key";
1041 template <> struct ScalarTraits<StOtherPiece> {
1051 template <>
struct SequenceElementTraits<StOtherPiece> {
1052 static const bool flow =
true;
1055 template <>
struct ScalarTraits<ELFYAML::YAMLFlowString> {
1056 static void output(
const ELFYAML::YAMLFlowString &Val,
void *,
1061 ELFYAML::YAMLFlowString &Val) {
1066 return ScalarTraits<StringRef>::mustQuote(
S);
1069 template <>
struct SequenceElementTraits<ELFYAML::YAMLFlowString> {
1070 static const bool flow =
true;
1075 struct NormalizedOther {
1076 NormalizedOther(IO &IO) :
YamlIO(IO) {}
1078 assert(Original &&
"This constructor is only used for outputting YAML and "
1079 "assumes a non-empty Original");
1080 std::vector<StOtherPiece>
Ret;
1082 for (std::pair<StringRef, uint8_t> &
P :
1084 uint8_t FlagValue =
P.second;
1085 if ((*Original & FlagValue) != FlagValue)
1087 *Original &= ~FlagValue;
1088 Ret.push_back({
P.first});
1091 if (*Original != 0) {
1105 if (It != Flags.
end())
1109 if (to_integer(
Name, Val))
1112 YamlIO.setError(
"an unknown value is used for symbol's 'Other' field: " +
1121 for (StOtherPiece &Val : *
Other)
1122 Ret |= toValue(Val);
1142 if (!
YamlIO.outputting())
1163 Optional<std::vector<StOtherPiece>>
Other;
1175 ELFYAML::YAMLIntUInt &Val) {
1176 const bool Is64 =
static_cast<ELFYAML::Object *
>(Ctx)->Header.Class ==
1181 if (Scalar.empty() || Scalar.startswith(
"-0x"))
1184 if (Scalar.startswith(
"-")) {
1185 const int64_t MinVal = Is64 ?
INT64_MIN : INT32_MIN;
1193 const uint64_t MaxVal = Is64 ?
UINT64_MAX : UINT32_MAX;
1194 unsigned long long UInt;
1203 IO.mapOptional(
"StName",
Symbol.StName);
1204 IO.mapOptional(
"Type",
Symbol.Type, ELFYAML::ELF_STT(0));
1205 IO.mapOptional(
"Section",
Symbol.Section);
1206 IO.mapOptional(
"Index",
Symbol.Index);
1207 IO.mapOptional(
"Binding",
Symbol.Binding, ELFYAML::ELF_STB(0));
1208 IO.mapOptional(
"Value",
Symbol.Value);
1209 IO.mapOptional(
"Size",
Symbol.Size);
1216 MappingNormalization<NormalizedOther, Optional<uint8_t>> Keys(IO,
1218 IO.mapOptional(
"Other", Keys->Other);
1224 return "Index and Section cannot both be specified for Symbol";
1230 IO.mapRequired(
"Type",
Section.Type);
1231 IO.mapOptional(
"Flags",
Section.Flags);
1232 IO.mapOptional(
"Address",
Section.Address);
1233 IO.mapOptional(
"Link",
Section.Link);
1234 IO.mapOptional(
"AddressAlign",
Section.AddressAlign, Hex64(0));
1235 IO.mapOptional(
"EntSize",
Section.EntSize);
1236 IO.mapOptional(
"Offset",
Section.Offset);
1238 IO.mapOptional(
"Content",
Section.Content);
1239 IO.mapOptional(
"Size",
Section.Size);
1244 assert(!IO.outputting() ||
1247 IO.mapOptional(
"ShAddrAlign",
Section.ShAddrAlign);
1248 IO.mapOptional(
"ShName",
Section.ShName);
1249 IO.mapOptional(
"ShOffset",
Section.ShOffset);
1250 IO.mapOptional(
"ShSize",
Section.ShSize);
1251 IO.mapOptional(
"ShFlags",
Section.ShFlags);
1252 IO.mapOptional(
"ShType",
Section.ShType);
1257 IO.mapOptional(
"Entries",
Section.Entries);
1266 IO.mapOptional(
"ContentArray",
Section.ContentBuf);
1269 IO.setError(
"Content and ContentArray can't be used together");
1273 IO.mapOptional(
"Info",
Section.Info);
1278 IO.mapOptional(
"Content",
Section.Content);
1279 IO.mapOptional(
"Entries",
Section.Entries);
1284 IO.mapOptional(
"Entries",
Section.Entries);
1289 IO.mapOptional(
"Bucket",
Section.Bucket);
1290 IO.mapOptional(
"Chain",
Section.Chain);
1294 assert(!IO.outputting() ||
1296 IO.mapOptional(
"NChain",
Section.NChain);
1297 IO.mapOptional(
"NBucket",
Section.NBucket);
1302 IO.mapOptional(
"Notes",
Section.Notes);
1308 IO.mapOptional(
"Header",
Section.Header);
1309 IO.mapOptional(
"BloomFilter",
Section.BloomFilter);
1310 IO.mapOptional(
"HashBuckets",
Section.HashBuckets);
1311 IO.mapOptional(
"HashValues",
Section.HashValues);
1319 IO.mapOptional(
"Info",
Section.Info);
1320 IO.mapOptional(
"Entries",
Section.Entries);
1325 IO.mapOptional(
"Entries",
Section.Entries);
1330 IO.mapOptional(
"Info",
Section.Info);
1331 IO.mapOptional(
"Dependencies",
Section.VerneedV);
1337 IO.mapOptional(
"Relocations",
Section.Relocations);
1342 IO.mapOptional(
"Entries",
Section.Entries);
1347 IO.mapOptional(
"Info", Group.
Signature);
1348 IO.mapOptional(
"Members", Group.
Members);
1353 IO.mapOptional(
"Entries",
Section.Entries);
1358 IO.mapOptional(
"Symbols",
Section.Symbols);
1363 IO.mapOptional(
"Pattern", Fill.
Pattern);
1364 IO.mapOptional(
"Offset", Fill.
Offset);
1365 IO.mapRequired(
"Size", Fill.
Size);
1370 IO.mapOptional(
"Offset", SHT.
Offset);
1371 IO.mapOptional(
"Sections", SHT.
Sections);
1372 IO.mapOptional(
"Excluded", SHT.
Excluded);
1373 IO.mapOptional(
"NoHeaders", SHT.
NoHeaders);
1378 IO.mapOptional(
"Options",
Section.Options);
1384 IO.mapOptional(
"Libraries",
Section.Libs);
1389 IO.mapOptional(
"Entries",
Section.Entries);
1399 IO.mapOptional(
"Entries",
Section.Entries);
1404 IO.mapOptional(
"Version",
Section.Version, Hex16(0));
1405 IO.mapRequired(
"ISA",
Section.ISALevel);
1406 IO.mapOptional(
"ISARevision",
Section.ISARevision, Hex8(0));
1407 IO.mapOptional(
"ISAExtension",
Section.ISAExtension,
1409 IO.mapOptional(
"ASEs",
Section.ASEs, ELFYAML::MIPS_AFL_ASE(0));
1410 IO.mapOptional(
"FpABI",
Section.FpABI,
1412 IO.mapOptional(
"GPRSize",
Section.GPRSize,
1414 IO.mapOptional(
"CPR1Size",
Section.CPR1Size,
1416 IO.mapOptional(
"CPR2Size",
Section.CPR2Size,
1418 IO.mapOptional(
"Flags1",
Section.Flags1, ELFYAML::MIPS_AFL_FLAGS1(0));
1419 IO.mapOptional(
"Flags2",
Section.Flags2, Hex32(0));
1424 IO.mapRequired(
Key, Val);
1429 IO.mapRequired(
Key, Val);
1438 IO &IO, std::unique_ptr<ELFYAML::Chunk> &
Section) {
1439 ELFYAML::ELF_SHT
Type;
1441 if (IO.outputting()) {
1442 if (
auto *
S = dyn_cast<ELFYAML::Section>(
Section.get()))
1444 else if (
auto *SHT = dyn_cast<ELFYAML::SectionHeaderTable>(
Section.get()))
1445 TypeStr = SHT->TypeStr;
1451 IO.mapRequired(
"Type",
Type);
1454 if (TypeStr ==
"Fill") {
1455 assert(!IO.outputting());
1462 if (IO.outputting())
1468 IO, *cast<ELFYAML::SectionHeaderTable>(
Section.get()));
1474 if (!IO.outputting())
1481 if (!IO.outputting())
1489 if (!IO.outputting())
1495 if (!IO.outputting())
1500 if (!IO.outputting())
1505 if (!IO.outputting())
1510 if (!IO.outputting())
1515 if (!IO.outputting())
1520 if (!IO.outputting())
1525 if (!IO.outputting())
1530 if (!IO.outputting())
1535 if (!IO.outputting())
1540 if (!IO.outputting())
1545 if (!IO.outputting())
1550 if (!IO.outputting())
1555 if (!IO.outputting())
1560 if (!IO.outputting())
1563 *cast<ELFYAML::DependentLibrariesSection>(
Section.get()));
1566 if (!IO.outputting())
1571 if (!IO.outputting())
1576 if (!IO.outputting()) {
1582 Section = std::make_unique<ELFYAML::StackSizesSection>();
1584 Section = std::make_unique<ELFYAML::RawContentSection>();
1587 if (
auto S = dyn_cast<ELFYAML::RawContentSection>(
Section.get()))
1595 IO &io, std::unique_ptr<ELFYAML::Chunk> &
C) {
1596 if (
const auto *
F = dyn_cast<ELFYAML::Fill>(
C.get())) {
1597 if (
F->Pattern &&
F->Pattern->binary_size() != 0 && !
F->Size)
1598 return "\"Size\" can't be 0 when \"Pattern\" is not empty";
1602 if (
const auto *SHT = dyn_cast<ELFYAML::SectionHeaderTable>(
C.get())) {
1603 if (SHT->NoHeaders && (SHT->Sections || SHT->Excluded || SHT->Offset))
1604 return "NoHeaders can't be used together with Offset/Sections/Excluded";
1610 (uint64_t)(*Sec.
Size) < Sec.
Content->binary_size())
1611 return "Section size must be greater than or equal to the content size";
1615 for (
size_t I = 0,
E = EntV.size();
I !=
E; ++
I) {
1618 Msg =
"\"" +
Name.str() +
"\"";
1621 if (
I != EntV.size() - 1)
1622 Msg +=
", \"" +
Name.str() +
"\"";
1624 Msg +=
" and \"" +
Name.str() +
"\"";
1629 std::vector<std::pair<StringRef, bool>> Entries = Sec.
getEntries();
1631 Entries, [](
const std::pair<StringRef, bool> &
P) {
return P.second; });
1633 if ((Sec.
Size || Sec.
Content) && NumUsedEntries > 0)
1634 return BuildErrPrefix(Entries) +
1635 " cannot be used with \"Content\" or \"Size\"";
1637 if (NumUsedEntries > 0 && Entries.size() != NumUsedEntries)
1638 return BuildErrPrefix(Entries) +
" must be used together";
1640 if (
const auto *RawSection = dyn_cast<ELFYAML::RawContentSection>(
C.get())) {
1641 if (RawSection->Flags && RawSection->ShFlags)
1642 return "ShFlags and Flags cannot be used together";
1646 if (
const auto *NB = dyn_cast<ELFYAML::NoBitsSection>(
C.get())) {
1648 return "SHT_NOBITS section cannot have \"Content\"";
1652 if (
const auto *MF = dyn_cast<ELFYAML::MipsABIFlags>(
C.get())) {
1654 return "\"Content\" key is not implemented for SHT_MIPS_ABIFLAGS "
1657 return "\"Size\" key is not implemented for SHT_MIPS_ABIFLAGS sections";
1666 struct NormalizedMips64RelType {
1667 NormalizedMips64RelType(IO &)
1668 :
Type(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
1669 Type2(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
1670 Type3(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
1672 NormalizedMips64RelType(IO &, ELFYAML::ELF_REL Original)
1673 :
Type(Original & 0xFF),
Type2(Original >> 8 & 0xFF),
1674 Type3(Original >> 16 & 0xFF),
SpecSym(Original >> 24 & 0xFF) {}
1676 ELFYAML::ELF_REL denormalize(IO &) {
1681 ELFYAML::ELF_REL Type;
1691 assert(IO.getContext() &&
"The IO context is not initialized");
1692 IO.mapOptional(
"Address",
E.Address, Hex64(0));
1693 IO.mapRequired(
"Size",
E.Size);
1698 assert(IO.getContext() &&
"The IO context is not initialized");
1699 IO.mapOptional(
"Address",
E.Address, Hex64(0));
1700 IO.mapOptional(
"NumBlocks",
E.NumBlocks);
1701 IO.mapOptional(
"BBEntries",
E.BBEntries);
1706 assert(IO.getContext() &&
"The IO context is not initialized");
1707 IO.mapRequired(
"AddressOffset",
E.AddressOffset);
1708 IO.mapRequired(
"Size",
E.Size);
1709 IO.mapRequired(
"Metadata",
E.Metadata);
1714 assert(IO.getContext() &&
"The IO context is not initialized");
1715 IO.mapOptional(
"NBuckets",
E.NBuckets);
1716 IO.mapRequired(
"SymNdx",
E.SymNdx);
1717 IO.mapOptional(
"MaskWords",
E.MaskWords);
1718 IO.mapRequired(
"Shift2",
E.Shift2);
1723 assert(IO.getContext() &&
"The IO context is not initialized");
1725 IO.mapRequired(
"Tag", Rel.
Tag);
1726 IO.mapRequired(
"Value", Rel.
Val);
1730 assert(IO.getContext() &&
"The IO context is not initialized");
1732 IO.mapOptional(
"Name",
N.Name);
1733 IO.mapOptional(
"Desc",
N.Desc);
1734 IO.mapRequired(
"Type",
N.Type);
1739 assert(IO.getContext() &&
"The IO context is not initialized");
1741 IO.mapOptional(
"Version",
E.Version);
1742 IO.mapOptional(
"Flags",
E.Flags);
1743 IO.mapOptional(
"VersionNdx",
E.VersionNdx);
1744 IO.mapOptional(
"Hash",
E.Hash);
1745 IO.mapRequired(
"Names",
E.VerNames);
1750 assert(IO.getContext() &&
"The IO context is not initialized");
1752 IO.mapRequired(
"Version",
E.Version);
1753 IO.mapRequired(
"File",
E.File);
1754 IO.mapRequired(
"Entries",
E.AuxV);
1759 assert(IO.getContext() &&
"The IO context is not initialized");
1761 IO.mapRequired(
"Name",
E.Name);
1762 IO.mapRequired(
"Hash",
E.Hash);
1763 IO.mapRequired(
"Flags",
E.Flags);
1764 IO.mapRequired(
"Other",
E.Other);
1772 IO.mapOptional(
"Offset", Rel.
Offset, (Hex64)0);
1773 IO.mapOptional(
"Symbol", Rel.
Symbol);
1777 MappingNormalization<NormalizedMips64RelType, ELFYAML::ELF_REL>
Key(
1779 IO.mapRequired(
"Type",
Key->Type);
1780 IO.mapOptional(
"Type2",
Key->Type2, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
1781 IO.mapOptional(
"Type3",
Key->Type3, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
1784 IO.mapRequired(
"Type", Rel.
Type);
1786 IO.mapOptional(
"Addend", Rel.
Addend, (ELFYAML::YAMLIntUInt)0);
1791 assert(IO.getContext() &&
"The IO context is not initialized");
1792 IO.mapRequired(
"Offset",
E.Offset);
1794 StringRef CantUnwind =
"EXIDX_CANTUNWIND";
1796 IO.mapRequired(
"Value", CantUnwind);
1797 else if (!IO.outputting() &&
getStringValue(IO,
"Value") == CantUnwind)
1800 IO.mapRequired(
"Value",
E.Value);
1804 assert(!IO.getContext() &&
"The IO context is initialized already");
1806 IO.mapTag(
"!ELF",
true);
1807 IO.mapRequired(
"FileHeader",
Object.Header);
1808 IO.mapOptional(
"ProgramHeaders",
Object.ProgramHeaders);
1809 IO.mapOptional(
"Sections",
Object.Chunks);
1810 IO.mapOptional(
"Symbols",
Object.Symbols);
1811 IO.mapOptional(
"DynamicSymbols",
Object.DynamicSymbols);
1812 IO.mapOptional(
"DWARF",
Object.DWARF);
1814 Object.DWARF->IsLittleEndian =
1816 Object.DWARF->Is64BitAddrSize =
1819 IO.setContext(
nullptr);
1824 assert(IO.getContext() &&
"The IO context is not initialized");
1825 IO.mapRequired(
"Name", Opt.
Key);
1826 IO.mapRequired(
"Value", Opt.
Value);
1831 assert(IO.getContext() &&
"The IO context is not initialized");
1832 IO.mapRequired(
"From",
E.From);
1833 IO.mapRequired(
"To",
E.To);
1834 IO.mapRequired(
"Weight",
E.Weight);
Optional< StringRef > Symbol
@ EF_RISCV_FLOAT_ABI_SOFT
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
@ EF_AMDGPU_MACH_AMDGCN_GFX810
@ EF_AMDGPU_MACH_AMDGCN_GFX1032
static void enumeration(IO &IO, ELFYAML::ELF_DYNTAG &Value)
static StringRef getStringValue(IO &IO, const char *Key)
@ EF_AMDGPU_MACH_R600_CEDAR
@ EF_RISCV_FLOAT_ABI_QUAD
static void bitset(IO &IO, ELFYAML::ELF_EF &Value)
static void fillMapping(IO &IO, ELFYAML::Fill &Fill)
@ EF_AMDGPU_FEATURE_SRAMECC_V3
@ EF_AMDGPU_MACH_AMDGCN_GFX602
@ EF_AMDGPU_MACH_R600_BARTS
@ EF_AMDGPU_MACH_AMDGCN_GFX702
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
@ NT_FREEBSD_PROCSTAT_VMMAP
@ EF_AMDGPU_MACH_AMDGCN_GFX703
@ EF_AMDGPU_FEATURE_XNACK_V4
static StringRef input(StringRef Scalar, void *, StOtherPiece &Val)
@ EF_AMDGPU_MACH_AMDGCN_GFX1031
@ EF_AMDGPU_MACH_AMDGCN_GFX704
@ EF_AMDGPU_MACH_AMDGCN_GFX1033
@ EF_AMDGPU_FEATURE_XNACK_OFF_V4
static void enumeration(IO &IO, ELFYAML::MIPS_ISA &Value)
@ NT_FREEBSD_PROCSTAT_GROUPS
@ EF_AMDGPU_FEATURE_XNACK_ANY_V4
@ EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4
static void enumeration(IO &IO, ELFYAML::ELF_STT &Value)
The instances of the Type class are immutable: once they are created, they are never changed.
@ EF_AMDGPU_MACH_AMDGCN_GFX802
@ SHT_LLVM_CALL_GRAPH_PROFILE
@ EF_AMDGPU_MACH_R600_RV730
Optional< llvm::yaml::Hex64 > Offset
@ EF_AMDGPU_MACH_R600_TURKS
static void enumeration(IO &IO, ELFYAML::ELF_SHN &Value)
static void enumeration(IO &IO, ELFYAML::ELF_PT &Value)
This class implements a map that also provides access to all stored values in a deterministic order.
@ EF_AMDGPU_MACH_R600_RV770
@ Val_GNU_MIPS_ABI_FP_ANY
@ EF_AMDGPU_MACH_AMDGCN_GFX904
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
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...
static void output(const ELFYAML::YAMLFlowString &Val, void *, raw_ostream &Out)
static void sectionHeaderTableMapping(IO &IO, ELFYAML::SectionHeaderTable &SHT)
@ NT_FREEBSD_PROCSTAT_UMASK
static bool isInteger(StringRef Val)
static void enumeration(IO &IO, ELFYAML::ELF_ELFOSABI &Value)
@ ELFABIVERSION_AMDGPU_HSA_V4
@ EF_AMDGPU_FEATURE_SRAMECC_ANY_V4
@ EF_AMDGPU_MACH_AMDGCN_GFX700
@ EF_AMDGPU_MACH_AMDGCN_GFX90A
@ EF_AMDGPU_MACH_AMDGCN_GFX601
@ NT_FREEBSD_PROCSTAT_PROC
std::string UnknownFlagsHolder
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
@ EF_AMDGPU_MACH_R600_CAYMAN
@ EF_AMDGPU_MACH_AMDGCN_GFX600
(vector float) vec_cmpeq(*A, *B) C
@ EF_AMDGPU_MACH_R600_CYPRESS
@ ELFABIVERSION_AMDGPU_HSA_V3
static void enumeration(IO &IO, ELFYAML::MIPS_ABI_FP &Value)
bool getAsUnsignedInteger(StringRef Str, unsigned Radix, unsigned long long &Result)
Helper functions for StringRef::getAsInteger.
@ EF_AMDGPU_MACH_AMDGCN_GFX900
static void enumeration(IO &IO, ELFYAML::ELF_REL &Value)
@ EF_AMDGPU_MACH_AMDGCN_GFX1010
@ EF_RISCV_FLOAT_ABI_DOUBLE
@ EF_AMDGPU_MACH_R600_R630
static void bitset(IO &IO, ELFYAML::ELF_SHF &Value)
static void bitset(IO &IO, ELFYAML::MIPS_AFL_ASE &Value)
This class implements an extremely fast bulk output stream that can only output to a stream.
@ EF_AMDGPU_MACH_R600_REDWOOD
@ EF_AMDGPU_MACH_AMDGCN_GFX906
The initial backend is deliberately restricted to z10 We should add support for later architectures at some point If an asm ties an i32 r result to an i64 input
@ NT_GNU_BUILD_ATTRIBUTE_FUNC
std::enable_if_t< std::numeric_limits< T >::is_signed, bool > getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
@ SHT_LLVM_LINKER_OPTIONS
@ EF_AMDGPU_MACH_AMDGCN_GFX1030
StringRef dropUniqueSuffix(StringRef S)
@ EF_AMDGPU_MACH_R600_CAICOS
static void bitset(IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &Value)
StringRef sectionNameOrType
Optional< yaml::BinaryRef > Pattern
Optional< std::vector< SectionOrType > > Members
unsigned getMachine() const
@ EF_AMDGPU_MACH_AMDGCN_GFX701
@ EF_AMDGPU_FEATURE_SRAMECC_OFF_V4
@ NT_FREEBSD_PROCSTAT_AUXV
iterator find(const KeyT &Key)
Code Generation Notes for MSA
static void bitset(IO &IO, ELFYAML::ELF_PF &Value)
@ EF_AMDGPU_MACH_AMDGCN_GFX801
static void enumeration(IO &IO, ELFYAML::ELF_ELFDATA &Value)
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
@ EF_RISCV_FLOAT_ABI_SINGLE
@ EF_AMDGPU_FEATURE_XNACK_ON_V4
@ EF_AMDGPU_MACH_AMDGCN_GFX705
@ SHT_LLVM_DEPENDENT_LIBRARIES
@ EF_AMDGPU_MACH_AMDGCN_GFX909
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static StringRef input(StringRef Scalar, void *, ELFYAML::YAMLFlowString &Val)
@ NT_FREEBSD_PROCSTAT_PSSTRINGS
static void sectionMapping(IO &IO, ELFYAML::DynamicSection &Section)
@ EF_AMDGPU_MACH_AMDGCN_GFX90C
Class for arbitrary precision integers.
static void output(const StOtherPiece &Val, void *, raw_ostream &Out)
@ EF_AMDGPU_MACH_AMDGCN_GFX805
@ NT_FREEBSD_PROCSTAT_RLIMIT
static void enumeration(IO &IO, ELFYAML::MIPS_AFL_REG &Value)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
@ EF_AMDGPU_MACH_AMDGCN_GFX902
static QuotingType mustQuote(StringRef)
static void enumeration(IO &IO, ELFYAML::ELF_ET &Value)
StringRef - Represent a constant reference to a string, i.e.
Specialized YAMLIO scalar type for representing a binary blob.
@ EF_AMDGPU_MACH_R600_RV710
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
static void enumeration(IO &IO, ELFYAML::MIPS_AFL_EXT &Value)
static void commonSectionMapping(IO &IO, ELFYAML::Section &Section)
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
static void groupSectionMapping(IO &IO, ELFYAML::GroupSection &Group)
static void enumeration(IO &IO, ELFYAML::ELF_STB &Value)
@ NT_GNU_BUILD_ATTRIBUTE_OPEN
static void enumeration(IO &IO, ELFYAML::ELF_EM &Value)
static uint32_t getFlags(const Symbol *Sym)
static QuotingType mustQuote(StringRef S)
@ EXIDX_CANTUNWIND
Special entry for the function never unwind.
@ NT_FREEBSD_PROCSTAT_OSREL
@ EF_AMDGPU_MACH_AMDGCN_GFX908
Optional< yaml::BinaryRef > Content
Optional< StringRef > Signature
@ EF_AMDGPU_FEATURE_SRAMECC_V4
@ EF_AMDGPU_MACH_R600_JUNIPER
static void enumeration(IO &IO, ELFYAML::ELF_ELFCLASS &Value)
static void enumeration(IO &IO, ELFYAML::ELF_NT &Value)
Optional< llvm::yaml::Hex64 > Size
bool getAsSignedInteger(StringRef Str, unsigned Radix, long long &Result)
static bool nameMatches(StringRef Name)
@ EF_AMDGPU_MACH_R600_RV670
@ EF_AMDGPU_MACH_AMDGCN_GFX1011
std::string to_string(const T &Value)
@ EF_AMDGPU_MACH_R600_R600
static void enumeration(IO &IO, ELFYAML::ELF_SHT &Value)
@ EF_AMDGPU_MACH_AMDGCN_GFX1012
@ EF_AMDGPU_MACH_R600_RS880
@ NT_FREEBSD_PROCSTAT_FILES
@ EF_AVR_LINKRELAX_PREPARED
@ EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4
@ EF_AMDGPU_MACH_R600_SUMO
@ STO_AARCH64_VARIANT_PCS
@ EF_AMDGPU_FEATURE_XNACK_V3
LLVM Value Representation.
@ EF_AMDGPU_FEATURE_SRAMECC_ON_V4
virtual std::vector< std::pair< StringRef, bool > > getEntries() const
Optional< std::vector< StOtherPiece > > Other
@ EF_AMDGPU_MACH_AMDGCN_GFX803
static void setStringValue(IO &IO, const char *Key, StringRef Val)