llvm/bolt/include/bolt/Profile/ProfileYAMLMapping.h

//===- bolt/Profile/ProfileYAMLMapping.h ------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Implement mapping between binary function profile and YAML representation.
//
//===----------------------------------------------------------------------===//

#ifndef BOLT_PROFILE_PROFILEYAMLMAPPING_H
#define BOLT_PROFILE_PROFILEYAMLMAPPING_H

#include "bolt/Core/BinaryFunction.h"
#include "llvm/Support/YAMLTraits.h"
#include <vector>

BinaryFunction;

namespace llvm {
namespace yaml {

namespace bolt {
struct CallSiteInfo {};
} // end namespace bolt

template <> struct MappingTraits<bolt::CallSiteInfo> {};

namespace bolt {
struct SuccessorInfo {};
} // end namespace bolt

template <> struct MappingTraits<bolt::SuccessorInfo> {};

namespace bolt {
struct PseudoProbeInfo {};
} // end namespace bolt

template <> struct MappingTraits<bolt::PseudoProbeInfo> {};
} // end namespace yaml
} // end namespace llvm

LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::bolt::CallSiteInfo)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::bolt::SuccessorInfo)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::bolt::PseudoProbeInfo)

namespace llvm {
namespace yaml {

namespace bolt {
struct BinaryBasicBlockProfile {};
} // end namespace bolt

template <> struct MappingTraits<bolt::BinaryBasicBlockProfile> {};

namespace bolt {
struct InlineTreeNode {};
} // end namespace bolt

template <> struct MappingTraits<bolt::InlineTreeNode> {};
} // end namespace yaml
} // end namespace llvm

LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::BinaryBasicBlockProfile)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::bolt::InlineTreeNode)

namespace llvm {
yaml // end namespace yaml
} // end namespace llvm

LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::BinaryFunctionProfile)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::ProfilePseudoProbeDesc)

namespace llvm {
namespace yaml {

namespace bolt {
struct BinaryProfile {};
} // namespace bolt

template <> struct MappingTraits<bolt::BinaryProfile> {};

} // end namespace yaml
} // end namespace llvm

#endif