LLVM 23.0.0git
BBAddrMapYAML.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file defines the YAMLIO mappings for the format-agnostic BB address
11/// map YAML types declared in BBAddrMapYAML.h.
12///
13//===----------------------------------------------------------------------===//
14
16
17namespace llvm {
18namespace yaml {
19
21 IO &IO, BBAddrMapYAML::BBAddrMapEntry &E) {
22 assert(IO.getContext() && "The IO context is not initialized");
23 IO.mapRequired("Version", E.Version);
24 IO.mapOptional("Feature", E.Feature, Hex16(0));
25 IO.mapOptional("NumBBRanges", E.NumBBRanges);
26 IO.mapOptional("BBRanges", E.BBRanges);
27}
28
30 IO &IO, BBAddrMapYAML::BBAddrMapEntry::BBRangeEntry &E) {
31 IO.mapOptional("BaseAddress", E.BaseAddress, Hex64(0));
32 IO.mapOptional("NumBlocks", E.NumBlocks);
33 IO.mapOptional("BBEntries", E.BBEntries);
34}
35
37 IO &IO, BBAddrMapYAML::BBAddrMapEntry::BBEntry &E) {
38 assert(IO.getContext() && "The IO context is not initialized");
39 IO.mapOptional("ID", E.ID);
40 IO.mapRequired("AddressOffset", E.AddressOffset);
41 IO.mapRequired("Size", E.Size);
42 IO.mapRequired("Metadata", E.Metadata);
43 IO.mapOptional("CallsiteEndOffsets", E.CallsiteEndOffsets);
44 IO.mapOptional("Hash", E.Hash);
45}
46
48 IO &IO, BBAddrMapYAML::PGOAnalysisMapEntry &E) {
49 assert(IO.getContext() && "The IO context is not initialized");
50 IO.mapOptional("FuncEntryCount", E.FuncEntryCount);
51 IO.mapOptional("PGOBBEntries", E.PGOBBEntries);
52}
53
55 IO &IO, BBAddrMapYAML::PGOAnalysisMapEntry::PGOBBEntry &E) {
56 assert(IO.getContext() && "The IO context is not initialized");
57 IO.mapOptional("BBFreq", E.BBFreq);
58 IO.mapOptional("PostLinkBBFreq", E.PostLinkBBFreq);
59 IO.mapOptional("Successors", E.Successors);
60}
61
62void MappingTraits<
63 BBAddrMapYAML::PGOAnalysisMapEntry::PGOBBEntry::SuccessorEntry>::
64 mapping(IO &IO,
65 BBAddrMapYAML::PGOAnalysisMapEntry::PGOBBEntry::SuccessorEntry &E) {
66 assert(IO.getContext() && "The IO context is not initialized");
67 IO.mapRequired("ID", E.ID);
68 IO.mapRequired("BrProb", E.BrProb);
69 IO.mapOptional("PostLinkBrFreq", E.PostLinkBrFreq);
70}
71
72} // end namespace yaml
73} // end namespace llvm
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares the YAML representation of BB address maps (SHT_LLVM_BB_ADDR_MAP / ....
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void mapOptional(StringRef Key, T &Val)
Definition YAMLTraits.h:800
void * getContext() const
void mapRequired(StringRef Key, T &Val)
Definition YAMLTraits.h:790
This is an optimization pass for GlobalISel generic memory operations.
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
Definition YAMLTraits.h:63