llvm/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h

//===-- llvm/ModuleSummaryIndexYAML.h - YAML I/O for summary ----*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_IR_MODULESUMMARYINDEXYAML_H
#define LLVM_IR_MODULESUMMARYINDEXYAML_H

#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/Support/YAMLTraits.h"

namespace llvm {
namespace yaml {

template <> struct ScalarEnumerationTraits<TypeTestResolution::Kind> {};

template <> struct MappingTraits<TypeTestResolution> {};

template <>
struct ScalarEnumerationTraits<WholeProgramDevirtResolution::ByArg::Kind> {};

template <> struct MappingTraits<WholeProgramDevirtResolution::ByArg> {};

template <>
struct CustomMappingTraits<
    std::map<std::vector<uint64_t>, WholeProgramDevirtResolution::ByArg>> {};

template <> struct ScalarEnumerationTraits<WholeProgramDevirtResolution::Kind> {};

template <> struct MappingTraits<WholeProgramDevirtResolution> {};

template <>
struct CustomMappingTraits<std::map<uint64_t, WholeProgramDevirtResolution>> {};

template <> struct MappingTraits<TypeIdSummary> {};

struct FunctionSummaryYaml {};

} // End yaml namespace
} // End llvm namespace

namespace llvm {
namespace yaml {

template <> struct MappingTraits<FunctionSummary::VFuncId> {};

template <> struct MappingTraits<FunctionSummary::ConstVCall> {};

} // End yaml namespace
} // End llvm namespace

LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionSummary::VFuncId)
LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionSummary::ConstVCall)

namespace llvm {
namespace yaml {

template <> struct MappingTraits<FunctionSummaryYaml> {};

} // End yaml namespace
} // End llvm namespace

LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionSummaryYaml)

namespace llvm {
namespace yaml {

// FIXME: Add YAML mappings for the rest of the module summary.
template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {};

template <> struct CustomMappingTraits<TypeIdSummaryMapTy> {};

template <> struct MappingTraits<ModuleSummaryIndex> {};

} // End yaml namespace
} // End llvm namespace

#endif