llvm/llvm/lib/ObjectYAML/MinidumpEmitter.cpp

//===- yaml2minidump.cpp - Convert a YAML file to a minidump file ---------===//
//
// 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/ObjectYAML/yaml2obj.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>

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

namespace {
/// A helper class to manage the placement of various structures into the final
/// minidump binary. Space for objects can be allocated via various allocate***
/// methods, while the final minidump file is written by calling the writeTo
/// method. The plain versions of allocation functions take a reference to the
/// data which is to be written (and hence the data must be available until
/// writeTo is called), while the "New" versions allocate the data in an
/// allocator-managed buffer, which is available until the allocator object is
/// destroyed. For both kinds of functions, it is possible to modify the
/// data for which the space has been "allocated" until the final writeTo call.
/// This is useful for "linking" the allocated structures via their offsets.
class BlobAllocator {};
} // namespace

template <typename T, typename RangeType>
std::pair<size_t, MutableArrayRef<T>>
BlobAllocator::allocateNewArray(const iterator_range<RangeType> &Range) {}

size_t BlobAllocator::allocateString(StringRef Str) {}

void BlobAllocator::writeTo(raw_ostream &OS) const {}

static LocationDescriptor layout(BlobAllocator &File, yaml::BinaryRef Data) {}

static size_t layout(BlobAllocator &File, MinidumpYAML::ExceptionStream &S) {}

static size_t layout(BlobAllocator &File, MinidumpYAML::Memory64ListStream &S) {}

static void layout(BlobAllocator &File, MemoryListStream::entry_type &Range) {}

static void layout(BlobAllocator &File, ModuleListStream::entry_type &M) {}

static void layout(BlobAllocator &File, ThreadListStream::entry_type &T) {}

template <typename EntryT>
static size_t layout(BlobAllocator &File,
                     MinidumpYAML::detail::ListStream<EntryT> &S) {}

static Directory layout(BlobAllocator &File, Stream &S) {}

namespace llvm {
namespace yaml {

bool yaml2minidump(MinidumpYAML::Object &Obj, raw_ostream &Out,
                   ErrorHandler /*EH*/) {}

} // namespace yaml
} // namespace llvm