[BOLT][NFC] Rename ProfilePseudoProbeDesc

Address build issues due to aliasing PseudoProbeDesc, e.g.
https://lab.llvm.org/buildbot/#/builders/113/builds/2743
This commit is contained in:
Amir Ayupov
2024-09-12 21:20:35 -07:00
parent d9ed8b018d
commit cd774c873c
3 changed files with 11 additions and 10 deletions

View File

@@ -270,12 +270,12 @@ template <> struct MappingTraits<bolt::BinaryProfileHeader> {
};
namespace bolt {
struct PseudoProbeDesc {
struct ProfilePseudoProbeDesc {
std::vector<Hex64> GUID;
std::vector<Hex64> Hash;
std::vector<uint32_t> GUIDHashIdx; // Index of hash for that GUID in Hash
bool operator==(const PseudoProbeDesc &Other) const {
bool operator==(const ProfilePseudoProbeDesc &Other) const {
// Only treat empty Desc as equal
return GUID.empty() && Other.GUID.empty() && Hash.empty() &&
Other.Hash.empty() && GUIDHashIdx.empty() &&
@@ -284,8 +284,8 @@ struct PseudoProbeDesc {
};
} // end namespace bolt
template <> struct MappingTraits<bolt::PseudoProbeDesc> {
static void mapping(IO &YamlIO, bolt::PseudoProbeDesc &PD) {
template <> struct MappingTraits<bolt::ProfilePseudoProbeDesc> {
static void mapping(IO &YamlIO, bolt::ProfilePseudoProbeDesc &PD) {
YamlIO.mapRequired("gs", PD.GUID);
YamlIO.mapRequired("gh", PD.GUIDHashIdx);
YamlIO.mapRequired("hs", PD.Hash);
@@ -295,7 +295,7 @@ template <> struct MappingTraits<bolt::PseudoProbeDesc> {
} // end namespace llvm
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::BinaryFunctionProfile)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::PseudoProbeDesc)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::ProfilePseudoProbeDesc)
namespace llvm {
namespace yaml {
@@ -304,7 +304,7 @@ namespace bolt {
struct BinaryProfile {
BinaryProfileHeader Header;
std::vector<BinaryFunctionProfile> Functions;
PseudoProbeDesc PseudoProbeDesc;
ProfilePseudoProbeDesc PseudoProbeDesc;
};
} // namespace bolt
@@ -313,7 +313,7 @@ template <> struct MappingTraits<bolt::BinaryProfile> {
YamlIO.mapRequired("header", BP.Header);
YamlIO.mapRequired("functions", BP.Functions);
YamlIO.mapOptional("pseudo_probe_desc", BP.PseudoProbeDesc,
bolt::PseudoProbeDesc());
bolt::ProfilePseudoProbeDesc());
}
};

View File

@@ -47,7 +47,7 @@ public:
convertBFInlineTree(const MCPseudoProbeDecoder &Decoder,
const InlineTreeDesc &InlineTree, uint64_t GUID);
static std::tuple<yaml::bolt::PseudoProbeDesc, InlineTreeDesc>
static std::tuple<yaml::bolt::ProfilePseudoProbeDesc, InlineTreeDesc>
convertPseudoProbeDesc(const MCPseudoProbeDecoder &PseudoProbeDecoder);
static yaml::bolt::BinaryFunctionProfile

View File

@@ -81,9 +81,10 @@ YAMLProfileWriter::collectInlineTree(
return InlineTree;
}
std::tuple<yaml::bolt::PseudoProbeDesc, YAMLProfileWriter::InlineTreeDesc>
std::tuple<yaml::bolt::ProfilePseudoProbeDesc,
YAMLProfileWriter::InlineTreeDesc>
YAMLProfileWriter::convertPseudoProbeDesc(const MCPseudoProbeDecoder &Decoder) {
yaml::bolt::PseudoProbeDesc Desc;
yaml::bolt::ProfilePseudoProbeDesc Desc;
InlineTreeDesc InlineTree;
for (const MCDecodedPseudoProbeInlineTree &TopLev :