15#ifndef LLVM_OBJECTYAML_ELFYAML_H
16#define LLVM_OBJECTYAML_ELFYAML_H
85 return sizeof(
typename ELFT::Sym);
87 return sizeof(
typename ELFT::Word);
89 return sizeof(
typename ELFT::Rel);
91 return sizeof(
typename ELFT::Rela);
93 return sizeof(
typename ELFT::Relr);
95 return sizeof(
typename ELFT::Dyn);
97 return sizeof(
typename ELFT::Word);
99 return sizeof(
typename ELFT::Word);
101 return sizeof(
typename ELFT::Half);
105 if (SecName ==
".debug_str")
143 std::optional<llvm::yaml::Hex64>
Value;
144 std::optional<llvm::yaml::Hex64>
Size;
235 std::optional<llvm::yaml::Hex64>
Size;
249 virtual std::vector<std::pair<StringRef, bool>>
getEntries()
const {
301 std::optional<std::vector<SectionHeader>>
Sections;
302 std::optional<std::vector<SectionHeader>>
Excluded;
319 std::optional<std::vector<BBAddrMapEntry>>
Entries;
323 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
324 return {{
"Entries",
Entries.has_value()}};
333 std::optional<std::vector<StackSizeEntry>>
Entries;
337 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
338 return {{
"Entries",
Entries.has_value()}};
346 return Name ==
".stack_sizes";
351 std::optional<std::vector<DynamicEntry>>
Entries;
355 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
356 return {{
"Entries",
Entries.has_value()}};
363 std::optional<llvm::yaml::Hex64>
Info;
382 std::optional<std::vector<ELFYAML::NoteEntry>>
Notes;
386 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
387 return {{
"Notes",
Notes.has_value()}};
394 std::optional<std::vector<uint32_t>>
Bucket;
395 std::optional<std::vector<uint32_t>>
Chain;
397 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
398 return {{
"Bucket",
Bucket.has_value()}, {
"Chain",
Chain.has_value()}};
439 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
440 return {{
"Header",
Header.has_value()},
459 std::vector<VernauxEntry>
AuxV;
464 std::optional<llvm::yaml::Hex64>
Info;
468 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
469 return {{
"Dependencies",
VerneedV.has_value()}};
478 std::optional<std::vector<YAMLFlowString>>
Symbols;
482 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
483 return {{
"Symbols",
Symbols.has_value()}};
495 std::optional<std::vector<LinkerOption>>
Options;
499 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
500 return {{
"Options",
Options.has_value()}};
509 std::optional<std::vector<YAMLFlowString>>
Libs;
513 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
514 return {{
"Libraries",
Libs.has_value()}};
529 std::optional<std::vector<CallGraphEntryWeight>>
Entries;
533 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
534 return {{
"Entries",
Entries.has_value()}};
547 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
548 return {{
"Entries",
Entries.has_value()}};
563 std::optional<std::vector<VerdefEntry>>
Entries;
564 std::optional<llvm::yaml::Hex64>
Info;
568 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
569 return {{
"Entries",
Entries.has_value()}};
578 std::optional<std::vector<SectionOrType>>
Members;
583 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
584 return {{
"Members",
Members.has_value()}};
603 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
613 std::optional<std::vector<llvm::yaml::Hex64>>
Entries;
617 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
618 return {{
"Entries",
Entries.has_value()}};
631 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
632 return {{
"Entries",
Entries.has_value()}};
646 std::optional<std::vector<ARMIndexTableEntry>>
Entries;
650 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
651 return {{
"Entries",
Entries.has_value()}};
685 std::optional<llvm::yaml::Hex64>
Align;
702 std::vector<std::unique_ptr<Chunk>>
Chunks;
710 std::optional<DWARFYAML::Data>
DWARF;
713 std::vector<Section *> Ret;
714 for (
const std::unique_ptr<Chunk> &Sec :
Chunks)
715 if (
auto S = dyn_cast<ELFYAML::Section>(Sec.get()))
721 for (
const std::unique_ptr<Chunk> &
C :
Chunks)
722 if (
auto *S = dyn_cast<ELFYAML::SectionHeaderTable>(
C.get()))
732 const NoBitsSection &S);
758template <>
struct ScalarTraits<ELFYAML::YAMLIntUInt> {
759 static void output(
const ELFYAML::YAMLIntUInt &Val,
void *Ctx,
762 ELFYAML::YAMLIntUInt &Val);
767struct ScalarEnumerationTraits<ELFYAML::ELF_ET> {
768 static void enumeration(IO &IO, ELFYAML::ELF_ET &
Value);
771template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_PT> {
772 static void enumeration(IO &IO, ELFYAML::ELF_PT &
Value);
775template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_NT> {
776 static void enumeration(IO &IO, ELFYAML::ELF_NT &
Value);
780struct ScalarEnumerationTraits<ELFYAML::ELF_EM> {
781 static void enumeration(IO &IO, ELFYAML::ELF_EM &
Value);
785struct ScalarEnumerationTraits<ELFYAML::ELF_ELFCLASS> {
786 static void enumeration(IO &IO, ELFYAML::ELF_ELFCLASS &
Value);
790struct ScalarEnumerationTraits<ELFYAML::ELF_ELFDATA> {
791 static void enumeration(IO &IO, ELFYAML::ELF_ELFDATA &
Value);
795struct ScalarEnumerationTraits<ELFYAML::ELF_ELFOSABI> {
796 static void enumeration(IO &IO, ELFYAML::ELF_ELFOSABI &
Value);
800struct ScalarBitSetTraits<ELFYAML::ELF_EF> {
801 static void bitset(IO &IO, ELFYAML::ELF_EF &
Value);
804template <>
struct ScalarBitSetTraits<ELFYAML::ELF_PF> {
805 static void bitset(IO &IO, ELFYAML::ELF_PF &
Value);
809struct ScalarEnumerationTraits<ELFYAML::ELF_SHT> {
810 static void enumeration(IO &IO, ELFYAML::ELF_SHT &
Value);
814struct ScalarBitSetTraits<ELFYAML::ELF_SHF> {
815 static void bitset(IO &IO, ELFYAML::ELF_SHF &
Value);
818template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_SHN> {
819 static void enumeration(IO &IO, ELFYAML::ELF_SHN &
Value);
822template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_STB> {
823 static void enumeration(IO &IO, ELFYAML::ELF_STB &
Value);
827struct ScalarEnumerationTraits<ELFYAML::ELF_STT> {
828 static void enumeration(IO &IO, ELFYAML::ELF_STT &
Value);
832struct ScalarEnumerationTraits<ELFYAML::ELF_REL> {
833 static void enumeration(IO &IO, ELFYAML::ELF_REL &
Value);
837struct ScalarEnumerationTraits<ELFYAML::ELF_DYNTAG> {
838 static void enumeration(IO &IO, ELFYAML::ELF_DYNTAG &
Value);
842struct ScalarEnumerationTraits<ELFYAML::ELF_RSS> {
843 static void enumeration(IO &IO, ELFYAML::ELF_RSS &
Value);
847struct ScalarEnumerationTraits<ELFYAML::MIPS_AFL_REG> {
848 static void enumeration(IO &IO, ELFYAML::MIPS_AFL_REG &
Value);
852struct ScalarEnumerationTraits<ELFYAML::MIPS_ABI_FP> {
853 static void enumeration(IO &IO, ELFYAML::MIPS_ABI_FP &
Value);
857struct ScalarEnumerationTraits<ELFYAML::MIPS_AFL_EXT> {
858 static void enumeration(IO &IO, ELFYAML::MIPS_AFL_EXT &
Value);
862struct ScalarEnumerationTraits<ELFYAML::MIPS_ISA> {
863 static void enumeration(IO &IO, ELFYAML::MIPS_ISA &
Value);
867struct ScalarBitSetTraits<ELFYAML::MIPS_AFL_ASE> {
868 static void bitset(IO &IO, ELFYAML::MIPS_AFL_ASE &
Value);
872struct ScalarBitSetTraits<ELFYAML::MIPS_AFL_FLAGS1> {
873 static void bitset(IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &
Value);
949 static void mapping(IO &IO, std::unique_ptr<ELFYAML::Chunk> &
C);
950 static std::string validate(IO &io, std::unique_ptr<ELFYAML::Chunk> &
C);
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file declares classes for handling the YAML representation of DWARF Debug Info.
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
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.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
std::string appendUniqueSuffix(StringRef Name, const Twine &Msg)
unsigned getDefaultShEntSize(unsigned EMachine, ELF_SHT SecType, StringRef SecName)
StringRef dropUniqueSuffix(StringRef S)
bool shouldAllocateFileSpace(ArrayRef< ProgramHeader > Phdrs, const NoBitsSection &S)
@ SHT_LLVM_CALL_GRAPH_PROFILE
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.
std::vector< std::pair< StringRef, bool > > getEntries() const override
static bool classof(const Chunk *S)
std::optional< std::vector< ARMIndexTableEntry > > Entries
std::optional< std::vector< YAMLFlowString > > Symbols
std::vector< std::pair< StringRef, bool > > getEntries() const override
static bool classof(const Chunk *S)
llvm::yaml::Hex64 Metadata
llvm::yaml::Hex64 AddressOffset
std::optional< uint64_t > NumBlocks
std::optional< std::vector< BBEntry > > BBEntries
llvm::yaml::Hex64 Address
std::vector< std::pair< StringRef, bool > > getEntries() const override
static bool classof(const Chunk *S)
std::optional< std::vector< BBAddrMapEntry > > Entries
std::optional< std::vector< CallGraphEntryWeight > > Entries
CallGraphProfileSection()
std::vector< std::pair< StringRef, bool > > getEntries() const override
static bool classof(const Chunk *S)
Chunk(ChunkKind K, bool Implicit)
std::optional< llvm::yaml::Hex64 > Offset
std::vector< std::pair< StringRef, bool > > getEntries() const override
DependentLibrariesSection()
static bool classof(const Chunk *S)
std::optional< std::vector< YAMLFlowString > > Libs
std::vector< std::pair< StringRef, bool > > getEntries() const override
static bool classof(const Chunk *S)
std::optional< std::vector< DynamicEntry > > Entries
std::optional< yaml::BinaryRef > Pattern
static bool classof(const Chunk *S)
std::optional< std::vector< llvm::yaml::Hex64 > > BloomFilter
std::optional< std::vector< llvm::yaml::Hex32 > > HashBuckets
std::vector< std::pair< StringRef, bool > > getEntries() const override
static bool classof(const Chunk *S)
std::optional< GnuHashHeader > Header
std::optional< std::vector< llvm::yaml::Hex32 > > HashValues
static bool classof(const Chunk *S)
std::optional< std::vector< SectionOrType > > Members
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< StringRef > Signature
std::optional< std::vector< uint32_t > > Chain
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< llvm::yaml::Hex64 > NChain
static bool classof(const Chunk *S)
std::optional< std::vector< uint32_t > > Bucket
std::optional< llvm::yaml::Hex64 > NBucket
std::optional< std::vector< LinkerOption > > Options
static bool classof(const Chunk *S)
std::vector< std::pair< StringRef, bool > > getEntries() const override
llvm::yaml::Hex16 Version
static bool classof(const Chunk *S)
llvm::yaml::Hex8 ISARevision
MIPS_AFL_EXT ISAExtension
static bool classof(const Chunk *S)
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< std::vector< ELFYAML::NoteEntry > > Notes
static bool classof(const Chunk *S)
std::optional< std::vector< Symbol > > DynamicSymbols
unsigned getMachine() const
std::optional< DWARFYAML::Data > DWARF
const SectionHeaderTable & getSectionHeaderTable() const
std::vector< std::unique_ptr< Chunk > > Chunks
ELF_ELFOSABI getOSAbi() const
std::vector< ProgramHeader > ProgramHeaders
std::optional< std::vector< Symbol > > Symbols
std::vector< Section * > getSections()
static bool classof(const Chunk *S)
std::optional< llvm::yaml::Hex64 > Info
std::optional< std::vector< uint8_t > > ContentBuf
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< std::vector< Relocation > > Relocations
static bool classof(const Chunk *S)
std::optional< StringRef > Symbol
static bool classof(const Chunk *S)
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< std::vector< llvm::yaml::Hex64 > > Entries
StringRef sectionNameOrType
std::optional< llvm::yaml::Hex64 > Address
std::optional< StringRef > Link
Section(ChunkKind Kind, bool IsImplicit=false)
std::optional< llvm::yaml::Hex64 > Size
static bool classof(const Chunk *S)
std::optional< llvm::yaml::Hex64 > ShAddrAlign
llvm::yaml::Hex64 AddressAlign
std::optional< ELF_SHF > Flags
std::optional< ELF_SHT > ShType
std::optional< llvm::yaml::Hex64 > ShOffset
virtual std::vector< std::pair< StringRef, bool > > getEntries() const
std::optional< llvm::yaml::Hex64 > ShFlags
std::optional< llvm::yaml::Hex64 > ShName
std::optional< yaml::BinaryRef > Content
std::optional< llvm::yaml::Hex64 > EntSize
std::optional< llvm::yaml::Hex64 > ShSize
llvm::yaml::Hex64 Address
static bool classof(const Chunk *S)
static bool nameMatches(StringRef Name)
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< std::vector< StackSizeEntry > > Entries
std::optional< ELF_SHN > Index
std::optional< StringRef > Section
std::optional< uint8_t > Other
std::optional< uint32_t > StName
std::optional< llvm::yaml::Hex64 > Value
std::optional< llvm::yaml::Hex64 > Size
std::vector< std::pair< StringRef, bool > > getEntries() const override
static bool classof(const Chunk *S)
std::optional< std::vector< uint32_t > > Entries
std::optional< std::vector< uint16_t > > Entries
std::vector< std::pair< StringRef, bool > > getEntries() const override
static bool classof(const Chunk *S)
std::optional< uint16_t > Flags
std::vector< StringRef > VerNames
std::optional< uint16_t > VersionNdx
std::optional< uint16_t > Version
std::optional< uint32_t > Hash
static bool classof(const Chunk *S)
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< llvm::yaml::Hex64 > Info
std::optional< std::vector< VerdefEntry > > Entries
std::vector< VernauxEntry > AuxV
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< llvm::yaml::Hex64 > Info
static bool classof(const Chunk *S)
std::optional< std::vector< VerneedEntry > > VerneedV
static QuotingType mustQuote(StringRef)