15#ifndef LLVM_OBJECTYAML_ELFYAML_H
16#define LLVM_OBJECTYAML_ELFYAML_H
86 return sizeof(
typename ELFT::Sym);
88 return sizeof(
typename ELFT::Word);
90 return sizeof(
typename ELFT::Rel);
92 return sizeof(
typename ELFT::Rela);
94 return sizeof(
typename ELFT::Relr);
96 return sizeof(
typename ELFT::Dyn);
98 return sizeof(
typename ELFT::Word);
100 return sizeof(
typename ELFT::Word);
102 return sizeof(
typename ELFT::Half);
106 if (SecName ==
".debug_str")
144 std::optional<llvm::yaml::Hex64>
Value;
145 std::optional<llvm::yaml::Hex64>
Size;
222 std::optional<llvm::yaml::Hex64>
Size;
236 virtual std::vector<std::pair<StringRef, bool>>
getEntries()
const {
288 std::optional<std::vector<SectionHeader>>
Sections;
289 std::optional<std::vector<SectionHeader>>
Excluded;
306 std::optional<std::vector<BBAddrMapYAML::BBAddrMapEntry>>
Entries;
307 std::optional<std::vector<BBAddrMapYAML::PGOAnalysisMapEntry>>
PGOAnalyses;
311 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
312 return {{
"Entries",
Entries.has_value()}};
321 std::optional<std::vector<StackSizeEntry>>
Entries;
325 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
326 return {{
"Entries",
Entries.has_value()}};
334 return Name ==
".stack_sizes";
339 std::optional<std::vector<DynamicEntry>>
Entries;
343 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
344 return {{
"Entries",
Entries.has_value()}};
351 std::optional<llvm::yaml::Hex64>
Info;
370 std::optional<std::vector<ELFYAML::NoteEntry>>
Notes;
374 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
375 return {{
"Notes",
Notes.has_value()}};
382 std::optional<std::vector<uint32_t>>
Bucket;
383 std::optional<std::vector<uint32_t>>
Chain;
385 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
386 return {{
"Bucket",
Bucket.has_value()}, {
"Chain",
Chain.has_value()}};
427 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
428 return {{
"Header",
Header.has_value()},
447 std::vector<VernauxEntry>
AuxV;
452 std::optional<llvm::yaml::Hex64>
Info;
456 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
457 return {{
"Dependencies",
VerneedV.has_value()}};
466 std::optional<std::vector<YAMLFlowString>>
Symbols;
470 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
471 return {{
"Symbols",
Symbols.has_value()}};
483 std::optional<std::vector<LinkerOption>>
Options;
487 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
488 return {{
"Options",
Options.has_value()}};
497 std::optional<std::vector<YAMLFlowString>>
Libs;
501 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
502 return {{
"Libraries",
Libs.has_value()}};
517 std::optional<std::vector<CallGraphEntryWeight>>
Entries;
521 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
522 return {{
"Entries",
Entries.has_value()}};
535 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
536 return {{
"Entries",
Entries.has_value()}};
552 std::optional<std::vector<VerdefEntry>>
Entries;
553 std::optional<llvm::yaml::Hex64>
Info;
557 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
558 return {{
"Entries",
Entries.has_value()}};
567 std::optional<std::vector<SectionOrType>>
Members;
572 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
573 return {{
"Members",
Members.has_value()}};
592 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
602 std::optional<std::vector<llvm::yaml::Hex64>>
Entries;
606 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
607 return {{
"Entries",
Entries.has_value()}};
620 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
621 return {{
"Entries",
Entries.has_value()}};
635 std::optional<std::vector<ARMIndexTableEntry>>
Entries;
639 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
640 return {{
"Entries",
Entries.has_value()}};
674 std::optional<llvm::yaml::Hex64>
Align;
691 std::vector<std::unique_ptr<Chunk>>
Chunks;
699 std::optional<DWARFYAML::Data>
DWARF;
702 std::vector<Section *> Ret;
703 for (
const std::unique_ptr<Chunk> &Sec :
Chunks)
710 for (
const std::unique_ptr<Chunk> &
C :
Chunks)
721 const NoBitsSection &S);
746 static void output(
const ELFYAML::YAMLIntUInt &Val,
void *Ctx,
749 ELFYAML::YAMLIntUInt &Val);
928 static void mapping(
IO &
IO, std::unique_ptr<ELFYAML::Chunk> &
C);
929 static std::string
validate(
IO &io, std::unique_ptr<ELFYAML::Chunk> &
C);
This file declares the YAML representation of BB address maps (SHT_LLVM_BB_ADDR_MAP / ....
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)
Utility for declaring that a std::vector of a particular type should be considered a YAML sequence.
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
YAML I/O does conversion based on types. But often native data types are just a typedef of built in i...
Represent a constant reference to an array (0 or more elements consecutively in memory),...
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
QuotingType
Describe which type of quotes should be used when quoting is necessary.
This is an optimization pass for GlobalISel generic memory operations.
@ Implicit
Not emitted register (e.g. carry, or temporary result).
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
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)
std::vector< std::pair< StringRef, bool > > getEntries() const override
std::optional< std::vector< BBAddrMapYAML::PGOAnalysisMapEntry > > PGOAnalyses
static bool classof(const Chunk *S)
std::optional< std::vector< BBAddrMapYAML::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::optional< uint16_t > VDAux
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 void mapping(IO &IO, ELFYAML::ARMIndexTableEntry &E)
static void mapping(IO &IO, ELFYAML::CallGraphEntryWeight &E)
static void mapping(IO &IO, ELFYAML::DynamicEntry &Rel)
static void mapping(IO &IO, ELFYAML::LinkerOption &Sym)
static void mapping(IO &IO, ELFYAML::NoteEntry &N)
static void mapping(IO &IO, ELFYAML::Object &Object)
static void mapping(IO &IO, ELFYAML::Relocation &Rel)
static void mapping(IO &IO, ELFYAML::SectionOrType §ionOrType)
static void mapping(IO &IO, ELFYAML::StackSizeEntry &Rel)
static void mapping(IO &IO, ELFYAML::Symbol &Symbol)
static std::string validate(IO &IO, ELFYAML::Symbol &Symbol)
static void mapping(IO &IO, ELFYAML::VerdefEntry &E)
static void mapping(IO &IO, ELFYAML::VernauxEntry &E)
static void mapping(IO &IO, ELFYAML::VerneedEntry &E)
static std::string validate(IO &io, std::unique_ptr< ELFYAML::Chunk > &C)
static void mapping(IO &IO, std::unique_ptr< ELFYAML::Chunk > &C)
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
static void bitset(IO &IO, ELFYAML::ELF_EF &Value)
static void bitset(IO &IO, ELFYAML::ELF_PF &Value)
static void bitset(IO &IO, ELFYAML::ELF_SHF &Value)
static void bitset(IO &IO, ELFYAML::MIPS_AFL_ASE &Value)
static void bitset(IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &Value)
This class should be specialized by any integer type that is a union of bit values and the YAML repre...
static void enumeration(IO &IO, ELFYAML::ELF_DYNTAG &Value)
static void enumeration(IO &IO, ELFYAML::ELF_ELFCLASS &Value)
static void enumeration(IO &IO, ELFYAML::ELF_ELFDATA &Value)
static void enumeration(IO &IO, ELFYAML::ELF_ELFOSABI &Value)
static void enumeration(IO &IO, ELFYAML::ELF_EM &Value)
static void enumeration(IO &IO, ELFYAML::ELF_ET &Value)
static void enumeration(IO &IO, ELFYAML::ELF_NT &Value)
static void enumeration(IO &IO, ELFYAML::ELF_PT &Value)
static void enumeration(IO &IO, ELFYAML::ELF_REL &Value)
static void enumeration(IO &IO, ELFYAML::ELF_SHN &Value)
static void enumeration(IO &IO, ELFYAML::ELF_SHT &Value)
static void enumeration(IO &IO, ELFYAML::ELF_STB &Value)
static void enumeration(IO &IO, ELFYAML::ELF_STT &Value)
static void enumeration(IO &IO, ELFYAML::MIPS_ABI_FP &Value)
static void enumeration(IO &IO, ELFYAML::MIPS_AFL_EXT &Value)
static void enumeration(IO &IO, ELFYAML::MIPS_AFL_REG &Value)
static void enumeration(IO &IO, ELFYAML::MIPS_ISA &Value)
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
static void output(const ELFYAML::YAMLIntUInt &Val, void *Ctx, raw_ostream &Out)
static StringRef input(StringRef Scalar, void *Ctx, ELFYAML::YAMLIntUInt &Val)
static QuotingType mustQuote(StringRef)
This class should be specialized by type that requires custom conversion to/from a yaml scalar.