llvm/llvm/lib/ObjectYAML/MinidumpYAML.cpp

//===- MinidumpYAML.cpp - Minidump YAMLIO implementation ------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "llvm/ObjectYAML/MinidumpYAML.h"
#include "llvm/Support/Allocator.h"

usingnamespacellvm;
usingnamespacellvm::MinidumpYAML;
usingnamespacellvm::minidump;

/// Perform an optional yaml-mapping of an endian-aware type EndianType. The
/// only purpose of this function is to avoid casting the Default value to the
/// endian type;
template <typename EndianType>
static inline void mapOptional(yaml::IO &IO, const char *Key, EndianType &Val,
                               typename EndianType::value_type Default) {}

/// Yaml-map an endian-aware type EndianType as some other type MapType.
template <typename MapType, typename EndianType>
static inline void mapRequiredAs(yaml::IO &IO, const char *Key,
                                 EndianType &Val) {}

/// Perform an optional yaml-mapping of an endian-aware type EndianType as some
/// other type MapType.
template <typename MapType, typename EndianType>
static inline void mapOptionalAs(yaml::IO &IO, const char *Key, EndianType &Val,
                                 MapType Default) {}

namespace {
/// Return the appropriate yaml Hex type for a given endian-aware type.
template <typename EndianType> struct HexType;
template <> struct HexType<support::ulittle16_t> {};
template <> struct HexType<support::ulittle32_t> {};
template <> struct HexType<support::ulittle64_t> {};
} // namespace

/// Yaml-map an endian-aware type as an appropriately-sized hex value.
template <typename EndianType>
static inline void mapRequiredHex(yaml::IO &IO, const char *Key,
                                  EndianType &Val) {}

/// Perform an optional yaml-mapping of an endian-aware type as an
/// appropriately-sized hex value.
template <typename EndianType>
static inline void mapOptionalHex(yaml::IO &IO, const char *Key,
                                  EndianType &Val,
                                  typename EndianType::value_type Default) {}

Stream::~Stream() = default;

Stream::StreamKind Stream::getKind(StreamType Type) {}

std::unique_ptr<Stream> Stream::create(StreamType Type) {}

void yaml::ScalarBitSetTraits<MemoryProtection>::bitset(
    IO &IO, MemoryProtection &Protect) {}

void yaml::ScalarBitSetTraits<MemoryState>::bitset(IO &IO, MemoryState &State) {}

void yaml::ScalarBitSetTraits<MemoryType>::bitset(IO &IO, MemoryType &Type) {}

void yaml::ScalarEnumerationTraits<ProcessorArchitecture>::enumeration(
    IO &IO, ProcessorArchitecture &Arch) {}

void yaml::ScalarEnumerationTraits<OSPlatform>::enumeration(IO &IO,
                                                            OSPlatform &Plat) {}

void yaml::ScalarEnumerationTraits<StreamType>::enumeration(IO &IO,
                                                            StreamType &Type) {}

void yaml::MappingTraits<CPUInfo::ArmInfo>::mapping(IO &IO,
                                                    CPUInfo::ArmInfo &Info) {}

namespace {
template <std::size_t N> struct FixedSizeHex {};
} // namespace

namespace llvm {
namespace yaml {
ScalarTraits<FixedSizeHex<N>>;
} // namespace yaml
} // namespace llvm
void yaml::MappingTraits<CPUInfo::OtherInfo>::mapping(
    IO &IO, CPUInfo::OtherInfo &Info) {}

namespace {
/// A type which only accepts strings of a fixed size for yaml conversion.
template <std::size_t N> struct FixedSizeString {};
} // namespace

namespace llvm {
namespace yaml {
ScalarTraits<FixedSizeString<N>>;
} // namespace yaml
} // namespace llvm

void yaml::MappingTraits<CPUInfo::X86Info>::mapping(IO &IO,
                                                    CPUInfo::X86Info &Info) {}

void yaml::MappingTraits<MemoryInfo>::mapping(IO &IO, MemoryInfo &Info) {}

void yaml::MappingTraits<Memory64ListStream::entry_type>::mapping(
    IO &IO, Memory64ListStream::entry_type &Mem) {}

void yaml::MappingTraits<VSFixedFileInfo>::mapping(IO &IO,
                                                   VSFixedFileInfo &Info) {}

void yaml::MappingTraits<ModuleListStream::entry_type>::mapping(
    IO &IO, ModuleListStream::entry_type &M) {}

static void streamMapping(yaml::IO &IO, RawContentStream &Stream) {}

static std::string streamValidate(RawContentStream &Stream) {}

void yaml::MappingTraits<MemoryListStream::entry_type>::mapping(
    IO &IO, MemoryListStream::entry_type &Range) {}

static void streamMapping(yaml::IO &IO, MemoryInfoListStream &Stream) {}

static void streamMapping(yaml::IO &IO, MemoryListStream &Stream) {}

static void streamMapping(yaml::IO &IO, Memory64ListStream &Stream) {}

static std::string streamValidate(Memory64ListStream &Stream) {}

static void streamMapping(yaml::IO &IO, ModuleListStream &Stream) {}

static void streamMapping(yaml::IO &IO, SystemInfoStream &Stream) {}

static void streamMapping(yaml::IO &IO, TextContentStream &Stream) {}

void yaml::MappingContextTraits<MemoryDescriptor, yaml::BinaryRef>::mapping(
    IO &IO, MemoryDescriptor &Memory, BinaryRef &Content) {}

void yaml::MappingContextTraits<MemoryDescriptor_64, yaml::BinaryRef>::mapping(
    IO &IO, MemoryDescriptor_64 &Memory, BinaryRef &Content) {}

void yaml::MappingTraits<ThreadListStream::entry_type>::mapping(
    IO &IO, ThreadListStream::entry_type &T) {}

static void streamMapping(yaml::IO &IO, ThreadListStream &Stream) {}

static void streamMapping(yaml::IO &IO, MinidumpYAML::ExceptionStream &Stream) {}

void yaml::MappingTraits<minidump::Exception>::mapping(
    yaml::IO &IO, minidump::Exception &Exception) {}

void yaml::MappingTraits<std::unique_ptr<Stream>>::mapping(
    yaml::IO &IO, std::unique_ptr<MinidumpYAML::Stream> &S) {}

std::string yaml::MappingTraits<std::unique_ptr<Stream>>::validate(
    yaml::IO &IO, std::unique_ptr<MinidumpYAML::Stream> &S) {}

void yaml::MappingTraits<Object>::mapping(IO &IO, Object &O) {}

Expected<std::unique_ptr<Stream>>
Stream::create(const Directory &StreamDesc, const object::MinidumpFile &File) {}

Expected<Object> Object::create(const object::MinidumpFile &File) {}