diff options
Diffstat (limited to 'llvm/lib/ObjectYAML/ELFYAML.cpp')
| -rw-r--r-- | llvm/lib/ObjectYAML/ELFYAML.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp index 539834fc8d4d..737ce965e69b 100644 --- a/llvm/lib/ObjectYAML/ELFYAML.cpp +++ b/llvm/lib/ObjectYAML/ELFYAML.cpp @@ -723,6 +723,7 @@ void ScalarEnumerationTraits<ELFYAML::ELF_SHT>::enumeration( ECase(SHT_LLVM_PART_PHDR); ECase(SHT_LLVM_BB_ADDR_MAP_V0); ECase(SHT_LLVM_BB_ADDR_MAP); + ECase(SHT_LLVM_FUNC_MAP); ECase(SHT_LLVM_OFFLOADING); ECase(SHT_LLVM_LTO); ECase(SHT_GNU_ATTRIBUTES); @@ -1432,6 +1433,12 @@ static void sectionMapping(IO &IO, ELFYAML::BBAddrMapSection &Section) { IO.mapOptional("PGOAnalyses", Section.PGOAnalyses); } +static void sectionMapping(IO &IO, ELFYAML::FuncMapSection &Section) { + commonSectionMapping(IO, Section); + IO.mapOptional("Content", Section.Content); + IO.mapOptional("Entries", Section.Entries); +} + static void sectionMapping(IO &IO, ELFYAML::StackSizesSection &Section) { commonSectionMapping(IO, Section); IO.mapOptional("Entries", Section.Entries); @@ -1725,6 +1732,12 @@ void MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::mapping( Section.reset(new ELFYAML::BBAddrMapSection()); sectionMapping(IO, *cast<ELFYAML::BBAddrMapSection>(Section.get())); break; + case ELF::SHT_LLVM_FUNC_MAP: + if (!IO.outputting()) + Section.reset(new ELFYAML::FuncMapSection()); + sectionMapping(IO, *cast<ELFYAML::FuncMapSection>(Section.get())); + break; + default: if (!IO.outputting()) { StringRef Name; @@ -1848,6 +1861,14 @@ void MappingTraits<ELFYAML::StackSizeEntry>::mapping( IO.mapRequired("Size", E.Size); } +void MappingTraits<ELFYAML::FuncMapEntry>::mapping(IO &IO, + ELFYAML::FuncMapEntry &E) { + assert(IO.getContext() && "The IO context is not initialized"); + IO.mapRequired("Version", E.Version); + IO.mapOptional("Address", E.Address, Hex64(0)); + IO.mapOptional("DynInstCnt", E.DynamicInstCount, 0); +} + void MappingTraits<ELFYAML::BBAddrMapEntry>::mapping( IO &IO, ELFYAML::BBAddrMapEntry &E) { assert(IO.getContext() && "The IO context is not initialized"); |
